From ecdeaf0566efed5f5cca00c11b31d5c1c8f48672 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 22 Feb 2016 21:06:46 +0100 Subject: [PATCH] miscsettings_menu: allow to reset movieplayer plugin Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a4bd8cc5a80e1e55e3f7561cab918a6b9d9c7d1a Author: vanhofen Date: 2016-02-22 (Mon, 22 Feb 2016) Origin message was: ------------------ - miscsettings_menu: allow to reset movieplayer plugin ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 3 ++- data/locale/english.locale | 3 ++- src/gui/miscsettings_menu.cpp | 9 ++++----- src/neutrino.cpp | 2 +- src/system/locals.h | 3 ++- src/system/locals_intern.h | 3 ++- src/system/setting_helpers.cpp | 16 ++++++++++++---- 7 files changed, 25 insertions(+), 14 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index f481f867c..07b224a61 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1772,7 +1772,7 @@ movieplayer.bookmarkname Bookmark Name movieplayer.bookmarkname_hint1 Geben Sie den Namen für das neue Lesezeichen ein movieplayer.bookmarkname_hint2 movieplayer.chapters Kapitel -movieplayer.defplugin Start-Plugin +movieplayer.plugin Movieplayer-Plugin movieplayer.fileplayback Abspielen (Multiformat) movieplayer.head Movieplayer movieplayer.starting Wiedergabe starten... @@ -1996,6 +1996,7 @@ ping.unreachable ist nicht erreichbar (unerreichbar) pinprotection.head PIN-Abfrage pinprotection.wrongcode Geben Sie den Code nocheinmal ein! plugins.hdd_dir Externes Plugin-Verz. +plugins.no_plugin Kein Plugin plugins.result Pluginausgabe plugintype.disabled Deaktiviert plugintype.game Spiel diff --git a/data/locale/english.locale b/data/locale/english.locale index 1d3a6b931..63ce34062 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1772,7 +1772,7 @@ movieplayer.bookmarkname Bookmarkname movieplayer.bookmarkname_hint1 Enter a name for your new bookmark movieplayer.bookmarkname_hint2 movieplayer.chapters Chapters -movieplayer.defplugin Start-Plugin +movieplayer.plugin Movieplayer plugin movieplayer.fileplayback File play movieplayer.head Movieplayer movieplayer.starting Starting playback... @@ -1996,6 +1996,7 @@ ping.unreachable is unreachable pinprotection.head Enter PIN code pinprotection.wrongcode PIN-Code was wrong! Try again. plugins.hdd_dir Plugin HDD dir. +plugins.no_plugin No plugin plugins.result plugin output plugintype.disabled Disabled plugintype.game Game diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 55aca50fc..4f5d2bcc8 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -100,11 +100,11 @@ int CMiscMenue::exec(CMenuTarget* parent, const std::string &actionKey) } else if(actionKey == "movieplayer_plugin") { - CMenuWidget MoviePluginSelector(LOCALE_MOVIEPLAYER_DEFPLUGIN, NEUTRINO_ICON_FEATURES); + CMenuWidget MoviePluginSelector(LOCALE_MOVIEPLAYER_PLUGIN, NEUTRINO_ICON_FEATURES); MoviePluginSelector.addItem(GenericMenuSeparator); - + MoviePluginSelector.addItem(new CMenuForwarder(LOCALE_PLUGINS_NO_PLUGIN, true, NULL, new CMoviePluginChangeExec(), "---", CRCInput::RC_red)); + MoviePluginSelector.addItem(GenericMenuSeparatorLine); char id[5]; - int cnt = 0; int enabled_count = 0; for(unsigned int count=0;count < (unsigned int) g_PluginList->getNumberOfPlugins();count++) { @@ -112,8 +112,7 @@ int CMiscMenue::exec(CMenuTarget* parent, const std::string &actionKey) { sprintf(id, "%d", count); enabled_count++; - MoviePluginSelector.addItem(new CMenuForwarder(g_PluginList->getName(count), true, NULL, new CMoviePluginChangeExec(), id, CRCInput::convertDigitToKey(count)), (cnt == 0)); - cnt++; + MoviePluginSelector.addItem(new CMenuForwarder(g_PluginList->getName(count), true, NULL, new CMoviePluginChangeExec(), id, CRCInput::convertDigitToKey(count))); } } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 89b9e1457..7cf024d84 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -638,7 +638,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.recording_startstop_msg = configfile.getBool("recording_startstop_msg" , true); // default plugin for movieplayer - g_settings.movieplayer_plugin = configfile.getString( "movieplayer_plugin", "noplugin" ); + g_settings.movieplayer_plugin = configfile.getString( "movieplayer_plugin", "---" ); g_settings.plugin_hdd_dir = configfile.getString( "plugin_hdd_dir", "/media/sda1/plugins" ); g_settings.plugins_disabled = configfile.getString( "plugins_disabled", "" ); diff --git a/src/system/locals.h b/src/system/locals.h index 864bc074f..ebb211634 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1799,7 +1799,7 @@ typedef enum LOCALE_MOVIEPLAYER_BOOKMARKNAME_HINT1, LOCALE_MOVIEPLAYER_BOOKMARKNAME_HINT2, LOCALE_MOVIEPLAYER_CHAPTERS, - LOCALE_MOVIEPLAYER_DEFPLUGIN, + LOCALE_MOVIEPLAYER_PLUGIN, LOCALE_MOVIEPLAYER_FILEPLAYBACK, LOCALE_MOVIEPLAYER_HEAD, LOCALE_MOVIEPLAYER_STARTING, @@ -2023,6 +2023,7 @@ typedef enum LOCALE_PINPROTECTION_HEAD, LOCALE_PINPROTECTION_WRONGCODE, LOCALE_PLUGINS_HDD_DIR, + LOCALE_PLUGINS_NO_PLUGIN, LOCALE_PLUGINS_RESULT, LOCALE_PLUGINTYPE_DISABLED, LOCALE_PLUGINTYPE_GAME, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 0ac541b47..ec84ab93f 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1799,7 +1799,7 @@ const char * locale_real_names[] = "movieplayer.bookmarkname_hint1", "movieplayer.bookmarkname_hint2", "movieplayer.chapters", - "movieplayer.defplugin", + "movieplayer.plugin", "movieplayer.fileplayback", "movieplayer.head", "movieplayer.starting", @@ -2023,6 +2023,7 @@ const char * locale_real_names[] = "pinprotection.head", "pinprotection.wrongcode", "plugins.hdd_dir", + "plugins.no_plugin", "plugins.result", "plugintype.disabled", "plugintype.game", diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index 3c7c569b9..7c098a086 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -375,12 +375,20 @@ int CNVODChangeExec::exec(CMenuTarget* parent, const std::string & actionKey) int CMoviePluginChangeExec::exec(CMenuTarget* parent, const std::string & actionKey) { - int sel= atoi(actionKey.c_str()); - parent->hide(); - if (sel>=0) + if (parent) + parent->hide(); + + if (actionKey == "---") { - g_settings.movieplayer_plugin=g_PluginList->getName(sel); + g_settings.movieplayer_plugin = actionKey; } + else + { + int sel = atoi(actionKey.c_str()); + if (sel >= 0) + g_settings.movieplayer_plugin = g_PluginList->getName(sel); + } + return menu_return::RETURN_EXIT; }