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


Origin commit data
------------------
Branch: ni/coolstream
Commit: eff98c661e
Author: Thilo Graf <dbt@novatux.de>
Date: 2011-11-26 (Sat, 26 Nov 2011)

Origin message was:
------------------
*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 was generated by Migit
This commit is contained in:
2011-11-25 23:48:18 +00:00
parent 88890eda8d
commit 79be4823ec
31 changed files with 340 additions and 145 deletions

View File

@@ -39,6 +39,7 @@
#include <global.h> #include <global.h>
#include <neutrino.h> #include <neutrino.h>
#include <mymenu.h> #include <mymenu.h>
#include <neutrino_menue.h>
#include <gui/widget/icons.h> #include <gui/widget/icons.h>
#include <gui/widget/stringinput.h> #include <gui/widget/stringinput.h>
@@ -51,11 +52,9 @@
#include <system/debug.h> #include <system/debug.h>
CAudioPlayerSetup::CAudioPlayerSetup() CAudioPlayerSetup::CAudioPlayerSetup()
{ {
width = w_max (40, 10); width = w_max (40, 10);
selected = -1;
} }
CAudioPlayerSetup::~CAudioPlayerSetup() CAudioPlayerSetup::~CAudioPlayerSetup()
@@ -99,8 +98,7 @@ const CMenuOptionChooser::keyval AUDIOPLAYER_DISPLAY_ORDER_OPTIONS[AUDIOPLAYER_D
/*shows the audio setup menue*/ /*shows the audio setup menue*/
int CAudioPlayerSetup::showAudioPlayerSetup() int CAudioPlayerSetup::showAudioPlayerSetup()
{ {
CMenuWidget* audioplayerSetup = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width); CMenuWidget* audioplayerSetup = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, 576, MN_WIDGET_ID_AUDIOSETUP);
audioplayerSetup->setSelected(selected);
audioplayerSetup->addIntroItems(LOCALE_AUDIOPLAYER_NAME); audioplayerSetup->addIntroItems(LOCALE_AUDIOPLAYER_NAME);
@@ -122,7 +120,6 @@ int CAudioPlayerSetup::showAudioPlayerSetup()
int res = audioplayerSetup->exec (NULL, ""); int res = audioplayerSetup->exec (NULL, "");
audioplayerSetup->hide (); audioplayerSetup->hide ();
selected = audioplayerSetup->getSelected();
delete audioplayerSetup; delete audioplayerSetup;
return res; return res;
} }

View File

@@ -39,7 +39,7 @@
class CAudioPlayerSetup : public CMenuTarget class CAudioPlayerSetup : public CMenuTarget
{ {
private: private:
int width, selected; int width;
int showAudioPlayerSetup(); int showAudioPlayerSetup();

View File

@@ -36,6 +36,7 @@
#include <global.h> #include <global.h>
#include <neutrino.h> #include <neutrino.h>
#include <mymenu.h> #include <mymenu.h>
#include <neutrino_menue.h>
#include <gui/widget/icons.h> #include <gui/widget/icons.h>
@@ -84,7 +85,7 @@ const CMenuOptionChooser::keyval VIDEOMENU_HDMI_CEC_MODE_OPTIONS[VIDEOMENU_HDMI_
void CCECSetup::showMenu() void CCECSetup::showMenu()
{ {
//menue init //menue init
CMenuWidget *cec = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width); CMenuWidget *cec = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, 576, MN_WIDGET_ID_CEC);
cec->setSelected(selected); cec->setSelected(selected);
cec->addIntroItems(LOCALE_VIDEOMENU_HDMI_CEC); cec->addIntroItems(LOCALE_VIDEOMENU_HDMI_CEC);

View File

@@ -47,8 +47,9 @@
#include <global.h> #include <global.h>
#include <neutrino.h> #include <neutrino.h>
#include <neutrino_menue.h>
#include <gui/widget/icons.h> #include <gui/widget/icons.h>
#include "gui/widget/menue.h"
#include "gui/widget/stringinput.h" #include "gui/widget/stringinput.h"
#include "gui/widget/messagebox.h" #include "gui/widget/messagebox.h"
#include "gui/widget/hintbox.h" #include "gui/widget/hintbox.h"
@@ -60,6 +61,7 @@
#include <gui/hdd_menu.h> #include <gui/hdd_menu.h>
#include <mymenu.h> #include <mymenu.h>
#include <driver/screen_max.h>
static int my_filter(const struct dirent * dent) static int my_filter(const struct dirent * dent)
@@ -69,6 +71,16 @@ static int my_filter(const struct dirent * dent)
return 0; return 0;
} }
CHDDMenuHandler::CHDDMenuHandler()
{
width = w_max (58, 10);
}
CHDDMenuHandler::~CHDDMenuHandler()
{
}
int CHDDMenuHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/) int CHDDMenuHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/)
{ {
if (parent) if (parent)
@@ -95,7 +107,7 @@ int CHDDMenuHandler::doMenu ()
} }
CMenuWidget* hddmenu = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, 58); CMenuWidget* hddmenu = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, 576, MN_WIDGET_ID_DRIVESETUP);
hddmenu->addIntroItems(LOCALE_HDD_SETTINGS); hddmenu->addIntroItems(LOCALE_HDD_SETTINGS);
hddmenu->addItem(new CMenuForwarder(LOCALE_HDD_ACTIVATE, true, "", new CHDDDestExec(), NULL, CRCInput::RC_red,NEUTRINO_ICON_BUTTON_RED)); hddmenu->addItem(new CMenuForwarder(LOCALE_HDD_ACTIVATE, true, "", new CHDDDestExec(), NULL, CRCInput::RC_red,NEUTRINO_ICON_BUTTON_RED));

View File

@@ -46,7 +46,11 @@ public:
class CHDDMenuHandler : public CMenuTarget class CHDDMenuHandler : public CMenuTarget
{ {
private:
int width;
public: public:
CHDDMenuHandler();
~CHDDMenuHandler();
int exec( CMenuTarget* parent, const std::string &actionkey); int exec( CMenuTarget* parent, const std::string &actionkey);
int doMenu(); int doMenu();
}; };

View File

