diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-10-02 18:57:10 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-10-02 18:57:10 +0300 |
commit | f1e92aca00a4859047e83fab76220767b9a2f814 (patch) | |
tree | 8aaa9d6853c6a8e0e8fc568c6f981cbd889b0cc3 /src/gui/setup_keyboard.cpp | |
parent | 70b520b1e876f9698bb95baa2d274ea289a0c6bd (diff) | |
parent | 99771a1fb50286fdb0b511f425312503e657eddc (diff) | |
download | plus-stripped1.1.10.2.tar.gz plus-stripped1.1.10.2.tar.bz2 plus-stripped1.1.10.2.tar.xz plus-stripped1.1.10.2.zip |
Merge branch 'master' into strippedstripped1.1.10.2
Conflicts:
packaging/debian/watch
Diffstat (limited to 'src/gui/setup_keyboard.cpp')
-rw-r--r-- | src/gui/setup_keyboard.cpp | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/src/gui/setup_keyboard.cpp b/src/gui/setup_keyboard.cpp index 5125541cf..922d9797b 100644 --- a/src/gui/setup_keyboard.cpp +++ b/src/gui/setup_keyboard.cpp @@ -153,8 +153,17 @@ void Setup_Keyboard::action(const gcn::ActionEvent &event) { if (!mKeySetting) { - mAssignKeyButton->setEnabled(true); - mUnassignKeyButton->setEnabled(true); + int i(mKeyList->getSelected()); + if (keyboard.isSeparator(i)) + { + mAssignKeyButton->setEnabled(false); + mUnassignKeyButton->setEnabled(false); + } + else + { + mAssignKeyButton->setEnabled(true); + mUnassignKeyButton->setEnabled(true); + } } } else if (event.getId() == "assign") @@ -183,11 +192,21 @@ void Setup_Keyboard::action(const gcn::ActionEvent &event) void Setup_Keyboard::refreshAssignedKey(int index) { - std::string caption; - char *temp = SDL_GetKeyName( - static_cast<SDLKey>(keyboard.getKeyValue(index))); - caption = keyboard.getKeyCaption(index) + ": " + toString(temp); - mKeyListModel->setElementAt(index, caption); + if (keyboard.isSeparator(index)) + { + const std::string str = " \342\200\225\342\200\225\342\200\225" + "\342\200\225\342\200\225 "; + mKeyListModel->setElementAt(index, str + + keyboard.getKeyCaption(index) + str); + } + else + { + std::string caption; + char *temp = SDL_GetKeyName( + static_cast<SDLKey>(keyboard.getKeyValue(index))); + caption = keyboard.getKeyCaption(index) + ": " + toString(temp); + mKeyListModel->setElementAt(index, caption); + } } void Setup_Keyboard::newKeyCallback(int index) |