parental protection: make zaptime configurable

Conflicts:
	data/locale/english.locale
	src/gui/channellist.cpp
	src/gui/parentallock_setup.cpp
	src/neutrino.cpp


Origin commit data
------------------
Branch: ni/coolstream
Commit: a12f4c0274
Author: martii <m4rtii@gmx.de>
Date: 2013-06-23 (Sun, 23 Jun 2013)



------------------
This commit was generated by Migit
This commit is contained in:
martii
2013-06-23 08:40:35 +02:00
committed by [CST] Focus
parent 6c1fe793fc
commit 2df91f2e87
8 changed files with 12 additions and 7 deletions

View File

@@ -1772,6 +1772,7 @@ parentallock.never Nie
parentallock.onsignal Bei gesendeter Vorsperre
parentallock.parentallock Jugendschutz
parentallock.prompt PIN-Eingabe
parentallock.zaptime Zap-Zeit für vorgesperrte Bouquets (Minuten)
personalize.access Zugangsoptionen
personalize.apply_settings Änderungen übernehmen?
personalize.button_auto Auto

View File

@@ -1772,6 +1772,7 @@ parentallock.never never
parentallock.onsignal on broadcasted lock
parentallock.parentallock Parental lock
parentallock.prompt prompt for PIN
parentallock.zaptime Zap time for locked bouquets (minutes)
personalize.access Access options
personalize.apply_settings Apply changes?
personalize.button_auto auto

View File

@@ -1010,8 +1010,8 @@ int CChannelList::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data)
if (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED && data < 0x100)
goto out;
/* if a pre-locked channel is inside the zap time, open it. Hardcoded to one hour for now. */
if (data >= 0x100 && (*chanlist)[selected]->last_unlocked_time + 3600 > time_monotonic())
/* if a pre-locked channel is inside the zap time, open it. */
if (data >= 0x100 && (*chanlist)[selected]->last_unlocked_time + g_settings.parentallock_zaptime * 60 > time_monotonic())
goto out;
/* OK, let's ask for a PIN */

View File

@@ -136,6 +136,7 @@ int CParentalSetup::showParentalSetup()
else
mc = new CMenuOptionChooser(LOCALE_PARENTALLOCK_BOUQUETMODE, &g_settings.parentallock_defaultlocked, PARENTALLOCK_DEFAULTLOCKED_OPTIONS, PARENTALLOCK_DEFAULTLOCKED_OPTION_COUNT, !parentallocked);
plock->addItem(mc);
plock->addItem(new CMenuOptionNumberChooser(LOCALE_PARENTALLOCK_ZAPTIME, (int *)&g_settings.parentallock_zaptime, !parentallocked, 0, 10000));
CPINChangeWidget pinChangeWidget(LOCALE_PARENTALLOCK_CHANGEPIN, &g_settings.parentallock_pincode, 4, LOCALE_PARENTALLOCK_CHANGEPIN_HINT1);
mf = new CMenuForwarder(LOCALE_PARENTALLOCK_CHANGEPIN, true, g_settings.parentallock_pincode, &pinChangeWidget);

View File

@@ -333,11 +333,8 @@ int CNeutrinoApp::loadSetup(const char * fname)
configfile.clear();
}
}
std::ifstream checkParentallocked(NEUTRINO_PARENTALLOCKED_FILE);
if(checkParentallocked) {
parentallocked = true;
checkParentallocked.close();
}
parentallocked = !access(NEUTRINO_PARENTALLOCKED_FILE, R_OK);
g_settings.easymenu = configfile.getInt32("easymenu", 0);
g_settings.softupdate_autocheck = configfile.getBool("softupdate_autocheck" , false);
/* if file present and no config file found, force easy mode */
@@ -749,6 +746,7 @@ int CNeutrinoApp::loadSetup(const char * fname)
}
g_settings.parentallock_defaultlocked = configfile.getInt32("parentallock_defaultlocked", 0);
g_settings.parentallock_pincode = configfile.getString( "parentallock_pincode", "0000" );
g_settings.parentallock_zaptime = configfile.getInt32( "parentallock_zaptime", 60 );
for (int i = 0; i < SNeutrinoSettings::TIMING_SETTING_COUNT; i++)
g_settings.timing[i] = configfile.getInt32(locale_real_names[timing_setting[i].name], timing_setting[i].default_timing);
@@ -1194,6 +1192,7 @@ void CNeutrinoApp::saveSetup(const char * fname)
configfile.setInt32( "parentallock_prompt", g_settings.parentallock_prompt );
configfile.setInt32( "parentallock_lockage", g_settings.parentallock_lockage );
configfile.setString( "parentallock_pincode", g_settings.parentallock_pincode );
configfile.setInt32("parentallock_zaptime", g_settings.parentallock_zaptime);
configfile.setInt32("parentallock_defaultlocked", g_settings.parentallock_defaultlocked);
//timing

View File

@@ -1799,6 +1799,7 @@ typedef enum
LOCALE_PARENTALLOCK_ONSIGNAL,
LOCALE_PARENTALLOCK_PARENTALLOCK,
LOCALE_PARENTALLOCK_PROMPT,
LOCALE_PARENTALLOCK_ZAPTIME,
LOCALE_PERSONALIZE_ACCESS,
LOCALE_PERSONALIZE_APPLY_SETTINGS,
LOCALE_PERSONALIZE_BUTTON_AUTO,

View File

@@ -1799,6 +1799,7 @@ const char * locale_real_names[] =
"parentallock.onsignal",
"parentallock.parentallock",
"parentallock.prompt",
"parentallock.zaptime",
"personalize.access",
"personalize.apply_settings",
"personalize.button_auto",

View File

@@ -568,6 +568,7 @@ struct SNeutrinoSettings
int parentallock_prompt;
int parentallock_lockage;
int parentallock_defaultlocked;
int parentallock_zaptime;
std::string parentallock_pincode;