From 27c03b02b4fdf5531518501e8bccf523339693f6 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 24 Mar 2019 16:15:41 +0100 Subject: [PATCH] gui/keybind_setup: fix painted key name after use loadkeys conf --- src/gui/keybind_setup.cpp | 5 ++++- src/gui/widget/keychooser.cpp | 5 +++++ src/gui/widget/keychooser.h | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/gui/keybind_setup.cpp b/src/gui/keybind_setup.cpp index aa1a4d4aa..27964f588 100644 --- a/src/gui/keybind_setup.cpp +++ b/src/gui/keybind_setup.cpp @@ -100,13 +100,16 @@ int CKeybindSetup::exec(CMenuTarget* parent, const std::string &actionKey) if (fileBrowser.exec(CONFIGDIR) == true) { CNeutrinoApp::getInstance()->loadKeys(fileBrowser.getSelectedFile()->Name.c_str()); printf("[neutrino keybind_setup] new keys: %s\n", fileBrowser.getSelectedFile()->Name.c_str()); + for (int i = 0; i < KEYBINDS_COUNT; i++){ + keychooser[i]->reinitName(); + } } return menu_return::RETURN_REPAINT; } else if(actionKey == "savekeys") { CFileBrowser fileBrowser; fileBrowser.Dir_Mode = true; - if (fileBrowser.exec("/media") == true) { + if (fileBrowser.exec(CONFIGDIR) == true) { std::string fname = "keys.conf"; CKeyboardInput * sms = new CKeyboardInput(LOCALE_EXTRA_SAVEKEYS, &fname); sms->exec(NULL, ""); diff --git a/src/gui/widget/keychooser.cpp b/src/gui/widget/keychooser.cpp index 8473a4008..09131937a 100644 --- a/src/gui/widget/keychooser.cpp +++ b/src/gui/widget/keychooser.cpp @@ -52,6 +52,11 @@ void CKeyChooser::paint() CMenuWidget::paint(); } +void CKeyChooser::reinitName() +{ + keyName = CRCInput::getKeyName(*key); +} + int CKeyChooserItem::exec(CMenuTarget* parent, const std::string &) { neutrino_msg_t msg; diff --git a/src/gui/widget/keychooser.h b/src/gui/widget/keychooser.h index bb6050523..e8d25d582 100644 --- a/src/gui/widget/keychooser.h +++ b/src/gui/widget/keychooser.h @@ -39,7 +39,7 @@ class CKeyChooser : public CMenuWidget public: CKeyChooser(unsigned int * const Key, const neutrino_locale_t title, const std::string & Icon = ""); ~CKeyChooser(); - + void reinitName(); void paint(); const std::string & getKeyName(){return keyName;}; };