Make it also possible to protect screens via Hotkey
authorlittlesat <littlesat99@yahoo.com>
Sat, 4 Apr 2015 13:43:21 +0000 (15:43 +0200)
committerlittlesat <littlesat99@yahoo.com>
Sat, 4 Apr 2015 13:44:10 +0000 (15:44 +0200)
Thanks Dimitrij for the suggestion

lib/python/Screens/Menu.py
lib/python/Screens/ParentalControlSetup.py
lib/python/Screens/PluginBrowser.py
lib/python/Screens/TimerEdit.py

index 142a1ed..2c16a40 100644 (file)
@@ -245,7 +245,7 @@ class Menu(Screen, ProtectedScreen):
 
        def isProtected(self):
                if config.ParentalControl.setuppinactive.value:
-                       if config.ParentalControl.config_sections.main_menu.value:
+                       if config.ParentalControl.config_sections.main_menu.value and not(hasattr(self.session, 'infobar') and self.session.infobar is None):
                                return self.menuID == "mainmenu"
                        elif config.ParentalControl.config_sections.configuration.value and self.menuID == "setup":
                                return True
index 774b60e..464b1d4 100644 (file)
@@ -79,11 +79,10 @@ class ParentalControlSetup(Screen, ConfigListScreen, ProtectedScreen):
                        self.list.append(getConfigListEntry(_("Protect Screens"), config.ParentalControl.setuppinactive))
                        if config.ParentalControl.setuppinactive.value:
                                self.list.append(getConfigListEntry(_("Protect main menu"), config.ParentalControl.config_sections.main_menu))
-                               if not config.ParentalControl.config_sections.main_menu.value:
-                                       self.list.append(getConfigListEntry(_("Protect timer menu"), config.ParentalControl.config_sections.timer_menu))
-                                       self.list.append(getConfigListEntry(_("Protect plugin browser"), config.ParentalControl.config_sections.plugin_browser))
-                                       self.list.append(getConfigListEntry(_("Protect configuration"), config.ParentalControl.config_sections.configuration))
-                                       self.list.append(getConfigListEntry(_("Protect standby menu"), config.ParentalControl.config_sections.standby_menu))
+                               self.list.append(getConfigListEntry(_("Protect timer menu"), config.ParentalControl.config_sections.timer_menu))
+                               self.list.append(getConfigListEntry(_("Protect plugin browser"), config.ParentalControl.config_sections.plugin_browser))
+                               self.list.append(getConfigListEntry(_("Protect configuration"), config.ParentalControl.config_sections.configuration))
+                               self.list.append(getConfigListEntry(_("Protect standby menu"), config.ParentalControl.config_sections.standby_menu))
                                self.list.append(getConfigListEntry(_("Protect movie list"), config.ParentalControl.config_sections.movie_list))
                                self.list.append(getConfigListEntry(_("Protect context menus"), config.ParentalControl.config_sections.context_menus))
                self["config"].list = self.list
index 8a26e4b..2ece972 100644 (file)
@@ -96,7 +96,7 @@ class PluginBrowser(Screen, ProtectedScreen):
                self.onLayoutFinish.append(self.saveListsize)
 
        def isProtected(self):
-               return config.ParentalControl.setuppinactive.value and not config.ParentalControl.config_sections.main_menu.value and config.ParentalControl.config_sections.plugin_browser.value
+               return config.ParentalControl.setuppinactive.value and (not config.ParentalControl.config_sections.main_menu.value or hasattr(self.session, 'infobar') and self.session.infobar is None) and config.ParentalControl.config_sections.plugin_browser.value
 
        def exit(self):
                self.close(True)
index fb99b83..16bacb8 100644 (file)
@@ -61,7 +61,7 @@ class TimerEditList(Screen):
                        self.onFirstExecBegin.append(boundFunction(self.session.openWithCallback, self.pinEntered, PinInput, pinList=[x.value for x in config.ParentalControl.servicepin], triesEntry=config.ParentalControl.retries.servicepin, title=_("Please enter the correct pin code"), windowTitle=_("Enter pin code")))
 
        def isProtected(self):
-               return config.ParentalControl.setuppinactive.value and not config.ParentalControl.config_sections.main_menu.value and config.ParentalControl.config_sections.timer_menu.value
+               return config.ParentalControl.setuppinactive.value and (not config.ParentalControl.config_sections.main_menu.value or hasattr(self.session, 'infobar') and self.session.infobar is None) and config.ParentalControl.config_sections.timer_menu.value
 
        def pinEntered(self, result):
                if result is None: