webtv-setup: add possibility to enter webtv-file manually

Origin commit data
------------------
Branch: ni/coolstream
Commit: 235ee5c479
Author: vanhofen <vanhofen@gmx.de>
Date: 2018-09-21 (Fri, 21 Sep 2018)

Origin message was:
------------------
- webtv-setup: add possibility to enter webtv-file manually

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

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2018-09-21 00:05:28 +02:00
parent c908a3415b
commit 3c65a3b057
5 changed files with 33 additions and 11 deletions

View File

@@ -31,6 +31,7 @@
#include <driver/framebuffer.h>
#include <gui/movieplayer.h>
#include <gui/widget/hintbox.h>
#include <gui/widget/keyboard_input.h>
#include <zapit/zapit.h>
#include <neutrino_menue.h>
#include "webtv_setup.h"
@@ -60,11 +61,13 @@ const CMenuOptionChooser::keyval_ext LIVESTREAM_RESOLUTION_OPTIONS[] =
};
#define LIVESTREAM_RESOLUTION_OPTION_COUNT (sizeof(LIVESTREAM_RESOLUTION_OPTIONS)/sizeof(CMenuOptionChooser::keyval_ext))
#define CWebTVSetupFooterButtonCount 3 //NI
static const struct button_label CWebTVSetupFooterButtons[CWebTVSetupFooterButtonCount] = {
#define CWebTVSetupFooterButtonCount 4
static const struct button_label CWebTVSetupFooterButtons[CWebTVSetupFooterButtonCount] =
{
{ NEUTRINO_ICON_BUTTON_RED, LOCALE_WEBTV_XML_DEL },
{ NEUTRINO_ICON_BUTTON_GREEN, LOCALE_WEBTV_XML_ADD },
{ NEUTRINO_ICON_BUTTON_BLUE, LOCALE_WEBTV_XML_RELOAD } //NI
{ NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_WEBTV_XML_ENTER },
{ NEUTRINO_ICON_BUTTON_BLUE, LOCALE_WEBTV_XML_RELOAD }
};
int CWebTVSetup::exec(CMenuTarget* parent, const std::string & actionKey)
@@ -115,7 +118,21 @@ int CWebTVSetup::exec(CMenuTarget* parent, const std::string & actionKey)
}
return res;
}
//NI
if (actionKey == "e" /* enter */) {
std::string tpl = "http://xxx.xxx.xxx.xxx/control/xmltv.m3u";
std::string entry = tpl;
CKeyboardInput *e = new CKeyboardInput(LOCALE_WEBTV_XML_ENTER, &entry, 50);
e->exec(this, "");
delete e;
if (entry.compare(tpl) != 0)
{
m->addItem(new CMenuForwarder(entry, true, NULL, this, "c"));
changed = true;
}
return res;
}
if(actionKey == "r" /* reload */) {
changed = true;
return menu_return::RETURN_EXIT_ALL;
@@ -141,7 +158,8 @@ int CWebTVSetup::Show()
m = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_STREAMING, width, MN_WIDGET_ID_WEBTVSETUP);
m->addKey(CRCInput::RC_red, this, "d");
m->addKey(CRCInput::RC_green, this, "a");
m->addKey(CRCInput::RC_blue, this, "r"); //NI
m->addKey(CRCInput::RC_yellow, this, "e");
m->addKey(CRCInput::RC_blue, this, "r");
m->addIntroItems(LOCALE_WEBTV_HEAD, LOCALE_LIVESTREAM_HEAD);