gui/keybind_setup: use CMenuOptionNumberChooser instead of CStringInput

This commit is contained in:
martii
2013-12-22 13:02:24 +01:00
committed by Jacek Jendrzej
parent 5131b0e55f
commit dc61c83103
3 changed files with 19 additions and 25 deletions

View File

@@ -236,22 +236,22 @@ int CKeybindSetup::showKeySetup()
keySettings->addItem(mf);
//rc tuning
CStringInput keySettings_repeat_genericblocker(LOCALE_KEYBINDINGMENU_REPEATBLOCKGENERIC, g_settings.repeat_genericblocker, 3, LOCALE_REPEATBLOCKER_HINT_1, LOCALE_REPEATBLOCKER_HINT_2, "0123456789 ", this);
CStringInput keySettings_repeatBlocker(LOCALE_KEYBINDINGMENU_REPEATBLOCK, g_settings.repeat_blocker, 3, LOCALE_REPEATBLOCKER_HINT_1, LOCALE_REPEATBLOCKER_HINT_2, "0123456789 ", this);
keySettings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_KEYBINDINGMENU_RC));
if (RC_HW_SELECT) {
CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_KEYBINDINGMENU_REMOTECONTROL_HARDWARE, &g_settings.remote_control_hardware, KEYBINDINGMENU_REMOTECONTROL_HARDWARE_OPTIONS, KEYBINDINGMENU_REMOTECONTROL_HARDWARE_OPTION_COUNT, true);
mc->setHint("", LOCALE_MENU_HINT_KEY_HARDWARE);
keySettings->addItem(mc);
}
mf = new CMenuForwarder(LOCALE_KEYBINDINGMENU_REPEATBLOCK, true, g_settings.repeat_blocker, &keySettings_repeatBlocker);
mf->setHint("", LOCALE_MENU_HINT_KEY_REPEATBLOCK);
keySettings->addItem(mf);
CMenuOptionNumberChooser *cc;
cc = new CMenuOptionNumberChooser(LOCALE_KEYBINDINGMENU_REPEATBLOCK,
&g_settings.repeat_blocker, true, 0, 999);
cc->setHint("", LOCALE_MENU_HINT_KEY_REPEATBLOCK);
keySettings->addItem(cc);
mf = new CMenuForwarder(LOCALE_KEYBINDINGMENU_REPEATBLOCKGENERIC, true, g_settings.repeat_genericblocker, &keySettings_repeat_genericblocker);
mf->setHint("", LOCALE_MENU_HINT_KEY_REPEATBLOCKGENERIC);
keySettings->addItem(mf);
cc = new CMenuOptionNumberChooser(LOCALE_KEYBINDINGMENU_REPEATBLOCKGENERIC,
&g_settings.repeat_genericblocker, true, 0, 999);
cc->setHint("", LOCALE_MENU_HINT_KEY_REPEATBLOCKGENERIC);
keySettings->addItem(cc);
int res = keySettings->exec(NULL, "");
@@ -430,8 +430,8 @@ bool CKeybindSetup::changeNotify(const neutrino_locale_t OptionName, void * /* d
{
if (ARE_LOCALES_EQUAL(OptionName, LOCALE_KEYBINDINGMENU_REPEATBLOCKGENERIC) ||
ARE_LOCALES_EQUAL(OptionName, LOCALE_KEYBINDINGMENU_REPEATBLOCK)) {
unsigned int fdelay = atoi(g_settings.repeat_blocker);
unsigned int xdelay = atoi(g_settings.repeat_genericblocker);
unsigned int fdelay = g_settings.repeat_blocker;
unsigned int xdelay = g_settings.repeat_genericblocker;
g_RCInput->repeat_block = fdelay * 1000;
g_RCInput->repeat_block_generic = xdelay * 1000;