@@ -40,6 +40,7 @@
#include <global.h> #include <global.h>
#include <neutrino.h> #include <neutrino.h>
#include <mymenu.h> #include <mymenu.h>
#include <neutrino_menue.h>
#include <gui/widget/icons.h> #include <gui/widget/icons.h>
#include <gui/widget/stringinput.h> #include <gui/widget/stringinput.h>
@@ -57,7 +58,6 @@ CKeybindSetup::CKeybindSetup()
keySetupNotifier->changeNotify(NONEXISTANT_LOCALE, NULL); keySetupNotifier->changeNotify(NONEXISTANT_LOCALE, NULL);
width = w_max (40, 10); width = w_max (40, 10);
selected = -1;
} }
CKeybindSetup::~CKeybindSetup() CKeybindSetup::~CKeybindSetup()
@@ -166,11 +166,10 @@ const key_settings_struct_t key_settings[CKeybindSetup::KEYBINDS_COUNT] =
int CKeybindSetup::showKeySetup() int CKeybindSetup::showKeySetup()
{ {
//keysetup menu //keysetup menu
CMenuWidget* keySettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_KEYBINDING, width); CMenuWidget* keySettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_KEYBINDING, width, 576, MN_WIDGET_ID_KEYSETUP);
//keybindings menu //keybindings menu
CMenuWidget* bindSettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_KEYBINDING, width); CMenuWidget* bindSettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_KEYBINDING, width, 576, MN_WIDGET_ID_KEYSETUP_KEYBINDING);
keySettings->setSelected(selected);
keySettings->addIntroItems(LOCALE_MAINSETTINGS_KEYBINDING); keySettings->addIntroItems(LOCALE_MAINSETTINGS_KEYBINDING);
//keybindings //keybindings
@@ -201,7 +200,6 @@ int CKeybindSetup::showKeySetup()
int res = keySettings->exec(NULL, ""); int res = keySettings->exec(NULL, "");
keySettings->hide(); keySettings->hide();
selected = keySettings->getSelected();
delete keySettings; delete keySettings;
return res; return res;
} }
@@ -215,22 +213,22 @@ void CKeybindSetup::showKeyBindSetup(CMenuWidget *bindSettings)
keychooser[i] = new CKeyChooser(key_settings[i].keyvalue_p, key_settings[i].keydescription/*as head caption*/, NEUTRINO_ICON_SETTINGS); keychooser[i] = new CKeyChooser(key_settings[i].keyvalue_p, key_settings[i].keydescription/*as head caption*/, NEUTRINO_ICON_SETTINGS);
//modes //modes
CMenuWidget* bindSettings_modes = new CMenuWidget(LOCALE_KEYBINDINGMENU_HEAD, NEUTRINO_ICON_KEYBINDING, width); CMenuWidget* bindSettings_modes = new CMenuWidget(LOCALE_KEYBINDINGMENU_HEAD, NEUTRINO_ICON_KEYBINDING, width, 576, MN_WIDGET_ID_KEYSETUP_KEYBINDING_MODES);
showKeyBindModeSetup(bindSettings_modes); showKeyBindModeSetup(bindSettings_modes);
bindSettings->addItem(new CMenuForwarder(LOCALE_KEYBINDINGMENU_MODECHANGE, true, NULL, bindSettings_modes, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED)); bindSettings->addItem(new CMenuForwarder(LOCALE_KEYBINDINGMENU_MODECHANGE, true, NULL, bindSettings_modes, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
// channellist keybindings // channellist keybindings
CMenuWidget* bindSettings_chlist = new CMenuWidget(LOCALE_KEYBINDINGMENU_HEAD, NEUTRINO_ICON_KEYBINDING, width); CMenuWidget* bindSettings_chlist = new CMenuWidget(LOCALE_KEYBINDINGMENU_HEAD, NEUTRINO_ICON_KEYBINDING, width, 576, MN_WIDGET_ID_KEYSETUP_KEYBINDING_CHANNELLIST);
showKeyBindChannellistSetup(bindSettings_chlist); showKeyBindChannellistSetup(bindSettings_chlist);
bindSettings->addItem(new CMenuForwarder(LOCALE_KEYBINDINGMENU_CHANNELLIST, true, NULL, bindSettings_chlist, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN)); bindSettings->addItem(new CMenuForwarder(LOCALE_KEYBINDINGMENU_CHANNELLIST, true, NULL, bindSettings_chlist, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
// Zapping keys quickzap // Zapping keys quickzap
CMenuWidget* bindSettings_qzap = new CMenuWidget(LOCALE_KEYBINDINGMENU_HEAD, NEUTRINO_ICON_KEYBINDING, width); CMenuWidget* bindSettings_qzap = new CMenuWidget(LOCALE_KEYBINDINGMENU_HEAD, NEUTRINO_ICON_KEYBINDING, width, 576, MN_WIDGET_ID_KEYSETUP_KEYBINDING_QUICKZAP);
showKeyBindQuickzapSetup(bindSettings_qzap); showKeyBindQuickzapSetup(bindSettings_qzap);
bindSettings->addItem(new CMenuForwarder(LOCALE_KEYBINDINGMENU_QUICKZAP, true, NULL, bindSettings_qzap, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW)); bindSettings->addItem(new CMenuForwarder(LOCALE_KEYBINDINGMENU_QUICKZAP, true, NULL, bindSettings_qzap, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW));
//movieplayer //movieplayer
CMenuWidget* bindSettings_mplayer = new CMenuWidget(LOCALE_KEYBINDINGMENU_HEAD, NEUTRINO_ICON_KEYBINDING, width); CMenuWidget* bindSettings_mplayer = new CMenuWidget(LOCALE_KEYBINDINGMENU_HEAD, NEUTRINO_ICON_KEYBINDING, width, 576, MN_WIDGET_ID_KEYSETUP_KEYBINDING_MOVIEPLAYER);
showKeyBindMovieplayerSetup(bindSettings_mplayer); showKeyBindMovieplayerSetup(bindSettings_mplayer);
bindSettings->addItem(new CMenuForwarder(LOCALE_MAINMENU_MOVIEPLAYER, true, NULL, bindSettings_mplayer, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE)); bindSettings->addItem(new CMenuForwarder(LOCALE_MAINMENU_MOVIEPLAYER, true, NULL, bindSettings_mplayer, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE));

View File

@@ -91,7 +91,7 @@ class CKeybindSetup : public CMenuTarget
CKeySetupNotifier *keySetupNotifier; CKeySetupNotifier *keySetupNotifier;
CKeyChooser * keychooser[KEYBINDS_COUNT]; CKeyChooser * keychooser[KEYBINDS_COUNT];
int width, selected; int width;
int showKeySetup(); int showKeySetup();
void showKeyBindSetup(CMenuWidget *bindSettings); void showKeyBindSetup(CMenuWidget *bindSettings);

View File

@@ -35,7 +35,7 @@
#include <global.h> #include <global.h>
#include <neutrino.h> #include <neutrino.h>
#include <neutrino_menue.h>
#include "gui/movieplayer.h" #include "gui/movieplayer.h"
#include "gui/pictureviewer.h" #include "gui/pictureviewer.h"
@@ -56,7 +56,6 @@ CMediaPlayerMenu::CMediaPlayerMenu()
setUsageMode(); setUsageMode();
width = w_max (40, 10); //% width = w_max (40, 10); //%
selected = -1;
audioPlayer = NULL; audioPlayer = NULL;
inetPlayer = NULL; inetPlayer = NULL;
@@ -112,7 +111,7 @@ int CMediaPlayerMenu::exec(CMenuTarget* parent, const std::string &actionKey)
//show selectable mediaplayer items //show selectable mediaplayer items
void CMediaPlayerMenu::showMenu() void CMediaPlayerMenu::showMenu()
{ {
CMenuWidget *media = new CMenuWidget(menu_title, NEUTRINO_ICON_MULTIMEDIA, width); CMenuWidget *media = new CMenuWidget(menu_title, NEUTRINO_ICON_MULTIMEDIA, width, 576, MN_WIDGET_ID_MEDIA);
CMenuForwarder *fw_audio = NULL; CMenuForwarder *fw_audio = NULL;
CMenuForwarder *fw_inet = NULL; CMenuForwarder *fw_inet = NULL;
@@ -125,9 +124,6 @@ void CMediaPlayerMenu::showMenu()
if (usage_mode != MODE_VIDEO) if (usage_mode != MODE_VIDEO)
{ {
//menue init
media->setSelected(selected);
//audio player //audio player
neutrino_msg_t audio_rc = usage_mode == MODE_AUDIO ? CRCInput::RC_audio:CRCInput::RC_red; neutrino_msg_t audio_rc = usage_mode == MODE_AUDIO ? CRCInput::RC_audio:CRCInput::RC_red;
const char* audio_btn = usage_mode == MODE_AUDIO ? "" : NEUTRINO_ICON_BUTTON_RED; const char* audio_btn = usage_mode == MODE_AUDIO ? "" : NEUTRINO_ICON_BUTTON_RED;
@@ -141,7 +137,7 @@ void CMediaPlayerMenu::showMenu()
if (usage_mode == MODE_DEFAULT) if (usage_mode == MODE_DEFAULT)
{ {
//movieplayer //movieplayer
moviePlayer = new CMenuWidget(LOCALE_MAINMENU_MEDIA, NEUTRINO_ICON_MULTIMEDIA, width); moviePlayer = new CMenuWidget(LOCALE_MAINMENU_MEDIA, NEUTRINO_ICON_MULTIMEDIA, width, 576, MN_WIDGET_ID_MEDIA_MOVIEPLAYER);
fw_mp = new CMenuForwarder(LOCALE_MAINMENU_MOVIEPLAYER, true, NULL, moviePlayer, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW); fw_mp = new CMenuForwarder(LOCALE_MAINMENU_MOVIEPLAYER, true, NULL, moviePlayer, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW);
//pictureviewer //pictureviewer
@@ -188,7 +184,6 @@ void CMediaPlayerMenu::showMenu()
media->exec(NULL, ""); media->exec(NULL, "");
media->hide(); media->hide();
selected = media->getSelected();
delete media; delete media;
setUsageMode();//set default usage_mode setUsageMode();//set default usage_mode
} }

View File

@@ -40,7 +40,7 @@ class CMediaPlayerMenu : public CMenuTarget
CAudioPlayerGui *audioPlayer; CAudioPlayerGui *audioPlayer;
CAudioPlayerGui *inetPlayer; CAudioPlayerGui *inetPlayer;
int width, selected, usage_mode; int width, usage_mode;
neutrino_locale_t menu_title; neutrino_locale_t menu_title;
void showMenu(); void showMenu();

View File

@@ -32,6 +32,7 @@
#include <global.h> #include <global.h>
#include <neutrino.h> #include <neutrino.h>
#include <mymenu.h> #include <mymenu.h>
#include <neutrino_menue.h>
#include <system/setting_helpers.h> #include <system/setting_helpers.h>
#include "gui/miscsettings_menu.h" #include "gui/miscsettings_menu.h"
@@ -58,8 +59,6 @@ extern CPlugins * g_PluginList;
CMiscMenue::CMiscMenue() CMiscMenue::CMiscMenue()
{ {
width = w_max (40, 10); width = w_max (40, 10);
selected = -1;
} }
CMiscMenue::~CMiscMenue() CMiscMenue::~CMiscMenue()
@@ -162,31 +161,30 @@ int CMiscMenue::showMiscSettingsMenu()
{ {
//misc settings //misc settings
fanNotifier = new CFanControlNotifier(); fanNotifier = new CFanControlNotifier();
CMenuWidget *misc_menue = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width); CMenuWidget *misc_menue = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, 576, MN_WIDGET_ID_MISCSETUP);
misc_menue->setSelected(selected);
misc_menue->addIntroItems(LOCALE_MISCSETTINGS_HEAD); misc_menue->addIntroItems(LOCALE_MISCSETTINGS_HEAD);
//general //general
CMenuWidget *misc_menue_general = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width); CMenuWidget *misc_menue_general = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, 576, MN_WIDGET_ID_MISCSETUP_GENERAL);
showMiscSettingsMenuGeneral(misc_menue_general); showMiscSettingsMenuGeneral(misc_menue_general);
misc_menue->addItem(new CMenuForwarder(LOCALE_MISCSETTINGS_GENERAL, true, NULL, misc_menue_general, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED)); misc_menue->addItem(new CMenuForwarder(LOCALE_MISCSETTINGS_GENERAL, true, NULL, misc_menue_general, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
//energy, shutdown //energy, shutdown
if(cs_get_revision() > 7) if(cs_get_revision() > 7)
{ {
CMenuWidget *misc_menue_energy = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width); CMenuWidget *misc_menue_energy = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, 576, MN_WIDGET_ID_MISCSETUP_ENERGY);
showMiscSettingsMenuEnergy(misc_menue_energy); showMiscSettingsMenuEnergy(misc_menue_energy);
misc_menue->addItem(new CMenuForwarder(LOCALE_MISCSETTINGS_ENERGY, true, NULL, misc_menue_energy, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN)); misc_menue->addItem(new CMenuForwarder(LOCALE_MISCSETTINGS_ENERGY, true, NULL, misc_menue_energy, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
} }
//epg //epg
CMenuWidget *misc_menue_epg = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width); CMenuWidget *misc_menue_epg = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, 576, MN_WIDGET_ID_MISCSETUP_EPG);
showMiscSettingsMenuEpg(misc_menue_epg); showMiscSettingsMenuEpg(misc_menue_epg);
misc_menue->addItem(new CMenuForwarder(LOCALE_MISCSETTINGS_EPG_HEAD, true, NULL, misc_menue_epg, NULL, CRCInput::RC_yellow,NEUTRINO_ICON_BUTTON_YELLOW)); misc_menue->addItem(new CMenuForwarder(LOCALE_MISCSETTINGS_EPG_HEAD, true, NULL, misc_menue_epg, NULL, CRCInput::RC_yellow,NEUTRINO_ICON_BUTTON_YELLOW));
//filebrowser settings //filebrowser settings
CMenuWidget *misc_menue_fbrowser = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width); CMenuWidget *misc_menue_fbrowser = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, 576, MN_WIDGET_ID_MISCSETUP_FILEBROWSER);
showMiscSettingsMenuFBrowser(misc_menue_fbrowser); showMiscSettingsMenuFBrowser(misc_menue_fbrowser);
misc_menue->addItem( new CMenuForwarder(LOCALE_FILEBROWSER_HEAD, true, NULL, misc_menue_fbrowser, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE)); misc_menue->addItem( new CMenuForwarder(LOCALE_FILEBROWSER_HEAD, true, NULL, misc_menue_fbrowser, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE));
@@ -196,7 +194,7 @@ int CMiscMenue::showMiscSettingsMenu()
misc_menue->addItem(new CMenuForwarder(LOCALE_VIDEOMENU_HDMI_CEC, true, NULL, new CCECSetup() , NULL, CRCInput::RC_1)); misc_menue->addItem(new CMenuForwarder(LOCALE_VIDEOMENU_HDMI_CEC, true, NULL, new CCECSetup() , NULL, CRCInput::RC_1));
//channellist //channellist
CMenuWidget *misc_menue_chanlist = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width); CMenuWidget *misc_menue_chanlist = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, 576, MN_WIDGET_ID_MISCSETUP_CHANNELLIST);
showMiscSettingsMenuChanlist(misc_menue_chanlist); showMiscSettingsMenuChanlist(misc_menue_chanlist);
misc_menue->addItem( new CMenuForwarder(LOCALE_MISCSETTINGS_CHANNELLIST, true, NULL, misc_menue_chanlist, NULL, CRCInput::RC_2)); misc_menue->addItem( new CMenuForwarder(LOCALE_MISCSETTINGS_CHANNELLIST, true, NULL, misc_menue_chanlist, NULL, CRCInput::RC_2));
@@ -212,7 +210,6 @@ int CMiscMenue::showMiscSettingsMenu()
int res = misc_menue->exec(NULL, ""); int res = misc_menue->exec(NULL, "");
misc_menue->hide(); misc_menue->hide();
selected = misc_menue->getSelected();
delete fanNotifier; delete fanNotifier;
delete misc_menue; delete misc_menue;
return res; return res;

View File

@@ -40,7 +40,7 @@ class CMiscMenue : public CMenuTarget
{ {
private: private:
CFanControlNotifier *fanNotifier; CFanControlNotifier *fanNotifier;
int width, selected; int width;
int showMiscSettingsMenu(); int showMiscSettingsMenu();
void showMiscSettingsMenuGeneral(CMenuWidget *ms_general); void showMiscSettingsMenuGeneral(CMenuWidget *ms_general);

View File

@@ -46,6 +46,7 @@
#include <global.h> #include <global.h>
#include <neutrino.h> #include <neutrino.h>
#include <mymenu.h> #include <mymenu.h>
#include <neutrino_menue.h>
#include <driver/screen_max.h> #include <driver/screen_max.h>
@@ -62,7 +63,6 @@ CNetworkSetup::CNetworkSetup(bool wizard_mode)
is_wizard = wizard_mode; is_wizard = wizard_mode;
width = w_max (40, 10); width = w_max (40, 10);
selected = -1;
//readNetworkSettings(); //readNetworkSettings();
} }
@@ -205,9 +205,8 @@ int CNetworkSetup::showNetworkSetup()
backupNetworkSettings(); backupNetworkSettings();
//menue init //menue init
CMenuWidget* networkSettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width); CMenuWidget* networkSettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, 576, MN_WIDGET_ID_NETWORKSETUP);
networkSettings->setWizardMode(is_wizard); networkSettings->setWizardMode(is_wizard);
networkSettings->setSelected(selected);
//apply button //apply button
CMenuForwarder *m0 = new CMenuForwarder(LOCALE_NETWORKMENU_SETUPNOW, true, NULL, this, "networkapply", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); CMenuForwarder *m0 = new CMenuForwarder(LOCALE_NETWORKMENU_SETUPNOW, true, NULL, this, "networkapply", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED);
@@ -296,12 +295,12 @@ int CNetworkSetup::showNetworkSetup()
} }
//------------------------------------------------ //------------------------------------------------
//ntp submenu //ntp submenu
CMenuWidget* ntp = new CMenuWidget(LOCALE_MAINSETTINGS_NETWORK, NEUTRINO_ICON_SETTINGS, width); CMenuWidget* ntp = new CMenuWidget(LOCALE_MAINSETTINGS_NETWORK, NEUTRINO_ICON_SETTINGS, width, 576, MN_WIDGET_ID_NETWORKSETUP_NTP);
networkSettings->addItem(new CMenuForwarder(LOCALE_NETWORKMENU_NTPTITLE, true, NULL, ntp, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW)); networkSettings->addItem(new CMenuForwarder(LOCALE_NETWORKMENU_NTPTITLE, true, NULL, ntp, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW));
showNetworkNTPSetup(ntp); showNetworkNTPSetup(ntp);
//nfs mount submenu //nfs mount submenu
CMenuWidget* networkmounts = new CMenuWidget(LOCALE_MAINSETTINGS_NETWORK, NEUTRINO_ICON_SETTINGS, width); CMenuWidget* networkmounts = new CMenuWidget(LOCALE_MAINSETTINGS_NETWORK, NEUTRINO_ICON_SETTINGS, width, 576, MN_WIDGET_ID_NETWORKSETUP_MOUNTS);
networkSettings->addItem(new CMenuForwarder(LOCALE_NETWORKMENU_MOUNT, true, NULL, networkmounts, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE)); networkSettings->addItem(new CMenuForwarder(LOCALE_NETWORKMENU_MOUNT, true, NULL, networkmounts, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE));
showNetworkNFSMounts(networkmounts); showNetworkNFSMounts(networkmounts);
@@ -319,7 +318,7 @@ int CNetworkSetup::showNetworkSetup()
if(res == menu_return::RETURN_EXIT) if(res == menu_return::RETURN_EXIT)
break; break;
} }
selected = networkSettings->getSelected();
delete networkSettings; delete networkSettings;
return ret; return ret;
} }

View File

@@ -45,7 +45,7 @@ class CNetworkSetup : public CMenuTarget, CChangeObserver
private: private:
CNetworkConfig *networkConfig; CNetworkConfig *networkConfig;
int width, selected; int width;
bool is_wizard; bool is_wizard;

View File

@@ -45,6 +45,7 @@
#include <global.h> #include <global.h>
#include <neutrino.h> #include <neutrino.h>
#include <mymenu.h> #include <mymenu.h>
#include <neutrino_menue.h>
#include <gui/widget/icons.h> #include <gui/widget/icons.h>
#include <gui/widget/colorchooser.h> #include <gui/widget/colorchooser.h>
@@ -71,7 +72,6 @@ COsdSetup::COsdSetup(bool wizard_mode)
is_wizard = wizard_mode; is_wizard = wizard_mode;
width = w_max (40, 10); //% width = w_max (40, 10); //%
selected = -1;
} }
COsdSetup::~COsdSetup() COsdSetup::~COsdSetup()
@@ -214,7 +214,7 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey)
snprintf(val_x,sizeof(val_x), "%03d",g_settings.screen_xres); snprintf(val_x,sizeof(val_x), "%03d",g_settings.screen_xres);
snprintf(val_y,sizeof(val_y), "%03d",g_settings.screen_yres); snprintf(val_y,sizeof(val_y), "%03d",g_settings.screen_yres);
CMenuWidget fontscale(LOCALE_FONTMENU_HEAD, NEUTRINO_ICON_COLORS); CMenuWidget fontscale(LOCALE_FONTMENU_HEAD, NEUTRINO_ICON_COLORS, width, 576, MN_WIDGET_ID_OSDSETUP_FONTSCALE);
fontscale.addIntroItems(LOCALE_FONTMENU_SCALING); fontscale.addIntroItems(LOCALE_FONTMENU_SCALING);
CStringInput * xres_count = new CStringInput(LOCALE_FONTMENU_SCALING_X, val_x,50,200, 3, LOCALE_FONTMENU_SCALING, LOCALE_FONTMENU_SCALING_X_HINT2, "0123456789 "); CStringInput * xres_count = new CStringInput(LOCALE_FONTMENU_SCALING_X, val_x,50,200, 3, LOCALE_FONTMENU_SCALING, LOCALE_FONTMENU_SCALING_X_HINT2, "0123456789 ");
@@ -385,12 +385,11 @@ const CMenuOptionChooser::keyval OPTIONS_COLORED_EVENTS_OPTIONS[OPTIONS_COLORED_
int COsdSetup::showOsdSetup() int COsdSetup::showOsdSetup()
{ {
//osd main menu //osd main menu
/*CMenuWidget */osd_menu = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_COLORS, width); osd_menu = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_COLORS, width, 576, MN_WIDGET_ID_OSDSETUP);
osd_menu->setWizardMode(is_wizard); osd_menu->setWizardMode(is_wizard);
osd_menu->setSelected(selected);
//menu colors //menu colors
CMenuWidget *osd_menu_colors = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_COLORS, width); CMenuWidget *osd_menu_colors = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_COLORS, width, 576, MN_WIDGET_ID_OSDSETUP_MENUCOLORS);
//intro with subhead and back button //intro with subhead and back button
osd_menu->addIntroItems(LOCALE_MAINSETTINGS_OSD); osd_menu->addIntroItems(LOCALE_MAINSETTINGS_OSD);
@@ -400,12 +399,12 @@ int COsdSetup::showOsdSetup()
osd_menu->addItem(new CMenuForwarder(LOCALE_COLORMENU_MENUCOLORS, true, NULL, osd_menu_colors, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED)); osd_menu->addItem(new CMenuForwarder(LOCALE_COLORMENU_MENUCOLORS, true, NULL, osd_menu_colors, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
//fonts //fonts
CMenuWidget *osd_menu_fonts = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_COLORS, width); CMenuWidget *osd_menu_fonts = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_COLORS, width, 576, MN_WIDGET_ID_OSDSETUP_FONT);
showOsdFontSizeSetup(osd_menu_fonts); showOsdFontSizeSetup(osd_menu_fonts);
osd_menu->addItem(new CMenuForwarder(LOCALE_FONTMENU_HEAD, true, NULL, osd_menu_fonts, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN)); osd_menu->addItem(new CMenuForwarder(LOCALE_FONTMENU_HEAD, true, NULL, osd_menu_fonts, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
//timeouts //timeouts
CMenuWidget *osd_menu_timing = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width); CMenuWidget *osd_menu_timing = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, 576, MN_WIDGET_ID_OSDSETUP_TIMEOUT);
showOsdTimeoutSetup(osd_menu_timing); showOsdTimeoutSetup(osd_menu_timing);
osd_menu->addItem(new CMenuForwarder(LOCALE_COLORMENU_TIMING, true, NULL, osd_menu_timing, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW)); osd_menu->addItem(new CMenuForwarder(LOCALE_COLORMENU_TIMING, true, NULL, osd_menu_timing, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW));
@@ -413,12 +412,12 @@ int COsdSetup::showOsdSetup()
osd_menu->addItem(new CMenuForwarder(LOCALE_VIDEOMENU_SCREENSETUP, true, NULL, new CScreenSetup(), NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE)); osd_menu->addItem(new CMenuForwarder(LOCALE_VIDEOMENU_SCREENSETUP, true, NULL, new CScreenSetup(), NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE));
//infobar //infobar
CMenuWidget *osd_menu_infobar = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width); CMenuWidget *osd_menu_infobar = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, 576, MN_WIDGET_ID_OSDSETUP_INFOBAR);
showOsdInfobarSetup(osd_menu_infobar); showOsdInfobarSetup(osd_menu_infobar);
osd_menu->addItem(new CMenuForwarder(LOCALE_MISCSETTINGS_INFOBAR, true, NULL, osd_menu_infobar, NULL, CRCInput::RC_1)); osd_menu->addItem(new CMenuForwarder(LOCALE_MISCSETTINGS_INFOBAR, true, NULL, osd_menu_infobar, NULL, CRCInput::RC_1));
//channellist //channellist
CMenuWidget *osd_menu_chanlist = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width); CMenuWidget *osd_menu_chanlist = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, 576, MN_WIDGET_ID_OSDSETUP_CHANNELLIST);
showOsdChanlistSetup(osd_menu_chanlist); showOsdChanlistSetup(osd_menu_chanlist);
osd_menu->addItem( new CMenuForwarder(LOCALE_MISCSETTINGS_CHANNELLIST, true, NULL, osd_menu_chanlist, NULL, CRCInput::RC_2)); osd_menu->addItem( new CMenuForwarder(LOCALE_MISCSETTINGS_CHANNELLIST, true, NULL, osd_menu_chanlist, NULL, CRCInput::RC_2));
@@ -441,7 +440,6 @@ int COsdSetup::showOsdSetup()
int res = osd_menu->exec(NULL, ""); int res = osd_menu->exec(NULL, "");
osd_menu->hide(); osd_menu->hide();
selected = osd_menu->getSelected();
delete osd_menu; delete osd_menu;
delete radiotextNotifier; delete radiotextNotifier;
return res; return res;
@@ -560,9 +558,11 @@ void COsdSetup::showOsdFontSizeSetup(CMenuWidget *menu_fonts)
//submenu font scaling //submenu font scaling
fontSettings->addItem(new CMenuForwarder(LOCALE_FONTMENU_SCALING, true, NULL, this, "font_scaling", CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE)); fontSettings->addItem(new CMenuForwarder(LOCALE_FONTMENU_SCALING, true, NULL, this, "font_scaling", CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE));
//fontSettings->addItem( new CMenuForwarder(LOCALE_EPGPLUS_SELECT_FONT_NAME, true, NULL, this, "select_font")); //fontSettings->addItem( new CMenuForwarder(LOCALE_EPGPLUS_SELECT_FONT_NAME, true, NULL, this, "select_font"));
mn_widget_id_t w_index = MN_WIDGET_ID_OSDSETUP_FONTSIZE_MENU;
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)
{ {
CMenuWidget *fontSettingsSubMenu = new CMenuWidget(LOCALE_FONTMENU_HEAD, NEUTRINO_ICON_KEYBINDING); CMenuWidget *fontSettingsSubMenu = new CMenuWidget(LOCALE_FONTMENU_HEAD, NEUTRINO_ICON_KEYBINDING, width, 576, w_index);
fontSettingsSubMenu->addIntroItems(font_sizes_groups[i].groupname); fontSettingsSubMenu->addIntroItems(font_sizes_groups[i].groupname);
@@ -574,6 +574,7 @@ void COsdSetup::showOsdFontSizeSetup(CMenuWidget *menu_fonts)
fontSettingsSubMenu->addItem(new CMenuForwarder(LOCALE_OPTIONS_DEFAULT, true, NULL, this, font_sizes_groups[i].actionkey)); fontSettingsSubMenu->addItem(new CMenuForwarder(LOCALE_OPTIONS_DEFAULT, true, NULL, this, font_sizes_groups[i].actionkey));
fontSettings->addItem(new CMenuForwarder(font_sizes_groups[i].groupname, true, NULL, fontSettingsSubMenu, "", CRCInput::convertDigitToKey(i+1))); fontSettings->addItem(new CMenuForwarder(font_sizes_groups[i].groupname, true, NULL, fontSettingsSubMenu, "", CRCInput::convertDigitToKey(i+1)));
w_index++;
} }
} }

