diff --git a/src/gui/parentallock_setup.cpp b/src/gui/parentallock_setup.cpp index 8349853bc..c624c048f 100644 --- a/src/gui/parentallock_setup.cpp +++ b/src/gui/parentallock_setup.cpp @@ -35,23 +35,14 @@ #include "gui/parentallock_setup.h" -#include -#include -#include - #include #include -#include #include - -CParentalSetup::CParentalSetup() -{ - width = w_max (40, 10); //% -} +//constructor is definied in parentallock_setup.h CParentalSetup::~CParentalSetup() { @@ -64,12 +55,11 @@ int CParentalSetup::exec(CMenuTarget* parent, const std::string &/*actionKey*/) int res = menu_return::RETURN_REPAINT; if (parent) - { parent->hide(); - } - - showParentalSetup(); + if (check()) + showParentalSetup(); + return res; } diff --git a/src/gui/parentallock_setup.h b/src/gui/parentallock_setup.h index a7af5c69e..0c450830c 100644 --- a/src/gui/parentallock_setup.h +++ b/src/gui/parentallock_setup.h @@ -31,19 +31,29 @@ #ifndef __parentallock_setup__ #define __parentallock_setup__ -#include +#include +#include +#include +#include +#include #include -class CParentalSetup : public CMenuTarget +class CParentalSetup : public CMenuTarget, public CPINProtection { private: int width; - void showParentalSetup(); + + protected: + virtual CMenuTarget* getParent() { return( NULL);}; public: - CParentalSetup(); + + CParentalSetup() : CPINProtection(g_settings.parentallock_pincode) + { + width = w_max (40, 10); //% + }; ~CParentalSetup(); int exec(CMenuTarget* parent, const std::string & actionKey); }; diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index d759af64c..bdd0d3a28 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -245,7 +245,7 @@ void CNeutrinoApp::InitMenuSettings() personalize.addItem(MENU_SETTINGS, new CMenuForwarder(LOCALE_MAINSETTINGS_AUDIO, true, NULL, new CAudioSetup()), &g_settings.personalize[SNeutrinoSettings::P_MSET_AUDIO]); // parental lock - personalize.addItem(MENU_SETTINGS, new CLockedMenuForwarder(LOCALE_PARENTALLOCK_PARENTALLOCK, g_settings.parentallock_pincode, g_settings.parentallock_prompt, true, NULL, new CParentalSetup()), &g_settings.personalize[SNeutrinoSettings::P_MSET_YOUTH]); + personalize.addItem(MENU_SETTINGS, new CMenuForwarder(LOCALE_PARENTALLOCK_PARENTALLOCK, true, NULL, new CParentalSetup()), &g_settings.personalize[SNeutrinoSettings::P_MSET_YOUTH]); // network if(networksetup == NULL)