diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 5e9d13d8d..2a78630af 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -985,9 +985,12 @@ options.off aus options.on ein options.on.without_messages ohne Msg options.serial seriell +parentallock.bouquetmode Bouquets sind standardmässig parentallock.changepin PIN-Code festlegen parentallock.changepin_hint1 Geben Sie hier Ihren neuen PIN-Code ein! parentallock.changetolocked Bei vorgeperrten Bouquets +parentallock.defaultlocked gesperrt +parentallock.defaultunlocked nicht gesperrt parentallock.head Jugendschutz PIN parentallock.lockage Sendungen parentallock.lockage12 ab 12 Jahren sperren diff --git a/data/locale/english.locale b/data/locale/english.locale index b08906d77..04c103d8b 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -985,9 +985,12 @@ options.off off options.on on options.on.without_messages Without msg options.serial serial +parentallock.bouquetmode Bouquets are default parentallock.changepin change PIN code parentallock.changepin_hint1 Enter your new youth protection pin code here! parentallock.changetolocked on locked bouquets +parentallock.defaultlocked locked +parentallock.defaultunlocked unlocked parentallock.head Enter Parental Lock PIN code parentallock.lockage lock program parentallock.lockage12 from 12 years up diff --git a/src/daemonc/remotecontrol.cpp b/src/daemonc/remotecontrol.cpp index 5e38188ec..1b5878b89 100644 --- a/src/daemonc/remotecontrol.cpp +++ b/src/daemonc/remotecontrol.cpp @@ -149,7 +149,7 @@ int CRemoteControl::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data is_video_started = true; if (channel) { current_channel_name = channel->getName(); - if (channel->bAlwaysLocked) + if (channel->bAlwaysLocked != g_settings.parentallock_defaultlocked) stopvideo(); } CVFD::getInstance()->showServicename(current_channel_name); // UTF-8 diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index e22c3ef77..8ec03bfd5 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -106,7 +106,7 @@ void CBEBouquetWidget::paintItem(int pos) if ((current == selected) && (state == beMoving)) frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + 10, ypos, iheight); - if ((*Bouquets)[current]->bLocked) + if ((*Bouquets)[current]->bLocked != g_settings.parentallock_defaultlocked) frameBuffer->paintIcon(NEUTRINO_ICON_LOCK, x + 10, ypos, iheight); if ((*Bouquets)[current]->bHidden) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 9cf2048a0..a6f38d16f 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1191,7 +1191,7 @@ void CChannelList::zapTo(int pos, bool /* forceStoreToLastChannels */) tuned = pos; CVFD::getInstance()->setEPGTitle(""); CVFD::getInstance()->showServicename(chan->name); - g_RemoteControl->zapTo_ChannelID(chan->channel_id, chan->name, !chan->bAlwaysLocked); // UTF-8 + g_RemoteControl->zapTo_ChannelID(chan->channel_id, chan->name, (chan->bAlwaysLocked == g_settings.parentallock_defaultlocked)); // TODO check is it possible bouquetList is NULL ? if (bouquetList != NULL) { CNeutrinoApp::getInstance()->channelList->adjustToChannelID(chan->channel_id); @@ -1231,7 +1231,7 @@ void CChannelList::NewZap(t_channel_id channel_id) CVFD::getInstance()->setEPGTitle(""); CVFD::getInstance()->showServicename(chan->name); selected_chid = chan->getChannelID(); - g_RemoteControl->zapTo_ChannelID(chan->getChannelID(), chan->name, !chan->bAlwaysLocked); + g_RemoteControl->zapTo_ChannelID(selected_chid, chan->name, (chan->bAlwaysLocked == g_settings.parentallock_defaultlocked)); /* remove recordModeActive from infobar */ if(g_settings.auto_timeshift && !CNeutrinoApp::getInstance()->recordingstatus) { g_InfoViewer->handleMsg(NeutrinoMessages::EVT_RECORDMODE, 0); diff --git a/src/gui/parentallock_setup.cpp b/src/gui/parentallock_setup.cpp index c624c048f..06d5d141a 100644 --- a/src/gui/parentallock_setup.cpp +++ b/src/gui/parentallock_setup.cpp @@ -87,6 +87,14 @@ const CMenuOptionChooser::keyval PARENTALLOCK_LOCKAGE_OPTIONS[PARENTALLOCK_LOCKA { 16, LOCALE_PARENTALLOCK_LOCKAGE16 }, { 18, LOCALE_PARENTALLOCK_LOCKAGE18 } }; + +#define PARENTALLOCK_DEFAULTLOCKED_OPTION_COUNT 2 +const CMenuOptionChooser::keyval PARENTALLOCK_DEFAULTLOCKED_OPTIONS[PARENTALLOCK_DEFAULTLOCKED_OPTION_COUNT] = +{ + { false, LOCALE_PARENTALLOCK_DEFAULTUNLOCKED }, + { true, LOCALE_PARENTALLOCK_DEFAULTLOCKED } +}; + extern bool parentallocked; void CParentalSetup::showParentalSetup() { @@ -103,6 +111,8 @@ void CParentalSetup::showParentalSetup() plock->addItem(new CMenuOptionChooser(LOCALE_PARENTALLOCK_LOCKAGE, &g_settings.parentallock_lockage, PARENTALLOCK_LOCKAGE_OPTIONS, PARENTALLOCK_LOCKAGE_OPTION_COUNT, !parentallocked)); + plock->addItem(new CMenuOptionChooser(LOCALE_PARENTALLOCK_BOUQUETMODE, &g_settings.parentallock_defaultlocked, PARENTALLOCK_DEFAULTLOCKED_OPTIONS, PARENTALLOCK_DEFAULTLOCKED_OPTION_COUNT, !parentallocked)); + CPINChangeWidget pinChangeWidget(LOCALE_PARENTALLOCK_CHANGEPIN, g_settings.parentallock_pincode, 4, LOCALE_PARENTALLOCK_CHANGEPIN_HINT1); plock->addItem( new CMenuForwarder(LOCALE_PARENTALLOCK_CHANGEPIN, true, g_settings.parentallock_pincode, &pinChangeWidget)); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index d86760b48..77097a610 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -670,6 +670,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.parentallock_prompt = 3; g_settings.parentallock_lockage = 18; } + g_settings.parentallock_defaultlocked = configfile.getInt32("parentallock_defaultlocked", 0); strcpy( g_settings.parentallock_pincode, configfile.getString( "parentallock_pincode", "0000" ).c_str() ); for (int i = 0; i < SNeutrinoSettings::TIMING_SETTING_COUNT; i++) @@ -1067,6 +1068,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_defaultlocked", g_settings.parentallock_defaultlocked); //timing for (int i = 0; i < SNeutrinoSettings::TIMING_SETTING_COUNT; i++) diff --git a/src/system/locals.h b/src/system/locals.h index aac979f95..706a9fca8 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1012,9 +1012,12 @@ typedef enum LOCALE_OPTIONS_ON, LOCALE_OPTIONS_ON_WITHOUT_MESSAGES, LOCALE_OPTIONS_SERIAL, + LOCALE_PARENTALLOCK_BOUQUETMODE, LOCALE_PARENTALLOCK_CHANGEPIN, LOCALE_PARENTALLOCK_CHANGEPIN_HINT1, LOCALE_PARENTALLOCK_CHANGETOLOCKED, + LOCALE_PARENTALLOCK_DEFAULTLOCKED, + LOCALE_PARENTALLOCK_DEFAULTUNLOCKED, LOCALE_PARENTALLOCK_HEAD, LOCALE_PARENTALLOCK_LOCKAGE, LOCALE_PARENTALLOCK_LOCKAGE12, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index a642f9ea1..9ad56f2da 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1012,9 +1012,12 @@ const char * locale_real_names[] = "options.on", "options.on.without_messages", "options.serial", + "parentallock.bouquetmode", "parentallock.changepin", "parentallock.changepin_hint1", "parentallock.changetolocked", + "parentallock.defaultlocked", + "parentallock.defaultunlocked", "parentallock.head", "parentallock.lockage", "parentallock.lockage12", diff --git a/src/system/settings.h b/src/system/settings.h index 5acde9f60..c34fe9f11 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -450,6 +450,7 @@ struct SNeutrinoSettings // parentallock int parentallock_prompt; int parentallock_lockage; + int parentallock_defaultlocked; char parentallock_pincode[5];