From a303935048c5e34858a7aac35ca6c9b03f42acd4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 19 May 2013 23:57:21 +0300 Subject: improve setup input tab. --- src/gui/setup_input.cpp | 15 ++++----------- src/gui/setup_input.h | 6 ++---- 2 files changed, 6 insertions(+), 15 deletions(-) (limited to 'src') 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; }; -- cgit v1.2.3-70-g09d2