mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 00:11:08 +02:00
gui/personalize.cpp: fix memleak in addSeparator(), fix close all on menu key
Origin commit data
------------------
Commit: c2578710fe
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2012-05-03 (Thu, 03 May 2012)
This commit is contained in:
@@ -236,7 +236,7 @@ int CPersonalizeGui::exec(CMenuTarget* parent, const string & actionKey)
|
||||
|
||||
if(actionKey == a_key)
|
||||
{ // Personalize options menu
|
||||
ShowMenuOptions(i);
|
||||
res = ShowMenuOptions(i);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -440,7 +440,7 @@ void CPersonalizeGui::ShowPluginMenu(CMenuWidget* p_widget)
|
||||
|
||||
//Here we give the user the option to enable, disable, or PIN protect items on the Main Menu.
|
||||
//We also provide a means of PIN protecting the menu itself.
|
||||
void CPersonalizeGui::ShowMenuOptions(const int& widget)
|
||||
int CPersonalizeGui::ShowMenuOptions(const int& widget)
|
||||
{
|
||||
string mn_name = v_widget[widget]->getName();
|
||||
printf("[neutrino-personalize] exec %s...\n", __FUNCTION__);
|
||||
@@ -516,10 +516,10 @@ void CPersonalizeGui::ShowMenuOptions(const int& widget)
|
||||
|
||||
}
|
||||
options_count = pm->getItemsCount();
|
||||
pm->exec (NULL, "");
|
||||
int res = pm->exec (NULL, "");
|
||||
pm->hide ();
|
||||
delete pm;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
//returns true, if found an observer item
|
||||
@@ -719,13 +719,19 @@ void CPersonalizeGui::addSeparator(const int& widget_id, const neutrino_locale_t
|
||||
//expands with parameter within you can show or hide this item in personalize options
|
||||
void CPersonalizeGui::addSeparator(CMenuWidget &widget, const neutrino_locale_t locale_text, const int& item_mode)
|
||||
{
|
||||
#if 0
|
||||
menu_item_t to_add_sep[2] = { {&widget, GenericMenuSeparatorLine, false, locale_text, NULL, item_mode, NULL},
|
||||
{&widget, new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, locale_text), false, locale_text, NULL, item_mode, NULL}};
|
||||
|
||||
if (locale_text == NONEXISTANT_LOCALE)
|
||||
v_item.push_back(to_add_sep[0]);
|
||||
else
|
||||
v_item.push_back(to_add_sep[1]);
|
||||
#endif
|
||||
if (locale_text == NONEXISTANT_LOCALE) {
|
||||
//v_item.push_back(to_add_sep[0]);
|
||||
menu_item_t to_add_sep = {&widget, GenericMenuSeparatorLine, false, locale_text, NULL, item_mode, NULL};
|
||||
v_item.push_back(to_add_sep);
|
||||
} else {
|
||||
//v_item.push_back(to_add_sep[1]);
|
||||
menu_item_t to_add_sep = {&widget, new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, locale_text), false, locale_text, NULL, item_mode, NULL};
|
||||
v_item.push_back(to_add_sep);
|
||||
}
|
||||
}
|
||||
|
||||
//returns available count of personalized item for definied widget
|
||||
|
Reference in New Issue
Block a user