mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
*neutrino menu: fix 'memory ' of selected items in submenues
Add small helper class to manage missing values e.g. needed for deallocated widget objects. This class we can also use for other things in future! In this context I added a vector for 'selected' values needed for deeper and deallocated submenues. The identification of widgets working now with a new widget parameter named 'w_index'. setSelected() and getSelected() functions are still working, but are not needed, if we use an index -add define for default widget index -add new header file for enums -adapted many menu classes for this parameter Hope it' works fine. If you find any menu without a 'memory', please add an index. git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1908 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -39,6 +39,7 @@
|
||||
#include <global.h>
|
||||
#include <neutrino.h>
|
||||
#include <mymenu.h>
|
||||
#include <neutrino_menue.h>
|
||||
|
||||
#include <gui/widget/icons.h>
|
||||
|
||||
@@ -57,7 +58,6 @@ COsdLangSetup::COsdLangSetup(bool wizard_mode)
|
||||
is_wizard = wizard_mode;
|
||||
|
||||
width = w_max (45, 10);
|
||||
selected = -1;
|
||||
}
|
||||
|
||||
COsdLangSetup::~COsdLangSetup()
|
||||
@@ -80,15 +80,14 @@ int COsdLangSetup::exec(CMenuTarget* parent, const std::string &/*actionKey*/)
|
||||
int COsdLangSetup::showLocalSetup()
|
||||
{
|
||||
//main local setup
|
||||
CMenuWidget *localSettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_LANGUAGE, width);
|
||||
CMenuWidget *localSettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_LANGUAGE, width, 576, MN_WIDGET_ID_LANGUAGESETUP);
|
||||
localSettings->setWizardMode(is_wizard);
|
||||
localSettings->setSelected(selected);
|
||||
|
||||
//add subhead and back button
|
||||
localSettings->addIntroItems(LOCALE_LANGUAGESETUP_HEAD);
|
||||
|
||||
//language setup
|
||||
CMenuWidget * osdl_setup = new CMenuWidget(LOCALE_LANGUAGESETUP_OSD, NEUTRINO_ICON_LANGUAGE/*, width*/);
|
||||
CMenuWidget * osdl_setup = new CMenuWidget(LOCALE_LANGUAGESETUP_OSD, NEUTRINO_ICON_LANGUAGE, width, 576, MN_WIDGET_ID_LANGUAGESETUP_LOCALE);
|
||||
showLanguageSetup(osdl_setup);
|
||||
localSettings->addItem(new CMenuForwarder(LOCALE_LANGUAGESETUP_OSD, true, NULL, osdl_setup, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
|
||||
|
||||
@@ -99,7 +98,7 @@ int COsdLangSetup::showLocalSetup()
|
||||
|
||||
//prefered audio language
|
||||
CLangSelectNotifier *langNotifier = new CLangSelectNotifier();
|
||||
CMenuWidget * prefMenu = new CMenuWidget(LOCALE_AUDIOMENU_PREF_LANGUAGES, NEUTRINO_ICON_LANGUAGE/*, width*/);
|
||||
CMenuWidget * prefMenu = new CMenuWidget(LOCALE_AUDIOMENU_PREF_LANGUAGES, NEUTRINO_ICON_LANGUAGE, width, 576, MN_WIDGET_ID_LANGUAGESETUP_PREFAUDIO_LANGUAGE);
|
||||
//call menue for prefered audio languages
|
||||
showPrefMenu(prefMenu, langNotifier);
|
||||
localSettings->addItem(new CMenuForwarder(LOCALE_AUDIOMENU_PREF_LANGUAGES, true, NULL, prefMenu, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW));
|
||||
@@ -107,7 +106,6 @@ int COsdLangSetup::showLocalSetup()
|
||||
|
||||
int res = localSettings->exec(NULL, "");
|
||||
localSettings->hide();
|
||||
selected = localSettings->getSelected();
|
||||
delete localSettings;
|
||||
return res;
|
||||
}
|
||||
|
Reference in New Issue
Block a user