diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 44b6e7395..69415ead2 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1393,6 +1393,7 @@ menu.hint_service Sendersuchlauf, Bouquet-Verwaltung, Software-Aktualisierung un menu.hint_service_scan Automatischer / manueller Service Suchlauf menu.hint_settings Konfigurieren von Neutrino-HD,\nNetzwerk, Video, Audio, OSD und mehr menu.hint_shoutcast_dev_id Geben Sie die SHOUTcast Dev ID ein. Eine leere Eingabe schaltet die SHOUTcast-Unterstützung aus +menu.hint_shoutcast_enabled Schaltet die SHOUTcast-Unterstützung ein oder aus menu.hint_show_mute_icon Definiert, ob bei einem Lautstärkewert von 0 das Stumm-Symbol eingeblendet werden soll menu.hint_shutdown Setzen Sie Ihre Box in den Standby-Modus oder schalten Sie die Box komplett aus menu.hint_shutdown_count Die Zeit zum Herunterfahren in den Deep-Standby, wenn die Box im Standby-Modus ist @@ -1421,6 +1422,7 @@ menu.hint_timeouts Gibt an, nach welcher Zeit in Sekunden die Menüs oder Infofe menu.hint_timers Hinzufügen, entfernen und bearbeiten geplanter Aufnahmen oder anderer Timer menu.hint_timezone Wählen Sie ihre Zeitzone aus menu.hint_tmdb_api_key Geben Sie den TMDb API Schlüssel ein. Eine leere Eingabe schaltet die TMDb-Unterstützung aus +menu.hint_tmdb_enabled Schaltet die TMDb-Unterstützung (themoviedb.org) ein bzw. aus menu.hint_tools Werkzeuge ausführen menu.hint_tvmode Schaltet zum TV-Modus menu.hint_tvradio_switch Schaltet zwischen TV- und Radio-Modus um @@ -1459,6 +1461,7 @@ menu.hint_volume_size Wählen Sie die Höhe der Lautstärkeanzeige menu.hint_webtv_setup Hier konfigurierte WebTV-Kanäle finden Sie in der Kanalverwaltung. menu.hint_window_size Kanalliste, EPG-Infos und einige andere Fenster werden mit diesem Faktor skaliert menu.hint_youtube_dev_id Geben Sie die YouTube Dev ID ein. Eine leere Eingabe schaltet die YouTube-Unterstützung aus +menu.hint_youtube_enabled Schaltet die YouTube-Unterstützung ein oder aus menu.hint_ytplay Wiedergabe von ausgewählten Youtube Feeds menu.hint_ytplay_setup Konfigurieren Sie YouTube-spezifische Optionen wie maximale Ergebnisse bei Suchen oder Cache-Verzeichnis menu.hint_zap_cycle Wählen Sie, ob nur innerhalb des aktiven Bouquets umgeschaltet werden kann @@ -2251,6 +2254,7 @@ settings.pos_top_right oben rechts settings.restore Image-Einstellungen: Wiederherstellen settings.restore_warn Alle Settings werden ersetzt.\nDie Box wird neu gestartet.\nWeiter? shoutcast.dev_id SHOUTcast Dev ID +shoutcast.enabled SHOUTcast-Unterstützung shutdown.recording_query Aufnahme läuft. Trotzdem beenden? shutdowntimer.announce Die Box wird in 1 Min. heruntergefahren.\nShutdown abbrechen? sleeptimerbox.announce Die Box wird in 1 Min. in Standby-Betrieb gehen.\nStandby-Betrieb abbrechen? @@ -2371,6 +2375,7 @@ timing.menu Menü timing.numericzap Umschalten mit Zifferntasten timing.volumebar Lautstärkeanzeige tmdb.api_key TMDb API Schlüssel +tmdb.enabled TMDb-Unterstützung tmdb.read_data Suche TMDB Daten... unicable.lnb Unicable Eingang unicable.qrg Unicable Frequenz @@ -2479,6 +2484,7 @@ wizard.welcome_text Wir gratulieren Ihnen zum Kauf Ihrer CST. In den nun folgend word.from ab word.in in youtube.dev_id YouTube Dev ID +youtube.enabled YouTube-Unterstützung zapit.scantype Service-Auswahl zapit.scantype.all Alle Services zapit.scantype.radio Nur Radio diff --git a/data/locale/english.locale b/data/locale/english.locale index f8b74ca44..fcb0d0f56 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1393,6 +1393,7 @@ menu.hint_service Tuner setup, service scan,\nbouquet editor, software upgrade menu.hint_service_scan Auto / manual service scan menu.hint_settings Configure Neutrino-HD\nNetwork, audio, video, OSD and more menu.hint_shoutcast_dev_id Type your SHOUTcast Dev ID. An empty input disables SHOUTcast support +menu.hint_shoutcast_enabled Enable or disable SHOUTcast support menu.hint_show_mute_icon Show mute icon, when volume set to 0 menu.hint_shutdown Put your box in deep standby mode\nNo confirmation menu.hint_shutdown_count Time to put box in deep-standby\nfrom soft-standby mode @@ -1421,6 +1422,7 @@ menu.hint_timeouts Configure time to hide GUI windows\nin seconds menu.hint_timers Add/Remove/Edit scheduled\nrecording, reminders etc. menu.hint_timezone Select your timezone menu.hint_tmdb_api_key Type your TMDb API key. An empty input disables TMDb support +menu.hint_tmdb_enabled Enable or disable TMDb support (themoviedb.org) menu.hint_tools Run tools menu.hint_tvmode Switch box to TV mode menu.hint_tvradio_switch Switches between TV and Radio mode @@ -1459,6 +1461,7 @@ menu.hint_volume_size Select volume indicator height menu.hint_webtv_setup WebTV channels configured here will be available in the standard channel lists. menu.hint_window_size Channellist, EPG-infos and some other windows are scaled by this factor menu.hint_youtube_dev_id Type your YouTube Dev ID. An empty input disables YouTube support +menu.hint_youtube_enabled Enable or disable YouTube support menu.hint_ytplay Play selected youtube feeds menu.hint_ytplay_setup Configure YouTube-specific options, e.g. an upper limit for search results menu.hint_zap_cycle When swithing channels, stay in current bouquet @@ -2251,6 +2254,7 @@ settings.pos_top_right top right settings.restore Image-Settings: Restore settings.restore_warn This will replace all settings and reboot\nContinue ? shoutcast.dev_id SHOUTcast Dev ID +shoutcast.enabled SHOUTcast support shutdown.recording_query You really want to to stop record ? shutdowntimer.announce Box will shutdown in 1 min.\nCancel Shutdown ? sleeptimerbox.announce Box will standby in 1 min.\nCancel Standby ? @@ -2371,6 +2375,7 @@ timing.menu Menu timing.numericzap Numeric Zap timing.volumebar Volume bar tmdb.api_key TMDb API key +tmdb.enabled TMDb support tmdb.read_data Search TMDB Data... unicable.lnb Unicable Input unicable.qrg Unicable Frequency @@ -2479,6 +2484,7 @@ wizard.welcome_text Next steps will guide you through initial installation of th word.from from word.in in youtube.dev_id YouTube Dev ID +youtube.enabled YouTube support zapit.scantype scan for services zapit.scantype.all all services zapit.scantype.radio only radio diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 206de09de..b76adc465 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -552,18 +552,34 @@ int CMiscMenue::showMiscSettingsMenuOnlineServices() CMenuWidget *ms_oservices = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_MISCSETUP_ONLINESERVICES); ms_oservices->addIntroItems(LOCALE_MISCSETTINGS_ONLINESERVICES); + tmdb_onoff = new CMenuOptionChooser(LOCALE_TMDB_ENABLED, &g_settings.tmdb_enabled, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, check_tmdb_api_key()); + tmdb_onoff->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_TMDB_ENABLED); + ms_oservices->addItem(tmdb_onoff); + changeNotify(LOCALE_TMDB_API_KEY, NULL); CKeyboardInput tmdb_api_key_input(LOCALE_TMDB_API_KEY, &g_settings.tmdb_api_key, 32, this); CMenuForwarder *mf = new CMenuForwarder(LOCALE_TMDB_API_KEY, true, tmdb_api_key_short, &tmdb_api_key_input); mf->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_TMDB_API_KEY); ms_oservices->addItem(mf); + ms_oservices->addItem(GenericMenuSeparator); + + youtube_onoff = new CMenuOptionChooser(LOCALE_YOUTUBE_ENABLED, &g_settings.youtube_enabled, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, check_youtube_dev_id()); + youtube_onoff->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_YOUTUBE_ENABLED); + ms_oservices->addItem(youtube_onoff); + changeNotify(LOCALE_YOUTUBE_DEV_ID, NULL); CKeyboardInput youtube_dev_id_input(LOCALE_YOUTUBE_DEV_ID, &g_settings.youtube_dev_id, 38, this); mf = new CMenuForwarder(LOCALE_YOUTUBE_DEV_ID, true, youtube_dev_id_short, &youtube_dev_id_input); mf->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_YOUTUBE_DEV_ID); ms_oservices->addItem(mf); + ms_oservices->addItem(GenericMenuSeparator); + + shoutcast_onoff = new CMenuOptionChooser(LOCALE_SHOUTCAST_ENABLED, &g_settings.shoutcast_enabled, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, check_shoutcast_dev_id()); + shoutcast_onoff->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_SHOUTCAST_ENABLED); + ms_oservices->addItem(shoutcast_onoff); + changeNotify(LOCALE_SHOUTCAST_DEV_ID, NULL); CKeyboardInput shoutcast_dev_id_input(LOCALE_SHOUTCAST_DEV_ID, &g_settings.shoutcast_dev_id, 16, this); mf = new CMenuForwarder(LOCALE_SHOUTCAST_DEV_ID, true, shoutcast_dev_id_short, &shoutcast_dev_id_input); @@ -633,27 +649,30 @@ bool CMiscMenue::changeNotify(const neutrino_locale_t OptionName, void * /*data* } else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_TMDB_API_KEY)) { - g_settings.tmdb_enabled = ((g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") && !g_settings.tmdb_api_key.empty()); + g_settings.tmdb_enabled = check_tmdb_api_key(); if (g_settings.tmdb_enabled) tmdb_api_key_short = g_settings.tmdb_api_key.substr(0, 8) + "..."; else tmdb_api_key_short.clear(); + tmdb_onoff->setActive(g_settings.tmdb_enabled); } else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_YOUTUBE_DEV_ID)) { - g_settings.youtube_enabled = ((g_settings.youtube_dev_id != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") && !g_settings.youtube_dev_id.empty()); + g_settings.youtube_enabled = check_youtube_dev_id(); if (g_settings.youtube_enabled) youtube_dev_id_short = g_settings.youtube_dev_id.substr(0, 8) + "..."; else youtube_dev_id_short.clear(); + youtube_onoff->setActive(g_settings.youtube_enabled); } else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_SHOUTCAST_DEV_ID)) { - g_settings.shoutcast_enabled = ((g_settings.shoutcast_dev_id != "XXXXXXXXXXXXXXXX") && !g_settings.shoutcast_dev_id.empty()); + g_settings.shoutcast_enabled = check_shoutcast_dev_id(); if (g_settings.shoutcast_enabled) shoutcast_dev_id_short = g_settings.shoutcast_dev_id.substr(0, 8) + "..."; else shoutcast_dev_id_short.clear(); + shoutcast_onoff->setActive(g_settings.shoutcast_enabled); } return ret; } diff --git a/src/gui/miscsettings_menu.h b/src/gui/miscsettings_menu.h index 22f6f25e4..8e5848ef8 100644 --- a/src/gui/miscsettings_menu.h +++ b/src/gui/miscsettings_menu.h @@ -46,6 +46,9 @@ class CMiscMenue : public CMenuTarget, CChangeObserver CMenuOptionChooser * epg_save_frequently; CMenuOptionChooser * epg_read; CMenuOptionChooser * epg_scan; + CMenuOptionChooser * tmdb_onoff; + CMenuOptionChooser * youtube_onoff; + CMenuOptionChooser * shoutcast_onoff; CMenuForwarder * epg_dir; int width; std::string epg_cache; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 8ed7d9051..b185cd004 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -803,14 +803,17 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.audioplayer_show_playlist = configfile.getInt32("audioplayer_show_playlist",1); g_settings.audioplayer_enable_sc_metadata = configfile.getInt32("audioplayer_enable_sc_metadata",1); g_settings.shoutcast_dev_id = configfile.getString("shoutcast_dev_id","XXXXXXXXXXXXXXXX"); - g_settings.shoutcast_enabled = ((g_settings.shoutcast_dev_id != "XXXXXXXXXXXXXXXX") && !g_settings.shoutcast_dev_id.empty()); + g_settings.shoutcast_enabled = configfile.getInt32("shoutcast_enabled", 1); + g_settings.shoutcast_enabled = check_shoutcast_dev_id(); //Movie-Player g_settings.movieplayer_repeat_on = configfile.getInt32("movieplayer_repeat_on", CMoviePlayerGui::REPEAT_OFF); g_settings.youtube_dev_id = configfile.getString("youtube_dev_id","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); - g_settings.youtube_enabled = ((g_settings.youtube_dev_id != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") && !g_settings.youtube_dev_id.empty()); + g_settings.youtube_enabled = configfile.getInt32("youtube_enabled", 1); + g_settings.youtube_enabled = check_youtube_dev_id(); g_settings.tmdb_api_key = configfile.getString("tmdb_api_key","XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); - g_settings.tmdb_enabled = ((g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") && !g_settings.tmdb_api_key.empty()); + g_settings.tmdb_enabled = configfile.getInt32("tmdb_enabled", 1); + g_settings.tmdb_enabled = check_tmdb_api_key(); //Filebrowser g_settings.filebrowser_showrights = configfile.getInt32("filebrowser_showrights", 1); @@ -1310,11 +1313,14 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32( "audioplayer_show_playlist", g_settings.audioplayer_show_playlist ); configfile.setInt32( "audioplayer_enable_sc_metadata", g_settings.audioplayer_enable_sc_metadata ); configfile.setString( "shoutcast_dev_id", g_settings.shoutcast_dev_id ); + configfile.setInt32( "shoutcast_enabled", g_settings.shoutcast_enabled ); //Movie-Player configfile.setInt32( "movieplayer_repeat_on", g_settings.movieplayer_repeat_on ); configfile.setString( "youtube_dev_id", g_settings.youtube_dev_id ); + configfile.setInt32( "youtube_enabled", g_settings.youtube_enabled ); configfile.setString( "tmdb_api_key", g_settings.tmdb_api_key ); + configfile.setInt32( "tmdb_enabled", g_settings.tmdb_enabled ); //Filebrowser configfile.setInt32("filebrowser_showrights", g_settings.filebrowser_showrights); diff --git a/src/system/locals.h b/src/system/locals.h index 8d2865671..bda6f7548 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1420,6 +1420,7 @@ typedef enum LOCALE_MENU_HINT_SERVICE_SCAN, LOCALE_MENU_HINT_SETTINGS, LOCALE_MENU_HINT_SHOUTCAST_DEV_ID, + LOCALE_MENU_HINT_SHOUTCAST_ENABLED, LOCALE_MENU_HINT_SHOW_MUTE_ICON, LOCALE_MENU_HINT_SHUTDOWN, LOCALE_MENU_HINT_SHUTDOWN_COUNT, @@ -1448,6 +1449,7 @@ typedef enum LOCALE_MENU_HINT_TIMERS, LOCALE_MENU_HINT_TIMEZONE, LOCALE_MENU_HINT_TMDB_API_KEY, + LOCALE_MENU_HINT_TMDB_ENABLED, LOCALE_MENU_HINT_TOOLS, LOCALE_MENU_HINT_TVMODE, LOCALE_MENU_HINT_TVRADIO_SWITCH, @@ -1486,6 +1488,7 @@ typedef enum LOCALE_MENU_HINT_WEBTV_SETUP, LOCALE_MENU_HINT_WINDOW_SIZE, LOCALE_MENU_HINT_YOUTUBE_DEV_ID, + LOCALE_MENU_HINT_YOUTUBE_ENABLED, LOCALE_MENU_HINT_YTPLAY, LOCALE_MENU_HINT_YTPLAY_SETUP, LOCALE_MENU_HINT_ZAP_CYCLE, @@ -2278,6 +2281,7 @@ typedef enum LOCALE_SETTINGS_RESTORE, LOCALE_SETTINGS_RESTORE_WARN, LOCALE_SHOUTCAST_DEV_ID, + LOCALE_SHOUTCAST_ENABLED, LOCALE_SHUTDOWN_RECORDING_QUERY, LOCALE_SHUTDOWNTIMER_ANNOUNCE, LOCALE_SLEEPTIMERBOX_ANNOUNCE, @@ -2398,6 +2402,7 @@ typedef enum LOCALE_TIMING_NUMERICZAP, LOCALE_TIMING_VOLUMEBAR, LOCALE_TMDB_API_KEY, + LOCALE_TMDB_ENABLED, LOCALE_TMDB_READ_DATA, LOCALE_UNICABLE_LNB, LOCALE_UNICABLE_QRG, @@ -2506,6 +2511,7 @@ typedef enum LOCALE_WORD_FROM, LOCALE_WORD_IN, LOCALE_YOUTUBE_DEV_ID, + LOCALE_YOUTUBE_ENABLED, LOCALE_ZAPIT_SCANTYPE, LOCALE_ZAPIT_SCANTYPE_ALL, LOCALE_ZAPIT_SCANTYPE_RADIO, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index d74e1d96a..cee08f36a 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1420,6 +1420,7 @@ const char * locale_real_names[] = "menu.hint_service_scan", "menu.hint_settings", "menu.hint_shoutcast_dev_id", + "menu.hint_shoutcast_enabled", "menu.hint_show_mute_icon", "menu.hint_shutdown", "menu.hint_shutdown_count", @@ -1448,6 +1449,7 @@ const char * locale_real_names[] = "menu.hint_timers", "menu.hint_timezone", "menu.hint_tmdb_api_key", + "menu.hint_tmdb_enabled", "menu.hint_tools", "menu.hint_tvmode", "menu.hint_tvradio_switch", @@ -1486,6 +1488,7 @@ const char * locale_real_names[] = "menu.hint_webtv_setup", "menu.hint_window_size", "menu.hint_youtube_dev_id", + "menu.hint_youtube_enabled", "menu.hint_ytplay", "menu.hint_ytplay_setup", "menu.hint_zap_cycle", @@ -2278,6 +2281,7 @@ const char * locale_real_names[] = "settings.restore", "settings.restore_warn", "shoutcast.dev_id", + "shoutcast.enabled", "shutdown.recording_query", "shutdowntimer.announce", "sleeptimerbox.announce", @@ -2398,6 +2402,7 @@ const char * locale_real_names[] = "timing.numericzap", "timing.volumebar", "tmdb.api_key", + "tmdb.enabled", "tmdb.read_data", "unicable.lnb", "unicable.qrg", @@ -2506,6 +2511,7 @@ const char * locale_real_names[] = "word.from", "word.in", "youtube.dev_id", + "youtube.enabled", "zapit.scantype", "zapit.scantype.all", "zapit.scantype.radio", diff --git a/src/system/setting_helpers.h b/src/system/setting_helpers.h index 98be19f84..1c23a2ddc 100644 --- a/src/system/setting_helpers.h +++ b/src/system/setting_helpers.h @@ -33,6 +33,7 @@ */ +#include #include #include @@ -149,4 +150,9 @@ class CAutoModeNotifier : public CChangeObserver bool changeNotify(const neutrino_locale_t, void * data); }; +//do we need a class? +inline int check_shoutcast_dev_id() { return ((g_settings.shoutcast_dev_id != "XXXXXXXXXXXXXXXX") && !g_settings.shoutcast_dev_id.empty()); } +inline int check_youtube_dev_id() { return ((g_settings.youtube_dev_id != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") && !g_settings.youtube_dev_id.empty()); } +inline int check_tmdb_api_key() { return ((g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") && !g_settings.tmdb_api_key.empty()); } + #endif