Author: mordante
Date: Sun Sep 12 22:07:34 2010
New Revision: 46419
URL: http://svn.gna.org/viewcvs/wesnoth?rev=46419&view=rev
Log:
Add a F5 hotkey to the gui2 title screen.
This makes r46224 no longer needed and that commit will be reverted with
the next commit.
Modified:
trunk/data/core/hotkeys.cfg
trunk/src/gui/dialogs/title_screen.cpp
trunk/src/gui/dialogs/title_screen.hpp
trunk/src/hotkeys.cpp
trunk/src/hotkeys.hpp
Modified: trunk/data/core/hotkeys.cfg
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/core/hotkeys.cfg?rev=46419&r1=46418&r2=46419&view=diff
==============================================================================
--- trunk/data/core/hotkeys.cfg (original)
+++ trunk/data/core/hotkeys.cfg Sun Sep 12 22:07:34 2010
@@ -278,4 +278,8 @@
key="page down"
[/hotkey]
+[hotkey]
+ command=title_screen__reload_wml
+ key=F5
+[/hotkey]
#undef IF_APPLE_CMD_ELSE_CTRL
Modified: trunk/src/gui/dialogs/title_screen.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/dialogs/title_screen.cpp?rev=46419&r1=46418&r2=46419&view=diff
==============================================================================
--- trunk/src/gui/dialogs/title_screen.cpp (original)
+++ trunk/src/gui/dialogs/title_screen.cpp Sun Sep 12 22:07:34 2010
@@ -110,6 +110,13 @@
REGISTER_WINDOW(title_screen)
+static bool hotkey(twindow& window, const gui::TITLE_RESULT title_result)
+{
+ window.set_retval(static_cast<twindow::tretval>(title_result));
+
+ return true;
+}
+
ttitle_screen::ttitle_screen()
: video_(NULL)
, tips_()
@@ -147,6 +154,16 @@
remove_timer(timer_id);
timer_id = 0;
}
+}
+
+void ttitle_screen::post_build(CVideo&, twindow& window)
+{
+ /** @todo Should become a title screen hotkey. */
+ window.register_hotkey(hotkey::TITLE_SCREEN__RELOAD_WML
+ , boost::bind(
+ &hotkey
+ , boost::ref(window)
+ , gui::RELOAD_GAME_DATA));
}
void ttitle_screen::pre_show(CVideo& video, twindow& window)
Modified: trunk/src/gui/dialogs/title_screen.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/dialogs/title_screen.hpp?rev=46419&r1=46418&r2=46419&view=diff
==============================================================================
--- trunk/src/gui/dialogs/title_screen.hpp (original)
+++ trunk/src/gui/dialogs/title_screen.hpp Sun Sep 12 22:07:34 2010
@@ -39,6 +39,9 @@
virtual const std::string& window_id() const;
/** Inherited from tdialog. */
+ virtual void post_build(CVideo& video, twindow& window);
+
+ /** Inherited from tdialog. */
void pre_show(CVideo& video, twindow& window);
/** Inherited from tdialog. */
Modified: trunk/src/hotkeys.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/hotkeys.cpp?rev=46419&r1=46418&r2=46419&view=diff
==============================================================================
--- trunk/src/hotkeys.cpp (original)
+++ trunk/src/hotkeys.cpp Sun Sep 12 22:07:34 2010
@@ -203,6 +203,13 @@
{ hotkey::HOTKEY_USER_CMD_2, "usercommand#2", N_("User-Command#2"),
false, hotkey::SCOPE_GAME },
{ hotkey::HOTKEY_USER_CMD_3, "usercommand#3", N_("User-Command#3"),
false, hotkey::SCOPE_GAME },
#endif
+ {
+ hotkey::TITLE_SCREEN__RELOAD_WML
+ , "title_screen__reload_wml"
+ , N_("Refresh WML")
+ , true
+ , hotkey::SCOPE_GENERAL
+ },
{ hotkey::HOTKEY_NULL, NULL, NULL, true, hotkey::SCOPE_GENERAL }
};
Modified: trunk/src/hotkeys.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/hotkeys.hpp?rev=46419&r1=46418&r2=46419&view=diff
==============================================================================
--- trunk/src/hotkeys.hpp (original)
+++ trunk/src/hotkeys.hpp Sun Sep 12 22:07:34 2010
@@ -107,6 +107,8 @@
HOTKEY_USER_CMD_2,
HOTKEY_USER_CMD_3,
#endif
+ /* Gui2 specific hotkeys. */
+ TITLE_SCREEN__RELOAD_WML,
HOTKEY_NULL
};
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits