*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:
thilo
2011-11-25 23:48:18 +00:00
parent 96cbd6a89a
commit eff98c661e
31 changed files with 340 additions and 145 deletions

View File

@@ -35,7 +35,7 @@
#include <global.h>
#include <neutrino.h>
#include <neutrino_menue.h>
#include "gui/movieplayer.h"
#include "gui/pictureviewer.h"
@@ -56,7 +56,6 @@ CMediaPlayerMenu::CMediaPlayerMenu()
setUsageMode();
width = w_max (40, 10); //%
selected = -1;
audioPlayer = NULL;
inetPlayer = NULL;
@@ -112,7 +111,7 @@ int CMediaPlayerMenu::exec(CMenuTarget* parent, const std::string &actionKey)
//show selectable mediaplayer items
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_inet = NULL;
@@ -125,9 +124,6 @@ void CMediaPlayerMenu::showMenu()
if (usage_mode != MODE_VIDEO)
{
//menue init
media->setSelected(selected);
//audio player
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;
@@ -141,7 +137,7 @@ void CMediaPlayerMenu::showMenu()
if (usage_mode == MODE_DEFAULT)
{
//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);
//pictureviewer
@@ -188,7 +184,6 @@ void CMediaPlayerMenu::showMenu()
media->exec(NULL, "");
media->hide();
selected = media->getSelected();
delete media;
setUsageMode();//set default usage_mode
}