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));