View File

@@ -49,7 +49,7 @@ class COsdSetup : public CMenuTarget, public CChangeObserver
CMenuWidget *osd_menu; CMenuWidget *osd_menu;
int tmp_virtual_zap_mode; int tmp_virtual_zap_mode;
int width, selected; int width;
bool is_wizard; bool is_wizard;

View File

@@ -39,6 +39,7 @@
#include <global.h> #include <global.h>
#include <neutrino.h> #include <neutrino.h>
#include <mymenu.h> #include <mymenu.h>
#include <neutrino_menue.h>
#include <gui/widget/icons.h> #include <gui/widget/icons.h>
@@ -57,7 +58,6 @@ COsdLangSetup::COsdLangSetup(bool wizard_mode)
is_wizard = wizard_mode; is_wizard = wizard_mode;
width = w_max (45, 10); width = w_max (45, 10);
selected = -1;
} }
COsdLangSetup::~COsdLangSetup() COsdLangSetup::~COsdLangSetup()
@@ -80,15 +80,14 @@ int COsdLangSetup::exec(CMenuTarget* parent, const std::string &/*actionKey*/)
int COsdLangSetup::showLocalSetup() int COsdLangSetup::showLocalSetup()
{ {
//main local setup //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->setWizardMode(is_wizard);
localSettings->setSelected(selected);
//add subhead and back button //add subhead and back button
localSettings->addIntroItems(LOCALE_LANGUAGESETUP_HEAD); localSettings->addIntroItems(LOCALE_LANGUAGESETUP_HEAD);
//language setup //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); showLanguageSetup(osdl_setup);
localSettings->addItem(new CMenuForwarder(LOCALE_LANGUAGESETUP_OSD, true, NULL, osdl_setup, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED)); 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 //prefered audio language
CLangSelectNotifier *langNotifier = new CLangSelectNotifier(); 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 //call menue for prefered audio languages
showPrefMenu(prefMenu, langNotifier); showPrefMenu(prefMenu, langNotifier);
localSettings->addItem(new CMenuForwarder(LOCALE_AUDIOMENU_PREF_LANGUAGES, true, NULL, prefMenu, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW)); 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, ""); int res = localSettings->exec(NULL, "");
localSettings->hide(); localSettings->hide();
selected = localSettings->getSelected();
delete localSettings; delete localSettings;
return res; return res;
} }

