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/setup_input.cpp | |
parent | 4458420ebe4546b7fdc9c1c9b327e237ced2cd0e (diff) | |
download | manaverse-a303935048c5e34858a7aac35ca6c9b03f42acd4.tar.gz manaverse-a303935048c5e34858a7aac35ca6c9b03f42acd4.tar.bz2 manaverse-a303935048c5e34858a7aac35ca6c9b03f42acd4.tar.xz manaverse-a303935048c5e34858a7aac35ca6c9b03f42acd4.zip |
improve setup input tab.
Diffstat (limited to 'src/gui/setup_input.cpp')
-rw-r--r-- | src/gui/setup_input.cpp | 15 |
1 files changed, 4 insertions, 11 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(); } |