mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
neutrino: disable some menus in upnp & ts mode
to prevent inoperability of neutrino
This commit is contained in:
@@ -184,6 +184,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
||||
menu->addItem(GenericMenuSeparator);
|
||||
|
||||
bool _mode_ts = CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_ts;
|
||||
bool _mode_upnp = CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_upnp;
|
||||
bool _mode_webtv = (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webtv) &&
|
||||
(!CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty());
|
||||
|
||||
@@ -249,7 +250,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
||||
case SNeutrinoSettings::ITEM_AUDIO_SELECT:
|
||||
{
|
||||
keyhelper.get(&key,&icon);
|
||||
menu_item = new CMenuDForwarder(LOCALE_AUDIOSELECTMENUE_HEAD, !_mode_ts, NULL, new CAudioSelectMenuHandler, "-1", key,icon);
|
||||
menu_item = new CMenuDForwarder(LOCALE_AUDIOSELECTMENUE_HEAD, !_mode_ts && !_mode_upnp, NULL, new CAudioSelectMenuHandler, "-1", key,icon);
|
||||
// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
|
||||
break;
|
||||
}
|
||||
@@ -285,7 +286,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
||||
if (g_settings.recording_type == RECORDING_OFF)
|
||||
break;
|
||||
keyhelper.get(&key,&icon,CRCInput::RC_green);
|
||||
menu_item = new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, !_mode_ts, NULL, neutrino, "tsmoviebrowser", key, icon);
|
||||
menu_item = new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, !_mode_ts && !_mode_upnp, NULL, neutrino, "tsmoviebrowser", key, icon);
|
||||
menu_item->setHint(NEUTRINO_ICON_HINT_MB, LOCALE_MENU_HINT_MB);
|
||||
break;
|
||||
}
|
||||
@@ -407,14 +408,14 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
||||
case SNeutrinoSettings::ITEM_YOUTUBE:
|
||||
{
|
||||
keyhelper.get(&key,&icon);
|
||||
menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_YTPLAYBACK, !_mode_ts, NULL, neutrino, "ytplayback", key, icon);
|
||||
menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_YTPLAYBACK, !_mode_ts && !_mode_upnp, NULL, neutrino, "ytplayback", key, icon);
|
||||
menu_item->setHint(NEUTRINO_ICON_HINT_YTPLAY, LOCALE_MENU_HINT_YTPLAY);
|
||||
break;
|
||||
}
|
||||
case SNeutrinoSettings::ITEM_FILEPLAY:
|
||||
{
|
||||
keyhelper.get(&key,&icon);
|
||||
menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_FILEPLAYBACK, !_mode_ts, NULL, neutrino, "fileplayback", key, icon);
|
||||
menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_FILEPLAYBACK, !_mode_ts && !_mode_upnp, NULL, neutrino, "fileplayback", key, icon);
|
||||
menu_item->setHint(NEUTRINO_ICON_HINT_FILEPLAY, LOCALE_MENU_HINT_FILEPLAY);
|
||||
break;
|
||||
}
|
||||
@@ -442,14 +443,14 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
||||
case SNeutrinoSettings::ITEM_AUDIOPLAY:
|
||||
{
|
||||
keyhelper.get(&key,&icon);
|
||||
menu_item = new CMenuForwarder(LOCALE_AUDIOPLAYER_NAME, true, NULL, neutrino, "audioplayer", key, icon);
|
||||
menu_item = new CMenuForwarder(LOCALE_AUDIOPLAYER_NAME, !_mode_ts && !_mode_upnp, NULL, neutrino, "audioplayer", key, icon);
|
||||
menu_item->setHint(NEUTRINO_ICON_HINT_APLAY, LOCALE_MENU_HINT_APLAY);
|
||||
break;
|
||||
}
|
||||
case SNeutrinoSettings::ITEM_INETPLAY:
|
||||
{
|
||||
keyhelper.get(&key,&icon);
|
||||
menu_item = new CMenuForwarder(LOCALE_INETRADIO_NAME, true, NULL, neutrino, "inetplayer", key, icon);
|
||||
menu_item = new CMenuForwarder(LOCALE_INETRADIO_NAME, !_mode_ts && !_mode_upnp, NULL, neutrino, "inetplayer", key, icon);
|
||||
menu_item->setHint(NEUTRINO_ICON_HINT_INET_RADIO, LOCALE_MENU_HINT_INET_RADIO);
|
||||
break;
|
||||
}
|
||||
|
@@ -131,7 +131,13 @@ bool CMenuItem::initModeCondition(const int& stb_mode)
|
||||
void CMenuItem::disableByCondition(const menu_item_disable_cond_t& condition)
|
||||
{
|
||||
int stb_mode = CNeutrinoApp::getInstance()->getMode();
|
||||
|
||||
#if ENABLE_UPNP
|
||||
if (condition & DCOND_MODE_UPNP){
|
||||
if (stb_mode == CNeutrinoApp::mode_upnp)
|
||||
if (initModeCondition(stb_mode))
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (condition & DCOND_MODE_TS){
|
||||
if (stb_mode == CNeutrinoApp::mode_ts)
|
||||
if (initModeCondition(stb_mode))
|
||||
|
@@ -78,6 +78,9 @@ enum
|
||||
DCOND_MODE_TV = 2,
|
||||
DCOND_MODE_RADIO = 4,
|
||||
DCOND_MODE_TS = 8
|
||||
#if ENABLE_UPNP
|
||||
,DCOND_MODE_UPNP = 16
|
||||
#endif
|
||||
}/*menu_item_disable_cond_t*/;
|
||||
|
||||
class CChangeObserver
|
||||
|
@@ -164,17 +164,29 @@ void CNeutrinoApp::InitMenuMain()
|
||||
//tv <-> radio toggle
|
||||
CMenuForwarder *tvradio_switch = new CMenuForwarder(LOCALE_MAINMENU_TVRADIO_SWITCH, true, NULL, this, "tv_radio_switch", CRCInput::RC_red);
|
||||
tvradio_switch->setHint(NEUTRINO_ICON_HINT_TVRADIO_SWITCH, LOCALE_MENU_HINT_TVRADIO_SWITCH);
|
||||
personalize.addItem(MENU_MAIN, tvradio_switch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, NULL, DCOND_MODE_TS);
|
||||
personalize.addItem(MENU_MAIN, tvradio_switch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, NULL, DCOND_MODE_TS
|
||||
#if ENABLE_UPNP
|
||||
| DCOND_MODE_UPNP
|
||||
#endif
|
||||
);
|
||||
|
||||
//tv-mode
|
||||
CMenuForwarder *tvswitch = new CMenuForwarder(LOCALE_MAINMENU_TVMODE, true, NULL, this, "tv", CRCInput::RC_red);
|
||||
tvswitch->setHint(NEUTRINO_ICON_HINT_TVMODE, LOCALE_MENU_HINT_TVMODE);
|
||||
personalize.addItem(MENU_MAIN, tvswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_TV | DCOND_MODE_TS); //observed
|
||||
personalize.addItem(MENU_MAIN, tvswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_TV | DCOND_MODE_TS //observed
|
||||
#if ENABLE_UPNP
|
||||
| DCOND_MODE_UPNP
|
||||
#endif
|
||||
);
|
||||
|
||||
//radio-mode
|
||||
CMenuForwarder *radioswitch = new CMenuForwarder(LOCALE_MAINMENU_RADIOMODE, true, NULL, this, "radio", CRCInput::RC_green);
|
||||
radioswitch->setHint(NEUTRINO_ICON_HINT_RADIOMODE, LOCALE_MENU_HINT_RADIOMODE);
|
||||
personalize.addItem(MENU_MAIN, radioswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_RADIO | DCOND_MODE_TS); //observed
|
||||
personalize.addItem(MENU_MAIN, radioswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_RADIO | DCOND_MODE_TS //observed
|
||||
#if ENABLE_UPNP
|
||||
| DCOND_MODE_UPNP
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
||||
//timer
|
||||
|
Reference in New Issue
Block a user