View File

@@ -51,7 +51,7 @@ class CLangSelectNotifier : public CChangeObserver
class COsdLangSetup : public CMenuTarget, CChangeObserver class COsdLangSetup : public CMenuTarget, CChangeObserver
{ {
private: private:
int width, selected; int width;
bool is_wizard; bool is_wizard;

View File

@@ -37,6 +37,7 @@
#include <global.h> #include <global.h>
#include <neutrino.h> #include <neutrino.h>
#include <neutrino_menue.h>
#include <gui/widget/icons.h> #include <gui/widget/icons.h>
#include <gui/widget/stringinput.h> #include <gui/widget/stringinput.h>
@@ -50,7 +51,6 @@
CParentalSetup::CParentalSetup() CParentalSetup::CParentalSetup()
{ {
width = w_max (40, 10); //% width = w_max (40, 10); //%
selected = -1;
} }
CParentalSetup::~CParentalSetup() CParentalSetup::~CParentalSetup()
@@ -101,8 +101,7 @@ extern bool parentallocked;
void CParentalSetup::showParentalSetup() void CParentalSetup::showParentalSetup()
{ {
//menue init //menue init
CMenuWidget* plock = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_LOCK, width); CMenuWidget* plock = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_LOCK, width, 576, MN_WIDGET_ID_PLOCKSETUP);
plock->setSelected(selected);
//subhead //subhead
plock->addItem( new CMenuSeparator(CMenuSeparator::ALIGN_LEFT | CMenuSeparator::SUB_HEAD | CMenuSeparator::STRING, LOCALE_PARENTALLOCK_PARENTALLOCK)); plock->addItem( new CMenuSeparator(CMenuSeparator::ALIGN_LEFT | CMenuSeparator::SUB_HEAD | CMenuSeparator::STRING, LOCALE_PARENTALLOCK_PARENTALLOCK));
@@ -119,6 +118,5 @@ void CParentalSetup::showParentalSetup()
plock->exec(NULL, ""); plock->exec(NULL, "");
plock->hide(); plock->hide();
selected = plock->getSelected();
delete plock; delete plock;
} }

View File

