summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-03-08 22:08:22 +0300
committerAndrei Karas <akaras@inbox.ru>2014-03-08 22:19:55 +0300
commita149a49aa167cb7122afc6b12bdb4af9fa90394c (patch)
tree4e2baf673cda888b94d1d640a055c6046105ffa9 /src
parent9247c5a23757e01ef7ee91dd5655fcab177e5e6d (diff)
downloadmv-a149a49aa167cb7122afc6b12bdb4af9fa90394c.tar.gz
mv-a149a49aa167cb7122afc6b12bdb4af9fa90394c.tar.bz2
mv-a149a49aa167cb7122afc6b12bdb4af9fa90394c.tar.xz
mv-a149a49aa167cb7122afc6b12bdb4af9fa90394c.zip
Add about button.
Diffstat (limited to 'src')
-rw-r--r--src/actionmanager.cpp14
-rw-r--r--src/actionmanager.h1
-rw-r--r--src/client.cpp11
-rw-r--r--src/client.h1
-rw-r--r--src/gui/setupactiondata.h6
-rw-r--r--src/input/keyboarddata.h7
-rw-r--r--src/input/keydata.h1
7 files changed, 39 insertions, 2 deletions
diff --git a/src/actionmanager.cpp b/src/actionmanager.cpp
index b8ea34286..1eb1da4e3 100644
--- a/src/actionmanager.cpp
+++ b/src/actionmanager.cpp
@@ -703,7 +703,7 @@ impHandler0(hideWindows)
return true;
}
-impHandler0(helpWindowShow)
+static bool showHelpPage(const std::string &page)
{
if (helpWindow)
{
@@ -713,7 +713,7 @@ impHandler0(helpWindowShow)
}
else
{
- helpWindow->loadHelp("index");
+ helpWindow->loadHelp(page);
helpWindow->requestMoveToTop();
}
return true;
@@ -721,6 +721,16 @@ impHandler0(helpWindowShow)
return false;
}
+impHandler0(helpWindowShow)
+{
+ showHelpPage("index");
+}
+
+impHandler0(aboutWindowShow)
+{
+ showHelpPage("about");
+}
+
static void showHideWindow(Window *const window)
{
if (window)
diff --git a/src/actionmanager.h b/src/actionmanager.h
index ca8c3e2b9..7a0ad6e17 100644
--- a/src/actionmanager.h
+++ b/src/actionmanager.h
@@ -102,6 +102,7 @@ namespace ActionManager
decHandler(hideWindows);
decHandler(helpWindowShow);
+ decHandler(aboutWindowShow);
decHandler(setupWindowShow);
decHandler(statusWindowShow);
decHandler(inventoryWindowShow);
diff --git a/src/client.cpp b/src/client.cpp
index a462f8603..2f2341ea7 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -234,6 +234,7 @@ Client::Client(const Options &options) :
mSetupButton(nullptr),
mVideoButton(nullptr),
mHelpButton(nullptr),
+ mAboutButton(nullptr),
mThemesButton(nullptr),
mPerfomanceButton(nullptr),
#ifdef ANDROID
@@ -1146,6 +1147,9 @@ int Client::gameExec()
ADDBUTTON(mThemesButton, new Button(mDesktop,
// TRANSLATORS: theme tab quick button
_("Theme"), "Themes", this))
+ ADDBUTTON(mAboutButton, new Button(mDesktop,
+ // TRANSLATORS: theme tab quick button
+ _("About"), "about", this))
ADDBUTTON(mHelpButton, new Button(mDesktop,
// TRANSLATORS: theme tab quick button
_("Help"), "help", this))
@@ -1579,6 +1583,8 @@ int Client::gameExec()
mVideoButton = nullptr;
delete mThemesButton;
mThemesButton = nullptr;
+ delete mAboutButton;
+ mAboutButton = nullptr;
delete mHelpButton;
mHelpButton = nullptr;
delete mPerfomanceButton;
@@ -1869,6 +1875,11 @@ void Client::action(const ActionEvent &event)
inputManager.executeAction(Input::KEY_WINDOW_HELP);
return;
}
+ else if (eventId == "about")
+ {
+ inputManager.executeAction(Input::KEY_WINDOW_ABOUT);
+ return;
+ }
else if (eventId == "Video")
{
tab = "Video";
diff --git a/src/client.h b/src/client.h
index fe48418e7..fd1942684 100644
--- a/src/client.h
+++ b/src/client.h
@@ -425,6 +425,7 @@ private:
Button *mSetupButton;
Button *mVideoButton;
Button *mHelpButton;
+ Button *mAboutButton;
Button *mThemesButton;
Button *mPerfomanceButton;
#ifdef ANDROID
diff --git a/src/gui/setupactiondata.h b/src/gui/setupactiondata.h
index aa07e24c4..d146a334f 100644
--- a/src/gui/setupactiondata.h
+++ b/src/gui/setupactiondata.h
@@ -366,6 +366,12 @@ static SetupActionData setupActionData2[] =
},
{
// TRANSLATORS: input action name
+ N_("About Window"),
+ Input::KEY_WINDOW_ABOUT,
+ "",
+ },
+ {
+ // TRANSLATORS: input action name
N_("Help Window"),
Input::KEY_WINDOW_HELP,
"",
diff --git a/src/input/keyboarddata.h b/src/input/keyboarddata.h
index a3fbbeab5..2b49a9186 100644
--- a/src/input/keyboarddata.h
+++ b/src/input/keyboarddata.h
@@ -2172,6 +2172,13 @@ static const KeyData keyData[Input::KEY_TOTAL] = {
nullptr,
Input::KEY_NO_VALUE, 50,
COND_DEFAULT},
+ {"keyWindowAbout",
+ INPUT_UNKNOWN, Input::KEY_NO_VALUE,
+ INPUT_UNKNOWN, Input::KEY_NO_VALUE,
+ Input::GRP_DEFAULT | Input::GRP_GUI,
+ &ActionManager::aboutWindowShow,
+ Input::KEY_NO_VALUE, 50,
+ COND_SHORTCUT0},
};
#endif // INPUT_KEYBOARDDATA_H
diff --git a/src/input/keydata.h b/src/input/keydata.h
index e8b44bd64..41a0e85a5 100644
--- a/src/input/keydata.h
+++ b/src/input/keydata.h
@@ -370,6 +370,7 @@ namespace Input
KEY_GUI_F10,
KEY_GUI_F11,
KEY_GUI_F12,
+ KEY_WINDOW_ABOUT,
KEY_TOTAL
};
} // namespace Input