Merge remote-tracking branch 'tuxbox/master'

* needs compile fixes
* needs additional tests, of course :-)
This commit is contained in:
Stefan Seyfried
2016-10-22 11:37:40 +02:00
346 changed files with 13372 additions and 6088 deletions

View File

@@ -47,6 +47,7 @@
#include <gui/widget/icons.h>
#include <gui/widget/stringinput.h>
#include <gui/widget/messagebox.h>
#include <gui/widget/keyboard_input.h>
#include <driver/screen_max.h>
#include <driver/scanepg.h>
@@ -99,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++)
{
@@ -111,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)));
}
}
@@ -135,11 +135,15 @@ int CMiscMenue::exec(CMenuTarget* parent, const std::string &actionKey)
{
return showMiscSettingsMenuChanlist();
}
else if(actionKey == "onlineservices")
{
return showMiscSettingsMenuOnlineServices();
}
return showMiscSettingsMenu();
}
#if 0 //not used
#define MISCSETTINGS_FB_DESTINATION_OPTION_COUNT 3
const CMenuOptionChooser::keyval MISCSETTINGS_FB_DESTINATION_OPTIONS[MISCSETTINGS_FB_DESTINATION_OPTION_COUNT] =
{
@@ -147,6 +151,7 @@ const CMenuOptionChooser::keyval MISCSETTINGS_FB_DESTINATION_OPTIONS[MISCSETTING
{ 1, LOCALE_OPTIONS_SERIAL },
{ 2, LOCALE_OPTIONS_FB }
};
#endif
#define MISCSETTINGS_FILESYSTEM_IS_UTF8_OPTION_COUNT 2
const CMenuOptionChooser::keyval MISCSETTINGS_FILESYSTEM_IS_UTF8_OPTIONS[MISCSETTINGS_FILESYSTEM_IS_UTF8_OPTION_COUNT] =
@@ -277,11 +282,16 @@ int CMiscMenue::showMiscSettingsMenu()
mf->setHint("", LOCALE_MENU_HINT_MISC_ZAPIT);
misc_menue.addItem(mf);
// onlineservices
mf = new CMenuForwarder(LOCALE_MISCSETTINGS_ONLINESERVICES, true, NULL, this, "onlineservices", CRCInput::RC_4);
mf->setHint("", LOCALE_MENU_HINT_MISC_ONLINESERVICES);
misc_menue.addItem(mf);
#ifdef CPU_FREQ
//CPU
CMenuWidget misc_menue_cpu("CPU", NEUTRINO_ICON_SETTINGS, width);
showMiscSettingsMenuCPUFreq(&misc_menue_cpu);
misc_menue.addItem( new CMenuForwarder("CPU", true, NULL, &misc_menue_cpu, NULL, CRCInput::RC_4));
misc_menue.addItem( new CMenuForwarder("CPU", true, NULL, &misc_menue_cpu, NULL, CRCInput::RC_5));
#endif /*CPU_FREQ*/
int res = misc_menue.exec(NULL, "");
@@ -544,6 +554,51 @@ int CMiscMenue::showMiscSettingsMenuChanlist()
return res;
}
// online services
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);
mf->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_SHOUTCAST_DEV_ID);
ms_oservices->addItem(mf);
int res = ms_oservices->exec(NULL, "");
delete ms_oservices;
return res;
}
#ifdef CPU_FREQ
//CPU
void CMiscMenue::showMiscSettingsMenuCPUFreq(CMenuWidget *ms_cpu)
@@ -602,5 +657,32 @@ bool CMiscMenue::changeNotify(const neutrino_locale_t OptionName, void * /*data*
ret = menu_return::RETURN_REPAINT;
}
#endif
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_TMDB_API_KEY))
{
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 = 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 = 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;
}