CWebTVSetup: fix menu handling

- width enlarged
- fix exit handling
- fix memory of item position
- adapted caption


Origin commit data
------------------
Commit: 90a29c598d
Author: Thilo Graf <dbt@novatux.de>
Date: 2014-09-11 (Thu, 11 Sep 2014)
This commit is contained in:
2014-09-11 22:55:17 +02:00
committed by vanhofen
parent 78bd385f78
commit bfd4b17307
3 changed files with 17 additions and 10 deletions

View File

@@ -30,11 +30,12 @@
#include <driver/screen_max.h>
#include <driver/framebuffer.h>
#include <gui/widget/hintbox.h>
#include <neutrino_menue.h>
#include "webtv_setup.h"
CWebTVSetup::CWebTVSetup()
{
width = w_max (40, 10);
width = w_max (55, 10);
selected = -1;
item_offset = 0;
changed = false;
@@ -91,25 +92,26 @@ int CWebTVSetup::exec(CMenuTarget* parent, const std::string & actionKey)
if(parent)
parent->hide();
Show();
res = Show();
return res;
}
void CWebTVSetup::Show()
int CWebTVSetup::Show()
{
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_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();
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->setFooter(CWebTVSetupFooterButtons, CWebTVSetupFooterButtonCount);
m->exec(NULL, "");
m->setFooter(CWebTVSetupFooterButtons, CWebTVSetupFooterButtonCount); //Why we need here an extra buttonbar?
int res = m->exec(NULL, "");
m->hide();
if (changed) {
g_settings.webtv_xml.clear();
@@ -121,7 +123,9 @@ void CWebTVSetup::Show()
g_Zapit->reinitChannels();
changed = false;
}
selected = m->getSelected();
delete m;
return res;
}
// vim:ts=4

View File

@@ -38,6 +38,6 @@ class CWebTVSetup : public CMenuTarget
public:
CWebTVSetup();
int exec(CMenuTarget* parent, const std::string & actionKey);
void Show();
int Show();
};
#endif

View File

@@ -108,6 +108,9 @@ enum MN_WIDGET_ID
//audio setup
MN_WIDGET_ID_AUDIOSETUP,
//web tv setup
MN_WIDGET_ID_WEBTVSETUP,
//misc settings
MN_WIDGET_ID_MISCSETUP,