From 9141258e3acc408059549ee84da859e437e98e4c Mon Sep 17 00:00:00 2001 From: thilo Date: Fri, 23 Dec 2011 22:04:40 +0000 Subject: [PATCH] *neutrino: partial revert of r1985, but without clock User request: implementation of timerlist needs personalisation see also: http://www.dbox2world.net/board293-coolstream-hd1/board314-coolstream-development/p137661-dikussion-neues-hauptmen%C3%BC-mit-timerliste/#post137661 git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1995 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/neutrino.cpp | 33 +++++++++++++++++++++++++-------- src/neutrino.h | 2 +- src/neutrino_menue.cpp | 10 ++++++---- 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 63a63be5d..9af0ecd4a 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3555,13 +3555,20 @@ void CNeutrinoApp::radioMode( bool rezap) } } -//switching from current mode to next mode between tv or radio -void CNeutrinoApp::switchTvRadioMode() +//switching from current mode to tv or radio mode or to optional parameter prev_mode +void CNeutrinoApp::switchTvRadioMode(const int prev_mode) { - if (mode == mode_radio ) - tvMode(); - else if(mode == mode_tv) - radioMode(); + if (prev_mode != mode_unknown){ + if (prev_mode == mode_tv && mode != mode_tv ) + tvMode(); + else if(prev_mode == mode_radio && mode != mode_radio) + radioMode(); + }else { + if (mode == mode_radio ) + tvMode(); + else if(mode == mode_tv) + radioMode(); + } } //switching clock on or off depends of current displayed or not @@ -3605,9 +3612,19 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) switchClockOnOff(); returnval = menu_return::RETURN_EXIT_ALL; } - else if (actionKey=="tv_radio_switch")//used in mainmenu +// else if (actionKey=="tv_radio_switch")//used in mainmenu +// { +// switchTvRadioMode(); +// returnval = menu_return::RETURN_EXIT_ALL; +// } + else if (actionKey=="tv")//used in mainmenu { - switchTvRadioMode(); + switchTvRadioMode(mode_tv); + returnval = menu_return::RETURN_EXIT_ALL; + } + else if (actionKey=="radio")//used in mainmenu + { + switchTvRadioMode(mode_radio); returnval = menu_return::RETURN_EXIT_ALL; } else if(actionKey=="scart") { diff --git a/src/neutrino.h b/src/neutrino.h index df6124801..b714cdf60 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -206,7 +206,7 @@ public: int getLastMode() { return lastMode; } - void switchTvRadioMode(); + void switchTvRadioMode(const int prev_mode = mode_unknown); void switchClockOnOff(); bool isMuted() { diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index e4a2dfc8d..8175efaf9 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -100,15 +100,17 @@ void CNeutrinoApp::InitMainMenu(CMenuWidget &mainMenu, CMenuWidget &mainSettings dprintf(DEBUG_DEBUG, "init mainmenue\n"); mainMenu.addItem(GenericMenuSeparator); + + mainMenu.addItem(new CMenuForwarder(LOCALE_MAINMENU_TVMODE, true, NULL, this, "tv", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED), true); - mainMenu.addItem(new CMenuForwarder(LOCALE_MAINMENU_TVMODE, true, NULL, this, "tv_radio_switch", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED), true); + mainMenu.addItem(new CMenuForwarder(LOCALE_MAINMENU_RADIOMODE, true, NULL, this, "radio", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN)); //games if (g_PluginList->hasPlugin(CPlugins::P_TYPE_GAME)) - mainMenu.addItem(new CMenuForwarder(LOCALE_MAINMENU_GAMES, true, NULL, new CPluginList(LOCALE_MAINMENU_GAMES,CPlugins::P_TYPE_GAME), "", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN)); + mainMenu.addItem(new CMenuForwarder(LOCALE_MAINMENU_GAMES, true, NULL, new CPluginList(LOCALE_MAINMENU_GAMES,CPlugins::P_TYPE_GAME), "", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW)); - //timer - mainMenu.addItem(new CMenuForwarder(LOCALE_TIMERLIST_NAME, true, NULL, new CTimerList(), NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW)); +// //TODO: timer +// mainMenu.addItem(new CMenuForwarder(LOCALE_TIMERLIST_NAME, true, NULL, new CTimerList(), NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW)); //multimedia menu mainMenu.addItem(new CMenuForwarder(LOCALE_MAINMENU_MEDIA, true, NULL, CMediaPlayerMenu::getInstance(), NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE));