mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
- webtv-setup: just code reformatting (using astyle)
Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -74,9 +74,11 @@ int CWebTVSetup::exec(CMenuTarget* parent, const std::string & actionKey)
|
|||||||
{
|
{
|
||||||
int res = menu_return::RETURN_REPAINT;
|
int res = menu_return::RETURN_REPAINT;
|
||||||
|
|
||||||
if(actionKey == "d" /* delete */) {
|
if (actionKey == "d" /* delete */)
|
||||||
|
{
|
||||||
selected = m->getSelected();
|
selected = m->getSelected();
|
||||||
if (selected >= item_offset) {
|
if (selected >= item_offset)
|
||||||
|
{
|
||||||
m->removeItem(selected);
|
m->removeItem(selected);
|
||||||
m->hide();
|
m->hide();
|
||||||
selected = m->getSelected();
|
selected = m->getSelected();
|
||||||
@@ -84,7 +86,8 @@ int CWebTVSetup::exec(CMenuTarget* parent, const std::string & actionKey)
|
|||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
if(actionKey == "c" /* change */) {
|
if (actionKey == "c" /* change */)
|
||||||
|
{
|
||||||
CFileBrowser fileBrowser;
|
CFileBrowser fileBrowser;
|
||||||
CFileFilter fileFilter;
|
CFileFilter fileFilter;
|
||||||
fileFilter.addFilter("xml");
|
fileFilter.addFilter("xml");
|
||||||
@@ -96,21 +99,24 @@ int CWebTVSetup::exec(CMenuTarget* parent, const std::string & actionKey)
|
|||||||
CMenuForwarder *f = static_cast<CMenuForwarder *>(item);
|
CMenuForwarder *f = static_cast<CMenuForwarder *>(item);
|
||||||
std::string dirname(f->getName());
|
std::string dirname(f->getName());
|
||||||
dirname = dirname.substr(0, dirname.rfind('/'));
|
dirname = dirname.substr(0, dirname.rfind('/'));
|
||||||
if (fileBrowser.exec(dirname.c_str())) {
|
if (fileBrowser.exec(dirname.c_str()))
|
||||||
|
{
|
||||||
f->setName(fileBrowser.getSelectedFile()->Name);
|
f->setName(fileBrowser.getSelectedFile()->Name);
|
||||||
g_settings.last_webtv_dir = dirname;
|
g_settings.last_webtv_dir = dirname;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
if(actionKey == "a" /* add */) {
|
if (actionKey == "a" /* add */)
|
||||||
|
{
|
||||||
CFileBrowser fileBrowser;
|
CFileBrowser fileBrowser;
|
||||||
CFileFilter fileFilter;
|
CFileFilter fileFilter;
|
||||||
fileFilter.addFilter("xml");
|
fileFilter.addFilter("xml");
|
||||||
fileFilter.addFilter("tv");
|
fileFilter.addFilter("tv");
|
||||||
fileFilter.addFilter("m3u");
|
fileFilter.addFilter("m3u");
|
||||||
fileBrowser.Filter = &fileFilter;
|
fileBrowser.Filter = &fileFilter;
|
||||||
if (fileBrowser.exec(g_settings.last_webtv_dir.c_str()) == true) {
|
if (fileBrowser.exec(g_settings.last_webtv_dir.c_str()) == true)
|
||||||
|
{
|
||||||
std::string s = fileBrowser.getSelectedFile()->Name;
|
std::string s = fileBrowser.getSelectedFile()->Name;
|
||||||
m->addItem(new CMenuForwarder(s, true, NULL, this, "c"));
|
m->addItem(new CMenuForwarder(s, true, NULL, this, "c"));
|
||||||
g_settings.last_webtv_dir = s.substr(0, s.rfind('/')).c_str();
|
g_settings.last_webtv_dir = s.substr(0, s.rfind('/')).c_str();
|
||||||
@@ -118,7 +124,8 @@ int CWebTVSetup::exec(CMenuTarget* parent, const std::string & actionKey)
|
|||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
if (actionKey == "e" /* enter */) {
|
if (actionKey == "e" /* enter */)
|
||||||
|
{
|
||||||
std::string tpl = "http://xxx.xxx.xxx.xxx/control/xmltv.m3u";
|
std::string tpl = "http://xxx.xxx.xxx.xxx/control/xmltv.m3u";
|
||||||
std::string entry = tpl;
|
std::string entry = tpl;
|
||||||
|
|
||||||
@@ -133,11 +140,13 @@ int CWebTVSetup::exec(CMenuTarget* parent, const std::string & actionKey)
|
|||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
if(actionKey == "r" /* reload */) {
|
if (actionKey == "r" /* reload */)
|
||||||
|
{
|
||||||
changed = true;
|
changed = true;
|
||||||
return menu_return::RETURN_EXIT_ALL;
|
return menu_return::RETURN_EXIT_ALL;
|
||||||
}
|
}
|
||||||
if (actionKey == "script_path") {
|
if (actionKey == "script_path")
|
||||||
|
{
|
||||||
const char *action_str = "ScriptPath";
|
const char *action_str = "ScriptPath";
|
||||||
chooserDir(g_settings.livestreamScriptPath, false, action_str);
|
chooserDir(g_settings.livestreamScriptPath, false, action_str);
|
||||||
return res;
|
return res;
|
||||||
@@ -349,9 +358,11 @@ int CWebTVResolution::Show()
|
|||||||
|
|
||||||
bool _mode_webtv = (CNeutrinoApp::getInstance()->getMode() == NeutrinoModes::mode_webtv) &&
|
bool _mode_webtv = (CNeutrinoApp::getInstance()->getMode() == NeutrinoModes::mode_webtv) &&
|
||||||
(!CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty());
|
(!CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty());
|
||||||
if (oldRes != g_settings.livestreamResolution && _mode_webtv) {
|
if (oldRes != g_settings.livestreamResolution && _mode_webtv)
|
||||||
|
{
|
||||||
CZapitChannel *cc = CZapit::getInstance()->GetCurrentChannel();
|
CZapitChannel *cc = CZapit::getInstance()->GetCurrentChannel();
|
||||||
if (cc && IS_WEBCHAN(cc->getChannelID())) {
|
if (cc && IS_WEBCHAN(cc->getChannelID()))
|
||||||
|
{
|
||||||
CMoviePlayerGui::getInstance().stopPlayBack();
|
CMoviePlayerGui::getInstance().stopPlayBack();
|
||||||
CMoviePlayerGui::getInstance().PlayBackgroundStart(cc->getUrl(), cc->getName(), cc->getChannelID(), cc->getScriptName());
|
CMoviePlayerGui::getInstance().PlayBackgroundStart(cc->getUrl(), cc->getName(), cc->getChannelID(), cc->getScriptName());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user