diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 35cea2caf..14d9bd9c4 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -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 diff --git a/data/locale/english.locale b/data/locale/english.locale index 88089a430..e60ac6f1b 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -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 diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index fbe93cb39..6014c0357 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -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 */ diff --git a/src/gui/parentallock_setup.cpp b/src/gui/parentallock_setup.cpp index 0f5becfb2..ca4ab7359 100644 --- a/src/gui/parentallock_setup.cpp +++ b/src/gui/parentallock_setup.cpp @@ -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); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index bbe465449..5cc497dee 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -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 diff --git a/src/system/locals.h b/src/system/locals.h index 2ed66a79b..18b7c4251 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -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, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index fb39b23f6..bf540c233 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -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", diff --git a/src/system/settings.h b/src/system/settings.h index ab61c8e8c..69da00d5b 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -568,6 +568,7 @@ struct SNeutrinoSettings int parentallock_prompt; int parentallock_lockage; int parentallock_defaultlocked; + int parentallock_zaptime; std::string parentallock_pincode;