webtv-setup: show autoloaded webtv files as inactive menu items

Origin commit data
------------------
Branch: ni/coolstream
Commit: a365bd6986
Author: vanhofen <vanhofen@gmx.de>
Date: 2018-09-15 (Sat, 15 Sep 2018)

Origin message was:
------------------
- webtv-setup: show autoloaded webtv files as inactive menu items

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2018-09-15 00:16:51 +02:00
parent 19b7c349ac
commit 3f7838b248
2 changed files with 15 additions and 5 deletions

View File

@@ -1115,6 +1115,7 @@ bool CMoviePlayerGui::getLiveUrl(const std::string &url, const std::string &scri
{
std::string _s = g_settings.livestreamScriptPath + "/" + _script;
printf("[%s:%s:%d] script: %s\n", __file__, __func__, __LINE__, _s.c_str());
// try livestreamScripts from webtv autoload directories
if (!file_exists(_s.c_str()))
{
_s = std::string(WEBTVDIR_VAR) + "/" + _script;

View File

@@ -159,7 +159,7 @@ int CWebTVSetup::Show()
m->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_WEBTV_XML));
//NI
// TODO: show/hide autoloaded content when switching g_settings.webtv_xml_auto
char hint_text[1024];
snprintf(hint_text, sizeof(hint_text)-1, g_Locale->getText(LOCALE_MENU_HINT_WEBTV_XML_AUTO), WEBTVDIR, WEBTVDIR_VAR);
CMenuOptionChooser *oc = new CMenuOptionChooser(LOCALE_WEBTV_XML_AUTO, &g_settings.webtv_xml_auto, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this, CRCInput::convertDigitToKey(shortcut++));
@@ -168,11 +168,20 @@ int CWebTVSetup::Show()
m->addItem(GenericMenuSeparator);
item_offset = m->getItemsCount();
// show autoloaded webtv files
for (std::list<std::string>::iterator it = g_settings.webtv_xml.begin(); it != g_settings.webtv_xml.end(); ++it)
{
//NI
if (webtv_xml_autodir((*it)))
continue;
m->addItem(new CMenuForwarder(*it, false, "auto"));
}
if (item_offset < m->getItemsCount())
m->addItem(GenericMenuSeparator);
item_offset = m->getItemsCount();
// show users webtv files
for (std::list<std::string>::iterator it = g_settings.webtv_xml.begin(); it != g_settings.webtv_xml.end(); ++it)
{
if (!webtv_xml_autodir((*it)))
m->addItem(new CMenuForwarder(*it, true, NULL, this, "c"));
}