From f8b626250a18efedc60ff37f9fb416d8c1f34fed Mon Sep 17 00:00:00 2001 From: thilo Date: Sun, 1 Jan 2012 21:43:12 +0000 Subject: [PATCH] *neutrino pin check: add possibility to manipulate head title and hint text git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2032 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/widget/menue.cpp | 9 +++------ src/gui/widget/menue.h | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 0ef851a69..62fe481a6 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1728,11 +1728,10 @@ int CMenuSeparator::paint(bool selected) bool CPINProtection::check() { char cPIN[5]; - neutrino_locale_t hint = NONEXISTANT_LOCALE; do { cPIN[0] = 0; - CPINInput* PINInput = new CPINInput(LOCALE_PINPROTECTION_HEAD, cPIN, 4, hint); + CPINInput* PINInput = new CPINInput(title, cPIN, 4, hint); PINInput->exec( getParent(), ""); delete PINInput; hint = LOCALE_PINPROTECTION_WRONGCODE; @@ -1743,20 +1742,18 @@ bool CPINProtection::check() bool CZapProtection::check() { - int res; char cPIN[5]; - neutrino_locale_t hint2 = NONEXISTANT_LOCALE; do { cPIN[0] = 0; - CPLPINInput* PINInput = new CPLPINInput(LOCALE_PARENTALLOCK_HEAD, cPIN, 4, hint2, fsk); + CPLPINInput* PINInput = new CPLPINInput(title, cPIN, 4, hint, fsk); res = PINInput->exec(getParent(), ""); delete PINInput; - hint2 = LOCALE_PINPROTECTION_WRONGCODE; + hint = LOCALE_PINPROTECTION_WRONGCODE; } while ( (strncmp(cPIN,validPIN,4) != 0) && (cPIN[0] != 0) && ( res == menu_return::RETURN_REPAINT ) && diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index b91181960..c8b9228a7 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -479,9 +479,17 @@ class CPINProtection char* validPIN; bool check(); virtual CMenuTarget* getParent() = 0; + neutrino_locale_t title, hint; public: - CPINProtection( char* validpin){ validPIN = validpin;}; + CPINProtection( char* validpin) + { + validPIN = validpin; + hint = NONEXISTANT_LOCALE; + title = LOCALE_PINPROTECTION_HEAD; + }; virtual ~CPINProtection(){} + virtual void setTitle(neutrino_locale_t Title){title = Title;}; + virtual void setHint(neutrino_locale_t Hint){ hint = Hint;}; }; class CZapProtection : public CPINProtection @@ -491,7 +499,11 @@ class CZapProtection : public CPINProtection public: int fsk; - CZapProtection( char* validpin, int FSK ) : CPINProtection(validpin){ fsk= FSK; }; + CZapProtection( char* validpin, int FSK ) : CPINProtection(validpin) + { + fsk = FSK; + title = LOCALE_PARENTALLOCK_HEAD; + }; bool check(); };