diff --git a/src/gui/dialogs/addon/description.cpp b/src/gui/dialogs/addon/description.cpp index 808d0d58c37..bf6d8241be9 100644 --- a/src/gui/dialogs/addon/description.cpp +++ b/src/gui/dialogs/addon/description.cpp @@ -71,7 +71,7 @@ namespace gui2 { * @end{table} */ -REGISTER_WINDOW(addon_description) +REGISTER_DIALOG(addon_description) void taddon_description::pre_show(CVideo& /*video*/, twindow& window) { diff --git a/src/gui/dialogs/addon/description.hpp b/src/gui/dialogs/addon/description.hpp index 9eca310f81f..18e3dee08c7 100644 --- a/src/gui/dialogs/addon/description.hpp +++ b/src/gui/dialogs/addon/description.hpp @@ -50,7 +50,7 @@ public: taddon_description(const addon_info& ainfo) : ainfo_(ainfo) {} - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ diff --git a/src/gui/dialogs/addon_connect.cpp b/src/gui/dialogs/addon_connect.cpp index 2f9d2534b11..e06426545ce 100644 --- a/src/gui/dialogs/addon_connect.cpp +++ b/src/gui/dialogs/addon_connect.cpp @@ -45,7 +45,7 @@ namespace gui2 { * @end{table} */ -REGISTER_WINDOW(addon_connect) +REGISTER_DIALOG(addon_connect) void taddon_connect::pre_show(CVideo& /*video*/, twindow& window) { diff --git a/src/gui/dialogs/addon_connect.hpp b/src/gui/dialogs/addon_connect.hpp index 71bcd6590a1..b68c1801b5e 100644 --- a/src/gui/dialogs/addon_connect.hpp +++ b/src/gui/dialogs/addon_connect.hpp @@ -59,7 +59,7 @@ private: bool allow_updates_; bool allow_remove_; - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ diff --git a/src/gui/dialogs/addon_list.cpp b/src/gui/dialogs/addon_list.cpp index 8e4cfa41570..1f8ba6b8f8c 100644 --- a/src/gui/dialogs/addon_list.cpp +++ b/src/gui/dialogs/addon_list.cpp @@ -60,7 +60,7 @@ namespace gui2 { * @end{table} */ -REGISTER_WINDOW(addon_list) +REGISTER_DIALOG(addon_list) void taddon_list::pre_show(CVideo& /*video*/, twindow& window) { diff --git a/src/gui/dialogs/addon_list.hpp b/src/gui/dialogs/addon_list.hpp index 8eded7698a4..5ebb735e8de 100644 --- a/src/gui/dialogs/addon_list.hpp +++ b/src/gui/dialogs/addon_list.hpp @@ -34,7 +34,7 @@ public: private: - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ diff --git a/src/gui/dialogs/campaign_difficulty.cpp b/src/gui/dialogs/campaign_difficulty.cpp index ca7d02cc9c9..e6186552552 100644 --- a/src/gui/dialogs/campaign_difficulty.cpp +++ b/src/gui/dialogs/campaign_difficulty.cpp @@ -60,7 +60,7 @@ namespace gui2 { * @end{table} */ -REGISTER_WINDOW(campaign_difficulty) +REGISTER_DIALOG(campaign_difficulty) tcampaign_difficulty::tcampaign_difficulty(const std::vector& items) : index_(-1), items_() diff --git a/src/gui/dialogs/campaign_difficulty.hpp b/src/gui/dialogs/campaign_difficulty.hpp index 5a217d4c125..54c885ea645 100644 --- a/src/gui/dialogs/campaign_difficulty.hpp +++ b/src/gui/dialogs/campaign_difficulty.hpp @@ -38,7 +38,7 @@ private: int index_; std::vector items_; - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ diff --git a/src/gui/dialogs/campaign_selection.cpp b/src/gui/dialogs/campaign_selection.cpp index 35e35cd7364..2f30b2a76ee 100644 --- a/src/gui/dialogs/campaign_selection.cpp +++ b/src/gui/dialogs/campaign_selection.cpp @@ -74,7 +74,7 @@ namespace gui2 { * @end{table} */ -REGISTER_WINDOW(campaign_selection) +REGISTER_DIALOG(campaign_selection) void tcampaign_selection::campaign_selected(twindow& window) { diff --git a/src/gui/dialogs/campaign_selection.hpp b/src/gui/dialogs/campaign_selection.hpp index c78ee9a138b..f06994c1d62 100644 --- a/src/gui/dialogs/campaign_selection.hpp +++ b/src/gui/dialogs/campaign_selection.hpp @@ -42,7 +42,7 @@ private: /** Called when another campaign is selected. */ void campaign_selected(twindow& window); - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ diff --git a/src/gui/dialogs/data_manage.cpp b/src/gui/dialogs/data_manage.cpp index 3d1f8c63b57..356d9e8f129 100644 --- a/src/gui/dialogs/data_manage.cpp +++ b/src/gui/dialogs/data_manage.cpp @@ -47,7 +47,7 @@ namespace gui2 { -REGISTER_WINDOW(data_manage) +REGISTER_DIALOG(data_manage) tdata_manage::tdata_manage(const config& cache_config) : txtFilter_(register_text("txtFilter", false)) diff --git a/src/gui/dialogs/data_manage.hpp b/src/gui/dialogs/data_manage.hpp index 3f926e2f07e..8a21cc009ba 100644 --- a/src/gui/dialogs/data_manage.hpp +++ b/src/gui/dialogs/data_manage.hpp @@ -40,7 +40,7 @@ protected: private: - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; bool filter_text_changed(ttext_* textbox, const std::string& text); diff --git a/src/gui/dialogs/debug_clock.cpp b/src/gui/dialogs/debug_clock.cpp index 2b8627c29b7..3543f7a4dbe 100644 --- a/src/gui/dialogs/debug_clock.cpp +++ b/src/gui/dialogs/debug_clock.cpp @@ -70,7 +70,7 @@ namespace gui2 { * @end{table} */ -REGISTER_WINDOW(debug_clock) +REGISTER_DIALOG(debug_clock) void tdebug_clock::pre_show(CVideo& /*video*/, twindow& window) { diff --git a/src/gui/dialogs/debug_clock.hpp b/src/gui/dialogs/debug_clock.hpp index 7fbdb207536..de7484f5b4a 100644 --- a/src/gui/dialogs/debug_clock.hpp +++ b/src/gui/dialogs/debug_clock.hpp @@ -122,7 +122,7 @@ private: */ ttime time_; - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ diff --git a/src/gui/dialogs/dialog.hpp b/src/gui/dialogs/dialog.hpp index 8f7b5a7ceda..e7ce9c31d7c 100644 --- a/src/gui/dialogs/dialog.hpp +++ b/src/gui/dialogs/dialog.hpp @@ -28,53 +28,74 @@ namespace gui2 { /** * Registers a window. * - * Call this function to register a window. In the header of the class add the - * following code: + * This function registers a window. The registration is used to validate + * whether the config for the window exists when starting Wesnoth. + * + * @note Most of the time you want to call @ref REGISTER_DIALOG instead of this + * function. It also directly adds the code for the dialog's id function. + * + * @todo Rename the function to its full name once the old name has been unused + * for a while. + * + * @param id Id of the window, multiple dialogs can use + * the same window so the id doesn't need to be + * unique. + */ +#define REGISTER_WND( \ + id) \ +namespace { \ + \ + namespace ns_##id { \ + \ + struct tregister_helper { \ + tregister_helper() \ + { \ + register_window(#id); \ + } \ + }; \ + \ + tregister_helper register_helper; \ + } \ +} + +/** + * Registers a window for a dialog. + * + * Call this function to register a window. In the header of the class it adds + * the following code: *@code - * // Inherited from tdialog, implemented by REGISTER_WINDOW. + * // Inherited from tdialog, implemented by REGISTER_DIALOG. * virtual const std::string& id() const; *@endcode * Then use this macro in the implementation, inside the gui2 namespace. * * @note When the @ref id is "foo" and the type tfoo it's easier to use - * REGISTER_WINDOW(foo). + * REGISTER_DIALOG(foo). * * @param type Class type of the window to register. * @param id Id of the window, multiple dialogs can use * the same window so the id doesn't need to be * unique. */ -#define REGISTER_WINDOW2( \ +#define REGISTER_DIALOG2( \ type \ , id) \ -namespace { \ \ - namespace ns_##type { \ - \ - struct tregister_helper { \ - tregister_helper() \ - { \ - register_window(id); \ - } \ - }; \ - \ - tregister_helper register_helper; \ - } \ -} \ +REGISTER_WND(id) \ \ const std::string& \ type::window_id() const \ { \ - static const std::string result(id); \ + static const std::string result(#id); \ return result; \ } /** - * Wrapper for REGISTER_WINDOW2. + * Wrapper for REGISTER_DIALOG2. * - * "Calls" REGISTER_WINDOW2(twindow_id, "window_id") + * "Calls" REGISTER_DIALOG2(twindow_id, window_id) */ -#define REGISTER_WINDOW(window_id) REGISTER_WINDOW2(t##window_id, #window_id) +#define REGISTER_DIALOG(window_id) REGISTER_DIALOG2(t##window_id, window_id) /** * Abstract base class for all dialogs. diff --git a/src/gui/dialogs/edit_label.cpp b/src/gui/dialogs/edit_label.cpp index effcd85fdc1..e4ee2d45247 100644 --- a/src/gui/dialogs/edit_label.cpp +++ b/src/gui/dialogs/edit_label.cpp @@ -46,7 +46,7 @@ namespace gui2 { * @end{table} */ -REGISTER_WINDOW(edit_label) +REGISTER_DIALOG(edit_label) tedit_label::tedit_label(const std::string& label, bool team_only) : team_only_(team_only) diff --git a/src/gui/dialogs/edit_label.hpp b/src/gui/dialogs/edit_label.hpp index a6d9ff73a04..7ea9bc715bc 100644 --- a/src/gui/dialogs/edit_label.hpp +++ b/src/gui/dialogs/edit_label.hpp @@ -51,7 +51,7 @@ private: tfield_text* label_field_; - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ diff --git a/src/gui/dialogs/editor_generate_map.cpp b/src/gui/dialogs/editor_generate_map.cpp index 140deaec4de..da6ccf3bcc6 100644 --- a/src/gui/dialogs/editor_generate_map.cpp +++ b/src/gui/dialogs/editor_generate_map.cpp @@ -52,7 +52,7 @@ namespace gui2 { * @end{table} */ -REGISTER_WINDOW(editor_generate_map) +REGISTER_DIALOG(editor_generate_map) teditor_generate_map::teditor_generate_map() : map_generators_() diff --git a/src/gui/dialogs/editor_generate_map.hpp b/src/gui/dialogs/editor_generate_map.hpp index 0547591763e..3b58972fcde 100644 --- a/src/gui/dialogs/editor_generate_map.hpp +++ b/src/gui/dialogs/editor_generate_map.hpp @@ -54,7 +54,7 @@ public: private: - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ diff --git a/src/gui/dialogs/editor_new_map.cpp b/src/gui/dialogs/editor_new_map.cpp index b8d65767104..a7cd75559ad 100644 --- a/src/gui/dialogs/editor_new_map.cpp +++ b/src/gui/dialogs/editor_new_map.cpp @@ -40,7 +40,7 @@ namespace gui2 { * @end{table} */ -REGISTER_WINDOW(editor_new_map) +REGISTER_DIALOG(editor_new_map) teditor_new_map::teditor_new_map() : map_width_(register_integer("width", false)), diff --git a/src/gui/dialogs/editor_new_map.hpp b/src/gui/dialogs/editor_new_map.hpp index 14b56fcdb4f..9f8616ca048 100644 --- a/src/gui/dialogs/editor_new_map.hpp +++ b/src/gui/dialogs/editor_new_map.hpp @@ -38,7 +38,7 @@ private: tfield_integer* map_width_; tfield_integer* map_height_; - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; }; diff --git a/src/gui/dialogs/editor_resize_map.cpp b/src/gui/dialogs/editor_resize_map.cpp index 5858ba98b70..b9a8ddbc23e 100644 --- a/src/gui/dialogs/editor_resize_map.cpp +++ b/src/gui/dialogs/editor_resize_map.cpp @@ -87,7 +87,7 @@ namespace gui2 { * @end{table} */ -REGISTER_WINDOW(editor_resize_map) +REGISTER_DIALOG(editor_resize_map) /** * @todo Test whether the slider can be changed to an interger selector. diff --git a/src/gui/dialogs/editor_resize_map.hpp b/src/gui/dialogs/editor_resize_map.hpp index 5ea2ee6e42b..28817d6ad59 100644 --- a/src/gui/dialogs/editor_resize_map.hpp +++ b/src/gui/dialogs/editor_resize_map.hpp @@ -73,7 +73,7 @@ private: EXPAND_DIRECTION expand_direction_; - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; void pre_show(CVideo& video, twindow& window); diff --git a/src/gui/dialogs/editor_settings.cpp b/src/gui/dialogs/editor_settings.cpp index 09a17484932..5ab027dfd29 100644 --- a/src/gui/dialogs/editor_settings.cpp +++ b/src/gui/dialogs/editor_settings.cpp @@ -74,7 +74,7 @@ namespace gui2 { * @end{table} */ -REGISTER_WINDOW(editor_settings) +REGISTER_DIALOG(editor_settings) teditor_settings::teditor_settings() : redraw_callback_() diff --git a/src/gui/dialogs/editor_settings.hpp b/src/gui/dialogs/editor_settings.hpp index 921d9bd2095..595dc05ebc6 100644 --- a/src/gui/dialogs/editor_settings.hpp +++ b/src/gui/dialogs/editor_settings.hpp @@ -61,7 +61,7 @@ public: void set_use_mdi(bool value); private: - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ diff --git a/src/gui/dialogs/formula_debugger.cpp b/src/gui/dialogs/formula_debugger.cpp index 82c4cba5564..16e60aa4ff6 100644 --- a/src/gui/dialogs/formula_debugger.cpp +++ b/src/gui/dialogs/formula_debugger.cpp @@ -62,7 +62,7 @@ namespace gui2 { * @end{table} */ -REGISTER_WINDOW(formula_debugger) +REGISTER_DIALOG(formula_debugger) void tformula_debugger::pre_show(CVideo& /*video*/, twindow& window) { diff --git a/src/gui/dialogs/formula_debugger.hpp b/src/gui/dialogs/formula_debugger.hpp index e98975e91cd..1f93d7c0475 100644 --- a/src/gui/dialogs/formula_debugger.hpp +++ b/src/gui/dialogs/formula_debugger.hpp @@ -37,7 +37,7 @@ private: /** Inherited from tdialog. */ void pre_show(CVideo& video, twindow& window); - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /***** ***** button callbacks ***** *****/ diff --git a/src/gui/dialogs/game_delete.cpp b/src/gui/dialogs/game_delete.cpp index cffddbe2a60..d1a45b66c65 100644 --- a/src/gui/dialogs/game_delete.cpp +++ b/src/gui/dialogs/game_delete.cpp @@ -35,7 +35,7 @@ namespace gui2 { * @end{table} */ -REGISTER_WINDOW(game_delete) +REGISTER_DIALOG(game_delete) tgame_delete::tgame_delete() : chk_dont_ask_again_(register_bool("dont_ask_again")) diff --git a/src/gui/dialogs/game_delete.hpp b/src/gui/dialogs/game_delete.hpp index d3be3400e88..90e73468ace 100644 --- a/src/gui/dialogs/game_delete.hpp +++ b/src/gui/dialogs/game_delete.hpp @@ -33,7 +33,7 @@ private: /** Inherited from tdialog. */ void post_show(twindow& window); - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; tfield_bool* chk_dont_ask_again_; diff --git a/src/gui/dialogs/game_load.cpp b/src/gui/dialogs/game_load.cpp index 56677e1c5ea..c509a9bdf40 100644 --- a/src/gui/dialogs/game_load.cpp +++ b/src/gui/dialogs/game_load.cpp @@ -88,7 +88,7 @@ namespace gui2 { * @end{table} */ -REGISTER_WINDOW(game_load) +REGISTER_DIALOG(game_load) tgame_load::tgame_load(const config& cache_config) : txtFilter_(register_text("txtFilter", false)) diff --git a/src/gui/dialogs/game_load.hpp b/src/gui/dialogs/game_load.hpp index 6cf7449999c..82bf4ef169b 100644 --- a/src/gui/dialogs/game_load.hpp +++ b/src/gui/dialogs/game_load.hpp @@ -42,7 +42,7 @@ protected: private: - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; bool filter_text_changed(ttext_* textbox, const std::string& text); diff --git a/src/gui/dialogs/game_save.cpp b/src/gui/dialogs/game_save.cpp index cd51cfb8ade..8386089475c 100644 --- a/src/gui/dialogs/game_save.cpp +++ b/src/gui/dialogs/game_save.cpp @@ -45,7 +45,7 @@ namespace gui2 { * @end{table} */ -REGISTER_WINDOW(game_save) +REGISTER_DIALOG(game_save) tgame_save::tgame_save(const std::string& title, const std::string& filename) : txtFilename_(register_text("txtFilename", false)), @@ -70,7 +70,7 @@ void tgame_save::post_show(twindow& window) } -REGISTER_WINDOW(game_save_message) +REGISTER_DIALOG(game_save_message) tgame_save_message::tgame_save_message(const std::string& title, const std::string& filename, const std::string& message) : tgame_save(title, filename), @@ -84,7 +84,7 @@ void tgame_save_message::pre_show(CVideo& video, twindow& window) tgame_save::pre_show(video, window); } -REGISTER_WINDOW(game_save_oos) +REGISTER_DIALOG(game_save_oos) tgame_save_oos::tgame_save_oos(const std::string& title, const std::string& filename, const std::string& message) : tgame_save_message(title, filename, message), diff --git a/src/gui/dialogs/game_save.hpp b/src/gui/dialogs/game_save.hpp index 807363ed1f5..88b14b9fc3f 100644 --- a/src/gui/dialogs/game_save.hpp +++ b/src/gui/dialogs/game_save.hpp @@ -37,7 +37,7 @@ protected: private: - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; tfield_text* txtFilename_; @@ -51,7 +51,7 @@ public: tgame_save_message(const std::string& title, const std::string& filename="", const std::string& message=""); private: - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tgame_save. */ @@ -68,7 +68,7 @@ public: bool ignore_all() const { return ignore_all_; } private: - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ diff --git a/src/gui/dialogs/gamestate_inspector.cpp b/src/gui/dialogs/gamestate_inspector.cpp index 855440366a4..cb22aa96329 100644 --- a/src/gui/dialogs/gamestate_inspector.cpp +++ b/src/gui/dialogs/gamestate_inspector.cpp @@ -554,7 +554,7 @@ private: }; -REGISTER_WINDOW(gamestate_inspector) +REGISTER_DIALOG(gamestate_inspector) tgamestate_inspector::tgamestate_inspector(const vconfig &cfg) : view_() diff --git a/src/gui/dialogs/gamestate_inspector.hpp b/src/gui/dialogs/gamestate_inspector.hpp index d96e07e2874..7800bf62ef6 100644 --- a/src/gui/dialogs/gamestate_inspector.hpp +++ b/src/gui/dialogs/gamestate_inspector.hpp @@ -36,7 +36,7 @@ public: boost::shared_ptr get_view(); private: - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; boost::shared_ptr view_; diff --git a/src/gui/dialogs/language_selection.cpp b/src/gui/dialogs/language_selection.cpp index b70d2dd9ede..02cc122d612 100644 --- a/src/gui/dialogs/language_selection.cpp +++ b/src/gui/dialogs/language_selection.cpp @@ -49,7 +49,7 @@ namespace gui2 { * @end{table} */ -REGISTER_WINDOW(language_selection) +REGISTER_DIALOG(language_selection) void tlanguage_selection::pre_show(CVideo& /*video*/, twindow& window) { diff --git a/src/gui/dialogs/language_selection.hpp b/src/gui/dialogs/language_selection.hpp index 3b7a6a6e922..3f37fa1405e 100644 --- a/src/gui/dialogs/language_selection.hpp +++ b/src/gui/dialogs/language_selection.hpp @@ -27,7 +27,7 @@ public: private: - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ diff --git a/src/gui/dialogs/lobby_main.cpp b/src/gui/dialogs/lobby_main.cpp index 5fa81ab9fac..ac08fdd452f 100644 --- a/src/gui/dialogs/lobby_main.cpp +++ b/src/gui/dialogs/lobby_main.cpp @@ -72,7 +72,7 @@ static lg::log_domain log_lobby("lobby"); namespace gui2 { -REGISTER_WINDOW(lobby_main) +REGISTER_DIALOG(lobby_main) void tsub_player_list::init(gui2::twindow &w, const std::string &id) { diff --git a/src/gui/dialogs/lobby_main.hpp b/src/gui/dialogs/lobby_main.hpp index cf78545149f..38fda69087f 100644 --- a/src/gui/dialogs/lobby_main.hpp +++ b/src/gui/dialogs/lobby_main.hpp @@ -325,7 +325,7 @@ private: void skip_replay_changed_callback(twidget* w); - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ diff --git a/src/gui/dialogs/lobby_player_info.cpp b/src/gui/dialogs/lobby_player_info.cpp index b991be3f8c1..2d1be387324 100644 --- a/src/gui/dialogs/lobby_player_info.cpp +++ b/src/gui/dialogs/lobby_player_info.cpp @@ -27,7 +27,7 @@ namespace gui2 { -REGISTER_WINDOW(lobby_player_info) +REGISTER_DIALOG(lobby_player_info) tlobby_player_info::tlobby_player_info(events::chat_handler& chat, user_info& info, const lobby_info& li) : chat_(chat), info_(info), reason_(NULL), time_(NULL), relation_(NULL), diff --git a/src/gui/dialogs/lobby_player_info.hpp b/src/gui/dialogs/lobby_player_info.hpp index 6929a0b979e..cd36ecc2905 100644 --- a/src/gui/dialogs/lobby_player_info.hpp +++ b/src/gui/dialogs/lobby_player_info.hpp @@ -38,7 +38,7 @@ public: private: - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ diff --git a/src/gui/dialogs/message.cpp b/src/gui/dialogs/message.cpp index 159141093d0..8ed23070cc0 100644 --- a/src/gui/dialogs/message.cpp +++ b/src/gui/dialogs/message.cpp @@ -28,7 +28,7 @@ namespace gui2 { -REGISTER_WINDOW(message) +REGISTER_DIALOG(message) /** * Helper to implement private functions without modifying the header. diff --git a/src/gui/dialogs/message.hpp b/src/gui/dialogs/message.hpp index e0c11c07abb..4bdd93bd2cb 100644 --- a/src/gui/dialogs/message.hpp +++ b/src/gui/dialogs/message.hpp @@ -125,7 +125,7 @@ private: /** Holds a pointer to the buttons. */ std::vector buttons_; - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; }; diff --git a/src/gui/dialogs/mp_cmd_wrapper.cpp b/src/gui/dialogs/mp_cmd_wrapper.cpp index 2ff23dbc792..4609e88929d 100644 --- a/src/gui/dialogs/mp_cmd_wrapper.cpp +++ b/src/gui/dialogs/mp_cmd_wrapper.cpp @@ -70,7 +70,7 @@ namespace gui2 { * @end{table} */ -REGISTER_WINDOW(mp_cmd_wrapper) +REGISTER_DIALOG(mp_cmd_wrapper) tmp_cmd_wrapper::tmp_cmd_wrapper(const t_string& user) : message_(), reason_(), time_(), user_(user) { } diff --git a/src/gui/dialogs/mp_cmd_wrapper.hpp b/src/gui/dialogs/mp_cmd_wrapper.hpp index 22390be1549..476fb1a7d37 100644 --- a/src/gui/dialogs/mp_cmd_wrapper.hpp +++ b/src/gui/dialogs/mp_cmd_wrapper.hpp @@ -32,7 +32,7 @@ public: private: - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ diff --git a/src/gui/dialogs/mp_connect.cpp b/src/gui/dialogs/mp_connect.cpp index 07c9c6488e9..4dd08eb0ad5 100644 --- a/src/gui/dialogs/mp_connect.cpp +++ b/src/gui/dialogs/mp_connect.cpp @@ -72,7 +72,7 @@ public: private: std::string host_name_; - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ @@ -82,7 +82,7 @@ private: void post_show(twindow& window); }; -REGISTER_WINDOW(mp_server_list) +REGISTER_DIALOG(mp_server_list) void tmp_server_list::pre_show(CVideo& /*video*/, twindow& window) { @@ -143,7 +143,7 @@ void tmp_server_list::post_show(twindow& window) * @end{table} */ -REGISTER_WINDOW(mp_connect) +REGISTER_DIALOG(mp_connect) tmp_connect::tmp_connect() : video_(0), @@ -218,7 +218,7 @@ void tmp_connect::show_server_list(twindow& window) * @end{table} */ -REGISTER_WINDOW(mp_login) +REGISTER_DIALOG(mp_login) tmp_login::tmp_login(const t_string& label, const bool focus_password) : label_(label), focus_password_(focus_password) { } diff --git a/src/gui/dialogs/mp_connect.hpp b/src/gui/dialogs/mp_connect.hpp index b013f8ba9a0..479f4891fd4 100644 --- a/src/gui/dialogs/mp_connect.hpp +++ b/src/gui/dialogs/mp_connect.hpp @@ -31,7 +31,7 @@ private: /** Used in show in order to show list. */ CVideo* video_; - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ @@ -54,7 +54,7 @@ public: private: - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ diff --git a/src/gui/dialogs/mp_create_game.cpp b/src/gui/dialogs/mp_create_game.cpp index 77dc6817e23..6fd3dff3df1 100644 --- a/src/gui/dialogs/mp_create_game.cpp +++ b/src/gui/dialogs/mp_create_game.cpp @@ -37,7 +37,7 @@ #endif namespace gui2 { -REGISTER_WINDOW(mp_create_game) +REGISTER_DIALOG(mp_create_game) tmp_create_game::tmp_create_game(const config& cfg) : cfg_(cfg), diff --git a/src/gui/dialogs/mp_create_game.hpp b/src/gui/dialogs/mp_create_game.hpp index 962297ed095..939fe3c7115 100644 --- a/src/gui/dialogs/mp_create_game.hpp +++ b/src/gui/dialogs/mp_create_game.hpp @@ -32,7 +32,7 @@ public: private: - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ diff --git a/src/gui/dialogs/mp_create_game_set_password.cpp b/src/gui/dialogs/mp_create_game_set_password.cpp index 349e82d5cb5..d8e796df1a2 100644 --- a/src/gui/dialogs/mp_create_game_set_password.cpp +++ b/src/gui/dialogs/mp_create_game_set_password.cpp @@ -39,7 +39,7 @@ namespace gui2 { * @end{table} */ -REGISTER_WINDOW(mp_create_game_set_password) +REGISTER_DIALOG(mp_create_game_set_password) tmp_create_game_set_password::tmp_create_game_set_password(const std::string& password) : password_(password) diff --git a/src/gui/dialogs/mp_create_game_set_password.hpp b/src/gui/dialogs/mp_create_game_set_password.hpp index f6c94c39f6e..7dea1c5eb5e 100644 --- a/src/gui/dialogs/mp_create_game_set_password.hpp +++ b/src/gui/dialogs/mp_create_game_set_password.hpp @@ -38,7 +38,7 @@ private: std::string password_; tfield_text* password_field_; - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ diff --git a/src/gui/dialogs/mp_method_selection.cpp b/src/gui/dialogs/mp_method_selection.cpp index 0b1950fe53b..e483ac27abe 100644 --- a/src/gui/dialogs/mp_method_selection.cpp +++ b/src/gui/dialogs/mp_method_selection.cpp @@ -51,7 +51,7 @@ namespace gui2 { * @end{table} */ -REGISTER_WINDOW(mp_method_selection) +REGISTER_DIALOG(mp_method_selection) void tmp_method_selection::pre_show(CVideo& /*video*/, twindow& window) { diff --git a/src/gui/dialogs/mp_method_selection.hpp b/src/gui/dialogs/mp_method_selection.hpp index 69ab16d004f..6e92c08b4f1 100644 --- a/src/gui/dialogs/mp_method_selection.hpp +++ b/src/gui/dialogs/mp_method_selection.hpp @@ -37,7 +37,7 @@ private: int choice_; - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ diff --git a/src/gui/dialogs/simple_item_selector.cpp b/src/gui/dialogs/simple_item_selector.cpp index e5b3d2c09b1..5e7e9c1f486 100644 --- a/src/gui/dialogs/simple_item_selector.cpp +++ b/src/gui/dialogs/simple_item_selector.cpp @@ -61,7 +61,7 @@ namespace gui2 { * @end{table} */ -REGISTER_WINDOW(simple_item_selector) +REGISTER_DIALOG(simple_item_selector) tsimple_item_selector::tsimple_item_selector(const std::string& title, const std::string& message, list_type const& items, bool title_uses_markup, bool message_uses_markup) : index_(-1) diff --git a/src/gui/dialogs/simple_item_selector.hpp b/src/gui/dialogs/simple_item_selector.hpp index 37f18d3b48d..a8129838f44 100644 --- a/src/gui/dialogs/simple_item_selector.hpp +++ b/src/gui/dialogs/simple_item_selector.hpp @@ -65,7 +65,7 @@ private: std::string ok_label_, cancel_label_; - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ diff --git a/src/gui/dialogs/title_screen.cpp b/src/gui/dialogs/title_screen.cpp index b759e6a02fa..ed1f097e47b 100644 --- a/src/gui/dialogs/title_screen.cpp +++ b/src/gui/dialogs/title_screen.cpp @@ -85,7 +85,7 @@ namespace gui2 { * @end{table} */ -REGISTER_WINDOW(title_screen) +REGISTER_DIALOG(title_screen) bool show_debug_clock_button = false; diff --git a/src/gui/dialogs/title_screen.hpp b/src/gui/dialogs/title_screen.hpp index efd5422b1d5..90aa24dcbb1 100644 --- a/src/gui/dialogs/title_screen.hpp +++ b/src/gui/dialogs/title_screen.hpp @@ -65,7 +65,7 @@ public: private: - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ diff --git a/src/gui/dialogs/transient_message.cpp b/src/gui/dialogs/transient_message.cpp index c773e0b4536..ae012543644 100644 --- a/src/gui/dialogs/transient_message.cpp +++ b/src/gui/dialogs/transient_message.cpp @@ -26,7 +26,7 @@ namespace gui2 { -REGISTER_WINDOW(transient_message) +REGISTER_DIALOG(transient_message) void ttransient_message::pre_show(CVideo& /*video*/, twindow& window) { diff --git a/src/gui/dialogs/transient_message.hpp b/src/gui/dialogs/transient_message.hpp index 3797041e2ca..bc90bd474aa 100644 --- a/src/gui/dialogs/transient_message.hpp +++ b/src/gui/dialogs/transient_message.hpp @@ -58,7 +58,7 @@ private: /** An optional image to show at the left of the text. */ std::string image_; - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; }; diff --git a/src/gui/dialogs/unit_attack.cpp b/src/gui/dialogs/unit_attack.cpp index 66a8b7091d6..8bd48a49b57 100644 --- a/src/gui/dialogs/unit_attack.cpp +++ b/src/gui/dialogs/unit_attack.cpp @@ -54,7 +54,7 @@ namespace gui2 { * @end{table} */ -REGISTER_WINDOW(unit_attack) +REGISTER_DIALOG(unit_attack) tunit_attack::tunit_attack( const unit_map::iterator& attacker_itor diff --git a/src/gui/dialogs/unit_attack.hpp b/src/gui/dialogs/unit_attack.hpp index 4dcba4fdbbc..4a44f03eb7f 100644 --- a/src/gui/dialogs/unit_attack.hpp +++ b/src/gui/dialogs/unit_attack.hpp @@ -38,7 +38,7 @@ public: private: - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ diff --git a/src/gui/dialogs/unit_create.cpp b/src/gui/dialogs/unit_create.cpp index 5ca73684d8e..6d6e9696a85 100644 --- a/src/gui/dialogs/unit_create.cpp +++ b/src/gui/dialogs/unit_create.cpp @@ -77,7 +77,7 @@ namespace gui2 { * @end{table} */ -REGISTER_WINDOW(unit_create) +REGISTER_DIALOG(unit_create) tunit_create::tunit_create() : gender_(last_gender) diff --git a/src/gui/dialogs/unit_create.hpp b/src/gui/dialogs/unit_create.hpp index 8f61503fd98..d5ba510b29d 100644 --- a/src/gui/dialogs/unit_create.hpp +++ b/src/gui/dialogs/unit_create.hpp @@ -44,7 +44,7 @@ private: std::string choice_; std::vector type_ids_; - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; /** Inherited from tdialog. */ diff --git a/src/gui/dialogs/wml_message.cpp b/src/gui/dialogs/wml_message.cpp index a63684d13d4..07d03cd51e1 100644 --- a/src/gui/dialogs/wml_message.cpp +++ b/src/gui/dialogs/wml_message.cpp @@ -156,9 +156,9 @@ void twml_message_::post_show(twindow& window) } } -REGISTER_WINDOW(wml_message_left) +REGISTER_DIALOG(wml_message_left) -REGISTER_WINDOW(wml_message_right) +REGISTER_DIALOG(wml_message_right) int show_wml_message(const bool left_side , CVideo& video diff --git a/src/gui/dialogs/wml_message.hpp b/src/gui/dialogs/wml_message.hpp index 766a8ef4b69..a4d09e8bb12 100644 --- a/src/gui/dialogs/wml_message.hpp +++ b/src/gui/dialogs/wml_message.hpp @@ -116,7 +116,7 @@ public: private: - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; }; @@ -132,7 +132,7 @@ public: private: - /** Inherited from tdialog, implemented by REGISTER_WINDOW. */ + /** Inherited from tdialog, implemented by REGISTER_DIALOG. */ virtual const std::string& window_id() const; };