diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-05-19 23:57:21 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-05-21 00:02:09 +0300 |
commit | a303935048c5e34858a7aac35ca6c9b03f42acd4 (patch) | |
tree | 927c2e4a0098a1754b353177eee123f9f9c617ba /src/gui | |
parent | 4458420ebe4546b7fdc9c1c9b327e237ced2cd0e (diff) | |
download | manaplus-a303935048c5e34858a7aac35ca6c9b03f42acd4.tar.gz manaplus-a303935048c5e34858a7aac35ca6c9b03f42acd4.tar.bz2 manaplus-a303935048c5e34858a7aac35ca6c9b03f42acd4.tar.xz manaplus-a303935048c5e34858a7aac35ca6c9b03f42acd4.zip |
improve setup input tab.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/setup_input.cpp | 15 | ||||
-rw-r--r-- | src/gui/setup_input.h | 6 |
2 files changed, 6 insertions, 15 deletions
diff --git a/src/gui/setup_input.cpp b/src/gui/setup_input.cpp index 6adbe5d9a..fa77996dd 100644 --- a/src/gui/setup_input.cpp +++ b/src/gui/setup_input.cpp @@ -65,13 +65,13 @@ class KeyListModel final : public gcn::ListModel /** * Returns the number of elements in container. */ - int getNumberOfElements() + int getNumberOfElements() override { return mSize; } /** * Returns element from container. */ - std::string getElementAt(int i) + std::string getElementAt(int i) override { return setupActionData[selectedData][i].text; } /** @@ -122,9 +122,7 @@ Setup_Input::Setup_Input(const Widget2 *const widget) : } mKeyListModel->setSize(mActionDataSize[0]); - refreshKeys(); - mKeyList->addActionListener(this); ScrollArea *const scrollArea = new ScrollArea(mKeyList, @@ -133,12 +131,9 @@ Setup_Input::Setup_Input(const Widget2 *const widget) : mAssignKeyButton->addActionListener(this); mAssignKeyButton->setEnabled(false); - mUnassignKeyButton->addActionListener(this); mUnassignKeyButton->setEnabled(false); - mResetKeysButton->addActionListener(this); - mDefaultButton->addActionListener(this); mTabs->addActionListener(this); @@ -194,8 +189,8 @@ void Setup_Input::apply() if (inputManager.hasConflicts(key1, key2)) { - std::string str1 = keyToString(key1); - std::string str2 = keyToString(key2); + const std::string str1 = keyToString(key1); + const std::string str2 = keyToString(key2); // TRANSLATORS: input settings error header new OkDialog(_("Key Conflict(s) Detected."), @@ -211,10 +206,8 @@ void Setup_Input::apply() void Setup_Input::cancel() { keyUnresolved(); - inputManager.retrieve(); keyboard.setEnabled(true); - refreshKeys(); } diff --git a/src/gui/setup_input.h b/src/gui/setup_input.h index 6548b70ba..bd5dd4654 100644 --- a/src/gui/setup_input.h +++ b/src/gui/setup_input.h @@ -53,9 +53,9 @@ class Setup_Input final : public SetupTab */ ~Setup_Input(); - void apply(); + void apply() override; - void cancel(); + void cancel() override; void action(const gcn::ActionEvent &event) override; @@ -98,9 +98,7 @@ class Setup_Input final : public SetupTab Button *mDefaultButton; Button *mResetKeysButton; TabStrip *mTabs; - bool mKeySetting; /**< flag to check if key being set. */ - int *mActionDataSize; }; |