@@ -38,7 +38,7 @@
class CParentalSetup : public CMenuTarget class CParentalSetup : public CMenuTarget
{ {
private: private:
int width, selected; int width;
void showParentalSetup(); void showParentalSetup();

View File

@@ -38,6 +38,7 @@
#include <global.h> #include <global.h>
#include <neutrino.h> #include <neutrino.h>
#include <neutrino_menue.h>
#include <gui/widget/icons.h> #include <gui/widget/icons.h>
#include <gui/widget/stringinput.h> #include <gui/widget/stringinput.h>
@@ -54,7 +55,6 @@
CPictureViewerSetup::CPictureViewerSetup() CPictureViewerSetup::CPictureViewerSetup()
{ {
width = w_max (40, 10); width = w_max (40, 10);
selected = -1;
} }
CPictureViewerSetup::~CPictureViewerSetup() CPictureViewerSetup::~CPictureViewerSetup()
@@ -100,8 +100,7 @@ const CMenuOptionChooser::keyval PICTUREVIEWER_SCALING_OPTIONS[PICTUREVIEWER_SCA
int CPictureViewerSetup::showPictureViewerSetup() int CPictureViewerSetup::showPictureViewerSetup()
{ {
CMenuWidget* picviewsetup = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width); CMenuWidget* picviewsetup = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, 576, MN_WIDGET_ID_PVIEWERSETUP);
picviewsetup->setSelected(selected);
// intros: back ande save // intros: back ande save
picviewsetup->addIntroItems(LOCALE_PICTUREVIEWER_HEAD); picviewsetup->addIntroItems(LOCALE_PICTUREVIEWER_HEAD);
@@ -113,7 +112,6 @@ int CPictureViewerSetup::showPictureViewerSetup()
int res = picviewsetup->exec(NULL, ""); int res = picviewsetup->exec(NULL, "");
picviewsetup->hide(); picviewsetup->hide();
selected = picviewsetup->getSelected();
delete picviewsetup; delete picviewsetup;
return res; return res;
} }

View File

@@ -41,7 +41,7 @@
class CPictureViewerSetup : public CMenuTarget class CPictureViewerSetup : public CMenuTarget
{ {
private: private:
int width, selected; int width;
int showPictureViewerSetup(); int showPictureViewerSetup();

View File

@@ -36,6 +36,7 @@
#include <global.h> #include <global.h>
#include <neutrino.h> #include <neutrino.h>
#include <neutrino_menue.h>
#include <gui/widget/stringinput.h> #include <gui/widget/stringinput.h>
@@ -43,7 +44,6 @@
#include <system/debug.h> #include <system/debug.h>
CProxySetup::CProxySetup(const neutrino_locale_t title, const char * const IconName ) CProxySetup::CProxySetup(const neutrino_locale_t title, const char * const IconName )
{ {
menue_title = title; menue_title = title;
@@ -75,7 +75,7 @@ int CProxySetup::exec(CMenuTarget* parent, const std::string &/*actionKey*/)
int CProxySetup::showProxySetup() int CProxySetup::showProxySetup()
{ {
//init //init
CMenuWidget * mn = new CMenuWidget(menue_title, menue_icon, width); CMenuWidget * mn = new CMenuWidget(menue_title, menue_icon, width, 576, MN_WIDGET_ID_PROXYSETUP);
neutrino_locale_t subtitle = (menue_title == LOCALE_FLASHUPDATE_PROXYSERVER_SEP ? NONEXISTANT_LOCALE : LOCALE_FLASHUPDATE_PROXYSERVER_SEP); neutrino_locale_t subtitle = (menue_title == LOCALE_FLASHUPDATE_PROXYSERVER_SEP ? NONEXISTANT_LOCALE : LOCALE_FLASHUPDATE_PROXYSERVER_SEP);
mn->addIntroItems(subtitle); mn->addIntroItems(subtitle);

View File

@@ -36,7 +36,7 @@
#include <global.h> #include <global.h>
#include <neutrino.h> #include <neutrino.h>
#include <neutrino_menue.h>
#include <mymenu.h> #include <mymenu.h>
#include "gui/record_setup.h" #include "gui/record_setup.h"
@@ -56,7 +56,6 @@
CRecordSetup::CRecordSetup() CRecordSetup::CRecordSetup()
{ {
width = w_max (50, 10); //% width = w_max (50, 10); //%
selected = -1;
} }
CRecordSetup::~CRecordSetup() CRecordSetup::~CRecordSetup()
@@ -170,8 +169,7 @@ const CMenuOptionChooser::keyval END_OF_RECORDING[END_OF_RECORDING_COUNT] =
int CRecordSetup::showRecordSetup() int CRecordSetup::showRecordSetup()
{ {
//menue init //menue init
CMenuWidget* recordingSettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width); CMenuWidget* recordingSettings = new CMenuWidget(LOCALE_MAINSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, 576, MN_WIDGET_ID_RECORDSETUP);
recordingSettings->setSelected(selected);
//apply settings //apply settings
recordingSettings->addIntroItems(LOCALE_MAINSETTINGS_RECORDING); recordingSettings->addIntroItems(LOCALE_MAINSETTINGS_RECORDING);
@@ -194,23 +192,22 @@ int CRecordSetup::showRecordSetup()
recordingSettings->addItem(GenericMenuSeparatorLine); recordingSettings->addItem(GenericMenuSeparatorLine);
//timeshift //timeshift
CMenuWidget* recordingTsSettings = new CMenuWidget(LOCALE_MAINSETTINGS_RECORDING, NEUTRINO_ICON_SETTINGS, width); CMenuWidget* recordingTsSettings = new CMenuWidget(LOCALE_MAINSETTINGS_RECORDING, NEUTRINO_ICON_SETTINGS, width, 576, MN_WIDGET_ID_RECORDSETUP_TIMESHIFT);
showRecordTimeShiftSetup(recordingTsSettings); showRecordTimeShiftSetup(recordingTsSettings);
recordingSettings->addItem(new CMenuForwarder(LOCALE_RECORDINGMENU_TIMESHIFT, true, NULL, recordingTsSettings, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN)); recordingSettings->addItem(new CMenuForwarder(LOCALE_RECORDINGMENU_TIMESHIFT, true, NULL, recordingTsSettings, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
//timersettings //timersettings
CMenuWidget* recordingTimerSettings = new CMenuWidget(LOCALE_MAINSETTINGS_RECORDING, NEUTRINO_ICON_SETTINGS, width); CMenuWidget* recordingTimerSettings = new CMenuWidget(LOCALE_MAINSETTINGS_RECORDING, NEUTRINO_ICON_SETTINGS, width, 576, MN_WIDGET_ID_RECORDSETUP_TIMERSETTINGS);
showRecordTimerSetup(recordingTimerSettings); showRecordTimerSetup(recordingTimerSettings);
recordingSettings->addItem(new CMenuForwarder(LOCALE_TIMERSETTINGS_SEPARATOR, true, NULL, recordingTimerSettings, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW)); recordingSettings->addItem(new CMenuForwarder(LOCALE_TIMERSETTINGS_SEPARATOR, true, NULL, recordingTimerSettings, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW));
//audiosettings //audiosettings
CMenuWidget* recordingaAudioSettings = new CMenuWidget(LOCALE_MAINSETTINGS_RECORDING, NEUTRINO_ICON_SETTINGS, width); CMenuWidget* recordingaAudioSettings = new CMenuWidget(LOCALE_MAINSETTINGS_RECORDING, NEUTRINO_ICON_SETTINGS, width, 576, MN_WIDGET_ID_RECORDSETUP_AUDIOSETTINGS);
showRecordAudioSetup(recordingaAudioSettings); showRecordAudioSetup(recordingaAudioSettings);
recordingSettings->addItem(new CMenuForwarder(LOCALE_RECORDINGMENU_APIDS, true, NULL, recordingaAudioSettings, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE)); recordingSettings->addItem(new CMenuForwarder(LOCALE_RECORDINGMENU_APIDS, true, NULL, recordingaAudioSettings, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE));
int res = recordingSettings->exec(NULL, ""); int res = recordingSettings->exec(NULL, "");
recordingSettings->hide(); recordingSettings->hide();
selected = recordingSettings->getSelected();
delete recordingSettings; delete recordingSettings;
return res; return res;
} }

View File

@@ -39,7 +39,7 @@
class CRecordSetup : public CMenuTarget class CRecordSetup : public CMenuTarget
{ {
private: private:
int width, selected; int width;
int showRecordSetup(); int showRecordSetup();
void showRecordTimerSetup(CMenuWidget *menu_timersettings); void showRecordTimerSetup(CMenuWidget *menu_timersettings);

View File

@@ -39,24 +39,26 @@
#include <global.h> #include <global.h>
#include <neutrino.h> #include <neutrino.h>
#include <mymenu.h> #include <mymenu.h>
#include <neutrino_menue.h>
#include <gui/widget/icons.h> #include <gui/widget/icons.h>
#include <gui/widget/stringinput.h>
#include <driver/screen_max.h> #include <driver/screen_max.h>
#include <system/debug.h> #include <system/debug.h>
#include <cs_api.h> #include <cs_api.h>
CVfdSetup::CVfdSetup() CVfdSetup::CVfdSetup()
{ {
width = w_max (40, 10); width = w_max (40, 10);
selected = -1; dim_time = NULL;
vfd_enabled = (cs_get_revision() != 10);
} }
CVfdSetup::~CVfdSetup() CVfdSetup::~CVfdSetup()
{ {
delete dim_time;
} }
@@ -108,59 +110,70 @@ const CMenuOptionChooser::keyval LCD_INFO_OPTIONS[LCD_INFO_OPTION_COUNT] =
int CVfdSetup::showSetup() int CVfdSetup::showSetup()
{ {
CMenuWidget *vfds = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_LCD, width); CMenuWidget *vfds = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_LCD, width, 576, MN_WIDGET_ID_VFDSETUP);
vfds->addIntroItems(LOCALE_LCDMENU_HEAD); vfds->addIntroItems(LOCALE_LCDMENU_HEAD);
vfds->setSelected(selected);
bool vfd_enabled = (cs_get_revision() != 10); //vfd brightness menu
CMenuWidget* lcd_sliders = new CMenuWidget(LOCALE_LCDMENU_HEAD, NEUTRINO_ICON_LCD,width, 576, MN_WIDGET_ID_VFDSETUP_LCD_SLIDERS);
CMenuWidget* lcdsliders = new CMenuWidget(LOCALE_LCDMENU_HEAD, NEUTRINO_ICON_LCD,width); showBrightnessSetup(lcd_sliders);
lcdsliders->addIntroItems(LOCALE_LCDMENU_LCDCONTROLER); vfds->addItem(new CMenuForwarder(LOCALE_LCDMENU_LCDCONTROLER, vfd_enabled, NULL, lcd_sliders, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
lcdsliders->setSelected(selected);
//vfd
brightness = CVFD::getInstance()->getBrightness();
brightnessstandby = CVFD::getInstance()->getBrightnessStandby();
brightnessdeepstandby = CVFD::getInstance()->getBrightnessDeepStandby();
lcdsliders->addItem(new CMenuOptionNumberChooser(LOCALE_LCDCONTROLER_BRIGHTNESS, &brightness, true, 0, 15, this, 0, 0, NONEXISTANT_LOCALE, NULL, true));
lcdsliders->addItem(new CMenuOptionNumberChooser(LOCALE_LCDCONTROLER_BRIGHTNESSSTANDBY, &brightnessstandby, true, 0, 15, this, 0, 0, NONEXISTANT_LOCALE, NULL, true));
if(cs_get_revision() > 7)
lcdsliders->addItem(new CMenuOptionNumberChooser(LOCALE_LCDCONTROLER_BRIGHTNESSDEEPSTANDBY, &brightnessdeepstandby, true, 0, 15, this, 0, 0, NONEXISTANT_LOCALE, NULL, true));
lcdsliders->addItem(new CMenuOptionNumberChooser(LOCALE_LCDMENU_DIM_BRIGHTNESS, &g_settings.lcd_setting_dim_brightness, vfd_enabled, -1, 15, NULL, 0, -1, LOCALE_OPTIONS_OFF, NULL, true));
lcdsliders->addItem(GenericMenuSeparatorLine);
CStringInput * dim_time = new CStringInput(LOCALE_LCDMENU_DIM_TIME, g_settings.lcd_setting_dim_time, 3, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE,"0123456789 ");
lcdsliders->addItem(new CMenuForwarder(LOCALE_LCDMENU_DIM_TIME, vfd_enabled, g_settings.lcd_setting_dim_time,dim_time));
lcdsliders->addItem(GenericMenuSeparatorLine);
lcdsliders->addItem(new CMenuForwarder(LOCALE_OPTIONS_DEFAULT, true, NULL, this, "def", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
vfds->addItem(new CMenuForwarder(LOCALE_LCDMENU_LCDCONTROLER, vfd_enabled, NULL, lcdsliders, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
//led menu
CMenuWidget * ledMenu = NULL;
if(cs_get_revision() > 7) if(cs_get_revision() > 7)
{ {
CMenuWidget * ledMenu = new CMenuWidget(LOCALE_LCDMENU_HEAD, NEUTRINO_ICON_LCD); ledMenu = new CMenuWidget(LOCALE_LCDMENU_HEAD, NEUTRINO_ICON_LCD, width, 576, MN_WIDGET_ID_VFDSETUP_LED_SETUP);
ledMenu->addIntroItems(LOCALE_LEDCONTROLER_MENU); showLedSetup(ledMenu);
ledMenu->addItem(new CMenuOptionChooser(LOCALE_LEDCONTROLER_MODE_TV, &g_settings.led_tv_mode, LEDMENU_OPTIONS, LEDMENU_OPTION_COUNT, true, new CLedControlNotifier()));
ledMenu->addItem(new CMenuOptionChooser(LOCALE_LEDCONTROLER_MODE_STANDBY, &g_settings.led_standby_mode, LEDMENU_OPTIONS, LEDMENU_OPTION_COUNT, true));
ledMenu->addItem(new CMenuOptionChooser(LOCALE_LEDCONTROLER_MODE_DEEPSTANDBY, &g_settings.led_deep_mode, LEDMENU_OPTIONS, LEDMENU_OPTION_COUNT, true));
ledMenu->addItem(new CMenuOptionChooser(LOCALE_LEDCONTROLER_MODE_RECORD, &g_settings.led_rec_mode, LEDMENU_OPTIONS, LEDMENU_OPTION_COUNT, true));
ledMenu->addItem(new CMenuOptionChooser(LOCALE_LEDCONTROLER_BLINK, &g_settings.led_blink, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
vfds->addItem(new CMenuForwarder(LOCALE_LEDCONTROLER_MENU, true, NULL, ledMenu, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN)); vfds->addItem(new CMenuForwarder(LOCALE_LEDCONTROLER_MENU, true, NULL, ledMenu, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN));
} }
vfds->addItem(GenericMenuSeparatorLine); vfds->addItem(GenericMenuSeparatorLine);
//status and info line options
CMenuOptionChooser* oj = new CMenuOptionChooser(LOCALE_LCDMENU_STATUSLINE, &g_settings.lcd_setting[SNeutrinoSettings::LCD_SHOW_VOLUME], LCDMENU_STATUSLINE_OPTIONS, LCDMENU_STATUSLINE_OPTION_COUNT, vfd_enabled); CMenuOptionChooser* oj = new CMenuOptionChooser(LOCALE_LCDMENU_STATUSLINE, &g_settings.lcd_setting[SNeutrinoSettings::LCD_SHOW_VOLUME], LCDMENU_STATUSLINE_OPTIONS, LCDMENU_STATUSLINE_OPTION_COUNT, vfd_enabled);
CMenuOptionChooser* lcd_clock_channelname_menu = new CMenuOptionChooser(LOCALE_LCD_INFO_LINE, &g_settings.lcd_info_line, LCD_INFO_OPTIONS, LCD_INFO_OPTION_COUNT, vfd_enabled); CMenuOptionChooser* lcd_clock_channelname_menu = new CMenuOptionChooser(LOCALE_LCD_INFO_LINE, &g_settings.lcd_info_line, LCD_INFO_OPTIONS, LCD_INFO_OPTION_COUNT, vfd_enabled);
vfds->addItem(oj); vfds->addItem(oj);
vfds->addItem(lcd_clock_channelname_menu); vfds->addItem(lcd_clock_channelname_menu);
int res = vfds->exec(NULL, ""); int res = vfds->exec(NULL, "");
vfds->hide(); vfds->hide();
selected = vfds->getSelected();
delete vfds; delete vfds;
return res; return res;
} }
void CVfdSetup::showBrightnessSetup(CMenuWidget *mn_widget)
{
mn_widget->addIntroItems(LOCALE_LCDMENU_LCDCONTROLER);
brightness = CVFD::getInstance()->getBrightness();
brightnessstandby = CVFD::getInstance()->getBrightnessStandby();
brightnessdeepstandby = CVFD::getInstance()->getBrightnessDeepStandby();
mn_widget->addItem(new CMenuOptionNumberChooser(LOCALE_LCDCONTROLER_BRIGHTNESS, &brightness, true, 0, 15, this, 0, 0, NONEXISTANT_LOCALE, NULL, true));
mn_widget->addItem(new CMenuOptionNumberChooser(LOCALE_LCDCONTROLER_BRIGHTNESSSTANDBY, &brightnessstandby, true, 0, 15, this, 0, 0, NONEXISTANT_LOCALE, NULL, true));
if(cs_get_revision() > 7)
mn_widget->addItem(new CMenuOptionNumberChooser(LOCALE_LCDCONTROLER_BRIGHTNESSDEEPSTANDBY, &brightnessdeepstandby, true, 0, 15, this, 0, 0, NONEXISTANT_LOCALE, NULL, true));
mn_widget->addItem(new CMenuOptionNumberChooser(LOCALE_LCDMENU_DIM_BRIGHTNESS, &g_settings.lcd_setting_dim_brightness, vfd_enabled, -1, 15, NULL, 0, -1, LOCALE_OPTIONS_OFF, NULL, true));
mn_widget->addItem(GenericMenuSeparatorLine);
if (dim_time == NULL)
dim_time = new CStringInput(LOCALE_LCDMENU_DIM_TIME, g_settings.lcd_setting_dim_time, 3, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE,"0123456789 ");
mn_widget->addItem(new CMenuForwarder(LOCALE_LCDMENU_DIM_TIME, vfd_enabled, g_settings.lcd_setting_dim_time,dim_time));
mn_widget->addItem(GenericMenuSeparatorLine);
mn_widget->addItem(new CMenuForwarder(LOCALE_OPTIONS_DEFAULT, true, NULL, this, "def", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
}
void CVfdSetup::showLedSetup(CMenuWidget *mn_led_widget)
{
mn_led_widget->addIntroItems(LOCALE_LEDCONTROLER_MENU);
mn_led_widget->addItem(new CMenuOptionChooser(LOCALE_LEDCONTROLER_MODE_TV, &g_settings.led_tv_mode, LEDMENU_OPTIONS, LEDMENU_OPTION_COUNT, true, new CLedControlNotifier()));
mn_led_widget->addItem(new CMenuOptionChooser(LOCALE_LEDCONTROLER_MODE_STANDBY, &g_settings.led_standby_mode, LEDMENU_OPTIONS, LEDMENU_OPTION_COUNT, true));
mn_led_widget->addItem(new CMenuOptionChooser(LOCALE_LEDCONTROLER_MODE_DEEPSTANDBY, &g_settings.led_deep_mode, LEDMENU_OPTIONS, LEDMENU_OPTION_COUNT, true));
mn_led_widget->addItem(new CMenuOptionChooser(LOCALE_LEDCONTROLER_MODE_RECORD, &g_settings.led_rec_mode, LEDMENU_OPTIONS, LEDMENU_OPTION_COUNT, true));
mn_led_widget->addItem(new CMenuOptionChooser(LOCALE_LEDCONTROLER_BLINK, &g_settings.led_blink, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
}
bool CVfdSetup::changeNotify(const neutrino_locale_t OptionName, void */* data */) bool CVfdSetup::changeNotify(const neutrino_locale_t OptionName, void */* data */)
{ {

View File

@@ -32,19 +32,26 @@
#define __lcd_setup__ #define __lcd_setup__
#include <gui/widget/menue.h> #include <gui/widget/menue.h>
#include <gui/widget/stringinput.h>
#include <string> #include <string>
class CVfdSetup : public CMenuTarget, CChangeObserver class CVfdSetup : public CMenuTarget, CChangeObserver
{ {
private: private:
int width, selected; int width;
int showSetup(); int showSetup();
void showBrightnessSetup(CMenuWidget *mn_widget);
void showLedSetup(CMenuWidget *mn_led_widget);
virtual bool changeNotify(const neutrino_locale_t OptionName, void *data); virtual bool changeNotify(const neutrino_locale_t OptionName, void *data);
int brightness; int brightness;
int brightnessstandby; int brightnessstandby;
int brightnessdeepstandby; int brightnessdeepstandby;
bool vfd_enabled;
CStringInput * dim_time;
public: public:
CVfdSetup(); CVfdSetup();

View File

@@ -47,7 +47,7 @@
#include <global.h> #include <global.h>
#include <neutrino.h> #include <neutrino.h>
#include <neutrino_menue.h>
#include <cctype> #include <cctype>
@@ -273,6 +273,30 @@ void CMenuItem::paintItemButton(const bool select_mode, const int &item_height,
} }
} }
//small helper class to manage values e.g.: handling needed but deallocated widget objects
CMenuGlobal::CMenuGlobal()
{
//creates needed select values with default value NO_WIDGET_ID = -1
for (uint i=0; i<MN_WIDGET_ID_MAX; ++i)
v_selected.push_back(NO_WIDGET_ID);
}
CMenuGlobal::~CMenuGlobal()
{
v_selected.clear();
};
//Note: use only singleton to create an instance in the constructor or init handler of menu widget
CMenuGlobal* CMenuGlobal::getInstance()
{
static CMenuGlobal* m = NULL;
if(!m)
m = new CMenuGlobal();
return m;
}
//****************************************************************************************
CMenuWidget::CMenuWidget() CMenuWidget::CMenuWidget()
{ {
nameString = g_Locale->getText(NONEXISTANT_LOCALE); nameString = g_Locale->getText(NONEXISTANT_LOCALE);
@@ -285,31 +309,36 @@ CMenuWidget::CMenuWidget()
fade = true; fade = true;
} }
CMenuWidget::CMenuWidget(const neutrino_locale_t Name, const std::string & Icon, const int mwidth, const int mheight) CMenuWidget::CMenuWidget(const neutrino_locale_t Name, const std::string & Icon, const int mwidth, const int mheight, const mn_widget_id_t &w_index)
{ {
name = Name; name = Name;
nameString = g_Locale->getText(Name); nameString = g_Locale->getText(Name);
Init(Icon, mwidth, mheight); Init(Icon, mwidth, mheight, w_index);
} }
CMenuWidget::CMenuWidget(const char* Name, const std::string & Icon, const int mwidth, const int mheight) CMenuWidget::CMenuWidget(const char* Name, const std::string & Icon, const int mwidth, const int mheight, const mn_widget_id_t &w_index)
{ {
name = NONEXISTANT_LOCALE; name = NONEXISTANT_LOCALE;
nameString = Name; nameString = Name;
Init(Icon, mwidth, mheight); Init(Icon, mwidth, mheight, w_index);
} }
void CMenuWidget::Init(const std::string & Icon, const int mwidth, const int /*mheight*/) void CMenuWidget::Init(const std::string & Icon, const int mwidth, const int /*mheight*/, const mn_widget_id_t &w_index)
{ {
m = CMenuGlobal::getInstance(); //create CMenuGlobal instance only here
frameBuffer = CFrameBuffer::getInstance(); frameBuffer = CFrameBuffer::getInstance();
iconfile = Icon; iconfile = Icon;
preselected = -1;
selected = preselected; //handle select values
widget_index = w_index;
preselected = NO_WIDGET_ID;
selected = (widget_index == NO_WIDGET_ID ? preselected : m->v_selected[widget_index]);
min_width = 0; min_width = 0;
width = 0; /* is set in paint() */ width = 0; /* is set in paint() */
if (mwidth > 100) if (mwidth > 100)
{ {
/* warn about abuse until we found all offenders... */ /* warn about abuse until we found all offenders... */
@@ -426,7 +455,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &)
neutrino_msg_t msg; neutrino_msg_t msg;
neutrino_msg_data_t data; neutrino_msg_data_t data;
bool bAllowRepeatLR = false; bool bAllowRepeatLR = false;
int pos = 0; int pos = 0;
exit_pressed = false; exit_pressed = false;
@@ -463,8 +492,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &)
paint(); paint();
int retval = menu_return::RETURN_REPAINT; int retval = menu_return::RETURN_REPAINT;
uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]); uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]);
do { do {
if(hasItem() && selected >= 0) if(hasItem() && selected >= 0)
bAllowRepeatLR = items[selected]->can_arrow; bAllowRepeatLR = items[selected]->can_arrow;
@@ -725,6 +753,9 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &)
CMenuItem* item = items[count]; CMenuItem* item = items[count];
item->init(-1, 0, 0, 0); item->init(-1, 0, 0, 0);
} }
if (widget_index > -1)
m->v_selected[widget_index] = selected;
frameBuffer->Unlock(); frameBuffer->Unlock();
return retval; return retval;
@@ -867,7 +898,7 @@ void CMenuWidget::paint()
void CMenuWidget::paintItems() void CMenuWidget::paintItems()
{ {
int item_height=height-(item_start_y-y); int item_height=height-(item_start_y-y);
//Item not currently on screen //Item not currently on screen
if (selected >= 0) if (selected >= 0)
{ {

View File

@@ -44,6 +44,10 @@
#include <string> #include <string>
#include <vector> #include <vector>
#define NO_WIDGET_ID -1
typedef int mn_widget_id_t;
struct menu_return struct menu_return
{ {
enum enum
@@ -371,8 +375,22 @@ class CMenuOptionLanguageChooser : public CMenuItem
int exec(CMenuTarget* parent); int exec(CMenuTarget* parent);
}; };
class CMenuGlobal
{
public:
std::vector<int> v_selected;
CMenuGlobal();
~CMenuGlobal();
static CMenuGlobal* getInstance();
};
class CMenuWidget : public CMenuTarget class CMenuWidget : public CMenuTarget
{ {
private:
mn_widget_id_t widget_index;
CMenuGlobal *m;
protected: protected:
std::string nameString; std::string nameString;
neutrino_locale_t name; neutrino_locale_t name;
@@ -391,6 +409,7 @@ class CMenuWidget : public CMenuTarget
int preselected; int preselected;
int selected; int selected;
int iconOffset; int iconOffset;
unsigned int item_start_y; unsigned int item_start_y;
unsigned int current_page; unsigned int current_page;
unsigned int total_pages; unsigned int total_pages;
@@ -398,16 +417,16 @@ class CMenuWidget : public CMenuTarget
bool from_wizard; bool from_wizard;
bool fade; bool fade;
void Init(const std::string & Icon, const int mwidth, const int mheight); void Init(const std::string & Icon, const int mwidth, const int mheight, const mn_widget_id_t &w_index);
virtual void paintItems(); virtual void paintItems();
public: public:
CMenuWidget(); CMenuWidget();
/* TODO: mheight is not used anymore. remove if nobody misses it */ /* TODO: mheight is not used anymore. remove if nobody misses it */
/* mwidth (minimum width) in percent of screen width */ /* mwidth (minimum width) in percent of screen width */
CMenuWidget(const char* Name, const std::string & Icon = "", const int mwidth = 30, const int mheight = 576); CMenuWidget(const char* Name, const std::string & Icon = "", const int mwidth = 30, const int mheight = 576, const mn_widget_id_t &w_index = NO_WIDGET_ID);
CMenuWidget(const neutrino_locale_t Name, const std::string & Icon = "", const int mwidth = 30, const int mheight = 576); CMenuWidget(const neutrino_locale_t Name, const std::string & Icon = "", const int mwidth = 30, const int mheight = 576, const mn_widget_id_t &w_index = NO_WIDGET_ID);
~CMenuWidget(); ~CMenuWidget();
virtual void addItem(CMenuItem* menuItem, const bool defaultselected = false); virtual void addItem(CMenuItem* menuItem, const bool defaultselected = false);
enum enum

View File

@@ -32,6 +32,7 @@
#include <global.h> #include <global.h>
#include <neutrino.h> #include <neutrino.h>
#include <mymenu.h> #include <mymenu.h>
#include <neutrino_menue.h>
#include <driver/screen_max.h> #include <driver/screen_max.h>
@@ -63,7 +64,7 @@ int CZapitSetup::exec(CMenuTarget* parent, const std::string &/*actionKey*/)
void CZapitSetup::showMenu() void CZapitSetup::showMenu()
{ {
//menue init //menue init
CMenuWidget *zapit = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width); CMenuWidget *zapit = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, 576, MN_WIDGET_ID_ZAPIT);
zapit->setSelected(selected); zapit->setSelected(selected);
zapit->addIntroItems(LOCALE_ZAPITSETUP_INFO); zapit->addIntroItems(LOCALE_ZAPITSETUP_INFO);

View File

@@ -84,7 +84,6 @@ typedef struct font_sizes_groups
const char * const actionkey; const char * const actionkey;
} font_sizes_groups_struct; } font_sizes_groups_struct;
class CNeutrinoApp : public CMenuTarget, CChangeObserver class CNeutrinoApp : public CMenuTarget, CChangeObserver
{ {
public: public:
@@ -95,6 +94,8 @@ public:
RECORDING_VCR = 2, RECORDING_VCR = 2,
RECORDING_FILE = 3 RECORDING_FILE = 3
}; };
private: private:
CFrameBuffer * frameBuffer; CFrameBuffer * frameBuffer;
@@ -222,3 +223,5 @@ public:
CConfigFile* getConfigFile() {return &configfile;}; CConfigFile* getConfigFile() {return &configfile;};
}; };
#endif #endif

126
src/neutrino_menue.h Normal file
View File

@@ -0,0 +1,126 @@
/*
Neutrino-GUI - DBoxII-Project
Copyright (C) 2001 Steffen Hehn 'McClean'
Homepage: http://dbox.cyberphoria.org/
Headerfile: neutrino_menue.h,
Copyright (C) 2011 Thilo Graf 'dbt'
Homepage: http://www.dbox2-tuning.net
License: GPL
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Boston, MA 02110-1301, USA.
NOTE for ignorant distributors:
It's not allowed to distribute any compiled parts of this code, if you don't accept the terms of GPL.
Please read it and understand it right!
This means for you: Hold it, if not, leave it! You could face legal action!
Otherwise ask the copyright owners, anything else would be theft!
*/
#ifndef __neutrino_menue__
#define __neutrino_menue__
//enums for menu widget indicies,
enum MN_WIDGET_ID
{
//network setup
MN_WIDGET_ID_NETWORKSETUP,
MN_WIDGET_ID_NETWORKSETUP_NTP,
MN_WIDGET_ID_NETWORKSETUP_MOUNTS,
//proxysetup
MN_WIDGET_ID_PROXYSETUP,
//osd setup
MN_WIDGET_ID_OSDSETUP,
MN_WIDGET_ID_OSDSETUP_CHANNELLIST,
MN_WIDGET_ID_OSDSETUP_FONT,
MN_WIDGET_ID_OSDSETUP_FONTSCALE,
MN_WIDGET_ID_OSDSETUP_INFOBAR,
MN_WIDGET_ID_OSDSETUP_MENUCOLORS,
MN_WIDGET_ID_OSDSETUP_TIMEOUT,
//actually it does not matter, but these 6 entries must be the same order as in menu
MN_WIDGET_ID_OSDSETUP_FONTSIZE_MENU,
MN_WIDGET_ID_OSDSETUP_FONTSIZE_CHANNELLIST,
MN_WIDGET_ID_OSDSETUP_FONTSIZE_EVENTLIST,
MN_WIDGET_ID_OSDSETUP_FONTSIZE_EPG,
MN_WIDGET_ID_OSDSETUP_FONTSIZE_INFOBAR,
MN_WIDGET_ID_OSDSETUP_FONTSIZE_GAMELIST,
//language setup
MN_WIDGET_ID_LANGUAGESETUP,
MN_WIDGET_ID_LANGUAGESETUP_LOCALE,
MN_WIDGET_ID_LANGUAGESETUP_PREFAUDIO_LANGUAGE,
//recording settings
MN_WIDGET_ID_RECORDSETUP,
MN_WIDGET_ID_RECORDSETUP_TIMESHIFT,
MN_WIDGET_ID_RECORDSETUP_TIMERSETTINGS,
MN_WIDGET_ID_RECORDSETUP_AUDIOSETTINGS,
//vfd setup
MN_WIDGET_ID_VFDSETUP,
MN_WIDGET_ID_VFDSETUP_LCD_SLIDERS,
MN_WIDGET_ID_VFDSETUP_LED_SETUP,
//keybind setup
MN_WIDGET_ID_KEYSETUP,
MN_WIDGET_ID_KEYSETUP_KEYBINDING,
MN_WIDGET_ID_KEYSETUP_KEYBINDING_MODES,
MN_WIDGET_ID_KEYSETUP_KEYBINDING_CHANNELLIST,
MN_WIDGET_ID_KEYSETUP_KEYBINDING_QUICKZAP,
MN_WIDGET_ID_KEYSETUP_KEYBINDING_MOVIEPLAYER,
//picture viewer setup
MN_WIDGET_ID_PVIEWERSETUP,
//audio setup
MN_WIDGET_ID_AUDIOSETUP,
//misc settings
MN_WIDGET_ID_MISCSETUP,
MN_WIDGET_ID_MISCSETUP_GENERAL,
MN_WIDGET_ID_MISCSETUP_ENERGY,
MN_WIDGET_ID_MISCSETUP_EPG,
MN_WIDGET_ID_MISCSETUP_FILEBROWSER,
MN_WIDGET_ID_MISCSETUP_CHANNELLIST,
//media menu
MN_WIDGET_ID_MEDIA,
MN_WIDGET_ID_MEDIA_MOVIEPLAYER,
//parentallock setup
MN_WIDGET_ID_PLOCKSETUP,
//drive setup
MN_WIDGET_ID_DRIVESETUP,
//zapit settings (start channel)
MN_WIDGET_ID_ZAPIT,
//cec setup
MN_WIDGET_ID_CEC,
MN_WIDGET_ID_MAX
};
#endif