mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 08:21:07 +02:00
gui/personalize.cpp: try to fix usermenu delete
Origin commit data
------------------
Commit: d2c836049b
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2014-09-09 (Tue, 09 Sep 2014)
This commit is contained in:
@@ -231,9 +231,19 @@ int CPersonalizeGui::exec(CMenuTarget* parent, const string & actionKey)
|
||||
if (ak && *ak && std::string(ak).find_first_not_of("0123456789") == std::string::npos) {
|
||||
int i = atoi(ak);
|
||||
if (i > -1) {
|
||||
for (unsigned int j = 4; j < g_settings.usermenu.size(); j++) {
|
||||
std::string name = to_string(j);
|
||||
std::string usermenu_key("usermenu_key_");
|
||||
usermenu_key += name;
|
||||
CNeutrinoApp::getInstance()->getConfigFile()->deleteKey(usermenu_key);
|
||||
std::string txt1("usermenu_tv_");
|
||||
txt1 += name;
|
||||
CNeutrinoApp::getInstance()->getConfigFile()->deleteKey(txt1);
|
||||
txt1 += "_text";
|
||||
CNeutrinoApp::getInstance()->getConfigFile()->deleteKey(txt1);
|
||||
}
|
||||
delete g_settings.usermenu[i];
|
||||
g_settings.usermenu[i] = NULL;
|
||||
CNeutrinoApp::getInstance()->getConfigFile()->clear();
|
||||
}
|
||||
}
|
||||
uMenu->removeItem(selected);
|
||||
@@ -247,8 +257,6 @@ int CPersonalizeGui::exec(CMenuTarget* parent, const string & actionKey)
|
||||
parent->hide();
|
||||
|
||||
if (actionKey == ">a") {
|
||||
int selected = uMenu->getSelected();
|
||||
|
||||
unsigned int i = g_settings.usermenu.size();
|
||||
CUserMenuSetup *cms = new CUserMenuSetup(LOCALE_USERMENU_HEAD, i);
|
||||
SNeutrinoSettings::usermenu_t *um = new SNeutrinoSettings::usermenu_t;
|
||||
@@ -257,10 +265,13 @@ int CPersonalizeGui::exec(CMenuTarget* parent, const string & actionKey)
|
||||
CMenuDForwarder *fw = new CMenuDForwarder(CRCInput::getKeyName(um->key), true, um->title, cms, to_string(i).c_str());
|
||||
cms->setCaller(fw);
|
||||
|
||||
#if 0
|
||||
int selected = uMenu->getSelected();
|
||||
if (selected >= customkey_offset)
|
||||
uMenu->insertItem(selected, fw);
|
||||
else
|
||||
uMenu->addItem(fw);
|
||||
#endif
|
||||
uMenu->addItem(fw, true);
|
||||
uMenu->hide();
|
||||
return menu_return::RETURN_REPAINT;
|
||||
}
|
||||
|
Reference in New Issue
Block a user