From 08a6e7e710f34b4363513b6c583ce1a6660c96b5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 20 Apr 2015 13:59:24 +0300 Subject: Add action for open yellow bar settings page (quick page). --- src/actions/windows.cpp | 18 ++++++++++++++++++ src/actions/windows.h | 1 + src/gui/popups/popupmenu.cpp | 2 ++ src/input/inputaction.h | 1 + src/input/inputactionmap.h | 9 +++++++++ src/input/pages/windows.cpp | 6 ++++++ 6 files changed, 37 insertions(+) (limited to 'src') diff --git a/src/actions/windows.cpp b/src/actions/windows.cpp index 6b359ff8d..4008245fa 100644 --- a/src/actions/windows.cpp +++ b/src/actions/windows.cpp @@ -53,6 +53,8 @@ #include "gui/widgets/tabs/chat/chattab.h" +#include "utils/gettext.h" + #ifdef EATHENA_SUPPORT #include "net/serverfeatures.h" #endif @@ -314,4 +316,20 @@ impHandler0(updaterWindowShow) return true; } +impHandler0(quickWindowShow) +{ + if (setupWindow) + { + if (setupWindow->isWindowVisible()) + { + setupWindow->doCancel(); + } + setupWindow->setVisible(true); + setupWindow->activateTab(_("Quick")); + setupWindow->requestMoveToTop(); + return true; + } + return false; +} + } // namespace Actions diff --git a/src/actions/windows.h b/src/actions/windows.h index e3a4120cf..59ffc502e 100644 --- a/src/actions/windows.h +++ b/src/actions/windows.h @@ -53,6 +53,7 @@ namespace Actions decHandler(updaterWindowShow); decHandler(bankWindowShow); decHandler(cartWindowShow); + decHandler(quickWindowShow); } // namespace Actions #undef decHandler diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index b81ab29dd..a2d8b1ef5 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -1966,6 +1966,8 @@ void PopupMenu::showPopup(const int x, const int y, const ProgressBar *const b) mBrowserBox->addRow("##3---"); // TRANSLATORS: popup menu item + mBrowserBox->addRow("/yellowbar", _("Open yellow bar settings")); + // TRANSLATORS: popup menu item mBrowserBox->addRow("reset yellow", _("Reset yellow bar")); mBrowserBox->addRow("##3---"); // TRANSLATORS: popup menu item diff --git a/src/input/inputaction.h b/src/input/inputaction.h index f39b1864b..d5bad5483 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -594,6 +594,7 @@ namespace InputAction CREATE_PUBLIC_ROOM, JOIN_ROOM, LEAVE_ROOM, + WINDOW_QUICK_SETTINGS, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index 9d6293628..54a15e806 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -4451,6 +4451,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputCondition::INGAME, "leaveroom", false}, + {"keyWindowStatusBar", + emptyKey, + emptyKey, + Input::GRP_DEFAULT | Input::GRP_GUI, + &Actions::quickWindowShow, + InputAction::NO_VALUE, 50, + InputCondition::GAME | InputCondition::NOTARGET, + "yellowbar|quickoptions", + false}, }; #undef defaultAction diff --git a/src/input/pages/windows.cpp b/src/input/pages/windows.cpp index 396facb49..8d1f8ebc7 100644 --- a/src/input/pages/windows.cpp +++ b/src/input/pages/windows.cpp @@ -199,6 +199,12 @@ SetupActionData setupActionDataWindows[] = InputAction::WINDOW_CART, "", }, + { + // TRANSLATORS: input action name + N_("Quick settings window"), + InputAction::WINDOW_QUICK_SETTINGS, + "", + }, { // TRANSLATORS: input action label N_("Tabs"), -- cgit v1.2.3-70-g09d2