diff --git a/src/gui/zapit_setup.cpp b/src/gui/zapit_setup.cpp index 6a68b0704..d196e7be0 100644 --- a/src/gui/zapit_setup.cpp +++ b/src/gui/zapit_setup.cpp @@ -39,8 +39,6 @@ CZapitSetup::CZapitSetup() { - zapit1 = NULL; - zapit2 = NULL; width = w_max (40, 10); //% } @@ -67,38 +65,32 @@ void CZapitSetup::showMenu() //menue init CMenuWidget *zapit = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_ZAPIT); zapit->addIntroItems(LOCALE_ZAPITSETUP_INFO); - + COnOffNotifier* miscZapitNotifier = new COnOffNotifier(0); //zapit - CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_ZAPITSETUP_LAST_USE, &g_settings.uselastchannel, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); + CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_ZAPITSETUP_LAST_USE, &g_settings.uselastchannel, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, miscZapitNotifier, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); mc->setHint("", LOCALE_MENU_HINT_LAST_USE); - zapit->addItem(mc); + CSelectChannelWidget select; - zapit->addItem(GenericMenuSeparatorLine); - - zapit1 = new CMenuForwarder(LOCALE_ZAPITSETUP_LAST_TV , !g_settings.uselastchannel, g_settings.StartChannelTV, &select, "tv", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN ); + CMenuForwarder *zapit1 = new CMenuForwarder(LOCALE_ZAPITSETUP_LAST_TV , g_settings.uselastchannel, g_settings.StartChannelTV, &select, "tv", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN ); zapit1->setHint("", LOCALE_MENU_HINT_LAST_TV); - zapit->addItem(zapit1); - zapit2 = new CMenuForwarder(LOCALE_ZAPITSETUP_LAST_RADIO , !g_settings.uselastchannel, g_settings.StartChannelRadio, &select, "radio", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW ); + CMenuForwarder *zapit2 = new CMenuForwarder(LOCALE_ZAPITSETUP_LAST_RADIO , g_settings.uselastchannel, g_settings.StartChannelRadio, &select, "radio", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW ); zapit2->setHint("", LOCALE_MENU_HINT_LAST_RADIO); + + miscZapitNotifier->addItem(zapit1); + miscZapitNotifier->addItem(zapit2); + + zapit->addItem(mc); + zapit->addItem(GenericMenuSeparatorLine); + zapit->addItem(zapit1); zapit->addItem(zapit2); zapit->exec(NULL, ""); + delete miscZapitNotifier; delete zapit; } -bool CZapitSetup::changeNotify(const neutrino_locale_t OptionName, void *) -{ - if (ARE_LOCALES_EQUAL(OptionName, LOCALE_ZAPITSETUP_LAST_USE)) - { - zapit1->setActive(!g_settings.uselastchannel); - zapit2->setActive(!g_settings.uselastchannel); - } - - return false; -} - //select menu CSelectChannelWidget::CSelectChannelWidget() { diff --git a/src/gui/zapit_setup.h b/src/gui/zapit_setup.h index 8e8c7f3db..95636611e 100644 --- a/src/gui/zapit_setup.h +++ b/src/gui/zapit_setup.h @@ -31,10 +31,9 @@ #include #include -class CZapitSetup : public CMenuTarget, CChangeObserver +class CZapitSetup : public CMenuTarget { private: - CMenuForwarder *zapit1, *zapit2; int width; @@ -44,7 +43,6 @@ public: CZapitSetup(); ~CZapitSetup(); int exec(CMenuTarget* parent, const std::string & actionKey); - virtual bool changeNotify(const neutrino_locale_t , void *); }; class CSelectChannelWidget : public CMenuWidget