mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
CWebTVSetup: fix menu handling
- width enlarged - fix exit handling - fix memory of item position - adapted caption
This commit is contained in:
@@ -30,11 +30,12 @@
|
|||||||
#include <driver/screen_max.h>
|
#include <driver/screen_max.h>
|
||||||
#include <driver/framebuffer.h>
|
#include <driver/framebuffer.h>
|
||||||
#include <gui/widget/hintbox.h>
|
#include <gui/widget/hintbox.h>
|
||||||
|
#include <neutrino_menue.h>
|
||||||
#include "webtv_setup.h"
|
#include "webtv_setup.h"
|
||||||
|
|
||||||
CWebTVSetup::CWebTVSetup()
|
CWebTVSetup::CWebTVSetup()
|
||||||
{
|
{
|
||||||
width = w_max (40, 10);
|
width = w_max (55, 10);
|
||||||
selected = -1;
|
selected = -1;
|
||||||
item_offset = 0;
|
item_offset = 0;
|
||||||
changed = false;
|
changed = false;
|
||||||
@@ -91,25 +92,26 @@ int CWebTVSetup::exec(CMenuTarget* parent, const std::string & actionKey)
|
|||||||
if(parent)
|
if(parent)
|
||||||
parent->hide();
|
parent->hide();
|
||||||
|
|
||||||
Show();
|
res = Show();
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWebTVSetup::Show()
|
int CWebTVSetup::Show()
|
||||||
{
|
{
|
||||||
item_offset = 0;
|
item_offset = 0;
|
||||||
|
|
||||||
m = new CMenuWidget(LOCALE_WEBTV_HEAD, NEUTRINO_ICON_MOVIEPLAYER, width);
|
m = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_MOVIEPLAYER, width, MN_WIDGET_ID_WEBTVSETUP);
|
||||||
m->addKey(CRCInput::RC_red, this, "d");
|
m->addKey(CRCInput::RC_red, this, "d");
|
||||||
m->addKey(CRCInput::RC_green, this, "a");
|
m->addKey(CRCInput::RC_green, this, "a");
|
||||||
m->setSelected(selected);
|
|
||||||
m->addIntroItems(LOCALE_EPGPLUS_OPTIONS, LOCALE_WEBTV_XML);
|
m->addIntroItems(LOCALE_WEBTV_HEAD, LOCALE_WEBTV_XML);
|
||||||
item_offset = m->getItemsCount();
|
item_offset = m->getItemsCount();
|
||||||
for (std::list<std::string>::iterator it = g_settings.webtv_xml.begin(); it != g_settings.webtv_xml.end(); ++it)
|
for (std::list<std::string>::iterator it = g_settings.webtv_xml.begin(); it != g_settings.webtv_xml.end(); ++it)
|
||||||
m->addItem(new CMenuForwarder(*it, true, NULL, this, "c"));
|
m->addItem(new CMenuForwarder(*it, true, NULL, this, "c"));
|
||||||
m->setFooter(CWebTVSetupFooterButtons, CWebTVSetupFooterButtonCount);
|
m->setFooter(CWebTVSetupFooterButtons, CWebTVSetupFooterButtonCount); //Why we need here an extra buttonbar?
|
||||||
m->exec(NULL, "");
|
|
||||||
|
int res = m->exec(NULL, "");
|
||||||
m->hide();
|
m->hide();
|
||||||
if (changed) {
|
if (changed) {
|
||||||
g_settings.webtv_xml.clear();
|
g_settings.webtv_xml.clear();
|
||||||
@@ -121,7 +123,9 @@ void CWebTVSetup::Show()
|
|||||||
g_Zapit->reinitChannels();
|
g_Zapit->reinitChannels();
|
||||||
changed = false;
|
changed = false;
|
||||||
}
|
}
|
||||||
selected = m->getSelected();
|
|
||||||
delete m;
|
delete m;
|
||||||
|
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
// vim:ts=4
|
// vim:ts=4
|
||||||
|
@@ -38,6 +38,6 @@ class CWebTVSetup : public CMenuTarget
|
|||||||
public:
|
public:
|
||||||
CWebTVSetup();
|
CWebTVSetup();
|
||||||
int exec(CMenuTarget* parent, const std::string & actionKey);
|
int exec(CMenuTarget* parent, const std::string & actionKey);
|
||||||
void Show();
|
int Show();
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@@ -108,6 +108,9 @@ enum MN_WIDGET_ID
|
|||||||
|
|
||||||
//audio setup
|
//audio setup
|
||||||
MN_WIDGET_ID_AUDIOSETUP,
|
MN_WIDGET_ID_AUDIOSETUP,
|
||||||
|
|
||||||
|
//web tv setup
|
||||||
|
MN_WIDGET_ID_WEBTVSETUP,
|
||||||
|
|
||||||
//misc settings
|
//misc settings
|
||||||
MN_WIDGET_ID_MISCSETUP,
|
MN_WIDGET_ID_MISCSETUP,
|
||||||
|
Reference in New Issue
Block a user