re-level some config options, introduce levels for channel selection menu
authorFelix Domke <tmbinc@elitedvb.net>
Thu, 22 Nov 2007 01:27:40 +0000 (01:27 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Thu, 22 Nov 2007 01:27:40 +0000 (01:27 +0000)
data/menu.xml
data/setup.xml
lib/python/Screens/ChannelSelection.py

index d1619a4..6e108c5 100644 (file)
                <item text="Network setup" entryID="network_setup">self.openSetup("network")</item>-->
                <!--<item text="CI"><screen module="Ci" screen="CiSelection" /></item>-->
                <!--<item text="Radio"><code>print "radio mode"</code></item>-->
-               <item text="Subtitles" entryID="subtitle_selection" weight="40"><screen module="Subtitles" screen="Subtitles" /></item>
-               <item text="Timer" entryID="timer_edit"><screen module="TimerEdit" screen="TimerEditList" /></item>
-               <item text="VCR scart" entryID="scart_switch"><code>self.session.scart.VCRSbChanged(3)</code></item>
+               <item level="0" text="Subtitles" entryID="subtitle_selection" weight="40"><screen module="Subtitles" screen="Subtitles" /></item>
+               <item level="0" text="Timer" entryID="timer_edit"><screen module="TimerEdit" screen="TimerEditList" /></item>
+               <item level="1" text="VCR scart" entryID="scart_switch"><code>self.session.scart.VCRSbChanged(3)</code></item>
 
-               <menu text="Information" entryID="info_screen">
+               <menu level="0" text="Information" entryID="info_screen">
                        <id val="information" />
-                       <item text="Service" entryID="service_info_screen"><screen module="ServiceInfo" screen="ServiceInfo"/></item>
-                       <item text="About..." entryID="about_screen"><screen module="About" /></item>
+                       <item level="1" text="Service" entryID="service_info_screen"><screen module="ServiceInfo" screen="ServiceInfo"/></item>
+                       <item level="0" text="About..." entryID="about_screen"><screen module="About" /></item>
                </menu>
 
-               <item text="Plugins" entryID="plugin_selection"><screen module="PluginBrowser" screen="PluginBrowser" /></item>
-               <menu text="Setup" flushConfigOnClose="1" entryID="setup_selection" >
+               <item level="1" text="Plugins" entryID="plugin_selection"><screen module="PluginBrowser" screen="PluginBrowser" /></item>
+               <menu level="0" text="Setup" flushConfigOnClose="1" entryID="setup_selection" >
                        <id val="setup" />
                        <!--<menu text="Service Organising">
                                <item text="New Bouquets"></item>
                                <item text="Add to Bouquets"></item>
                                <item text="Edit Bouquets"></item>
                        </menu>-->
-                       <menu text="Service Searching" entryID="service_searching_selection">
+                       <menu level="0" text="Service Searching" entryID="service_searching_selection">
                                <id val="scan" />
                                <item text="Tuner configuration" entryID="tuner_setup"><screen module="Satconfig" screen="NimSelection" /></item>
                                <item text="Automatic Scan" entryID="auto_scan"><screen module="ScanSetup" screen="ScanSimple" /></item>
                                <item text="Edit Transponder"></item>
                                <item text="Satfinder"></item>-->
                        </menu>
-                       <menu text="System" entryID="system_selection">
+                       <menu level="0" text="System" entryID="system_selection">
                                <id val="system" />
-                               <item text="Language..." entryID="language_setup"><screen module="LanguageSelection" /></item>
-                               <item entryID="usage_setup"><setup id="usage" /></item>
-                               <item entryID="timezone_setup"><setup id="timezone"/></item>
-                               <item entryID="av_setup"><setup id="avsetup"/></item>
-                               <item entryID="rfmod_setup"><setup id="RFmod"/></item>
-                               <menu text="Harddisk" entryID="hardisk_selection">
+                               <item level="0" text="Language..." entryID="language_setup"><screen module="LanguageSelection" /></item>
+                               <item level="0" entryID="usage_setup"><setup id="usage" /></item>
+                               <item level="0" entryID="timezone_setup"><setup id="timezone"/></item>
+                               <item level="0" entryID="av_setup"><setup id="avsetup"/></item>
+                               <item level="1" entryID="rfmod_setup"><setup id="RFmod"/></item>
+                               <menu level="0" text="Harddisk" entryID="hardisk_selection">
                                        <id val="harddisk" />
-                                       <item entryID="harddisk_setup"><setup id="harddisk"/></item>
-                                       <item text="Initialization..." entryID="harddisk_init"><screen module="HarddiskSetup" screen="HarddiskSelection"/></item>
+                                       <item level="1" entryID="harddisk_setup"><setup id="harddisk"/></item>
+                                       <item level="0" text="Initialization..." entryID="harddisk_init"><screen module="HarddiskSetup" screen="HarddiskSelection"/></item>
                                </menu>
                                <!--<item text="Remote Control"><setup id="rc" /></item>-->
                                <!--<item text="Keyboard"><setup id="keyboard" /></item>-->
                                <!--<item text="OSD"><setup id="osd" /></item>-->
-                               <item><setup id="lcd" /></item>
-                               <menu text="Network..." entryID="network_setup">
+                               <item><setup level="1" id="lcd" /></item>
+                               <menu level="1" text="Network..." entryID="network_setup">
                                        <id val="network" />
-                                       <item text="Device Setup..." entryID="device_setup"><screen module="NetworkSetup" screen="NetworkAdapterSelection"/></item>
-                                       <item text="Nameserver Setup..." entryID="dns_setup"><screen module="NetworkSetup" screen="NameserverSetup"/></item>
+                                       <item level="1" text="Device Setup..." entryID="device_setup"><screen module="NetworkSetup" screen="NetworkAdapterSelection"/></item>
+                                       <item level="1" text="Nameserver Setup..." entryID="dns_setup"><screen module="NetworkSetup" screen="NameserverSetup"/></item>
                                </menu>
                        </menu>
-                       <item text="Common Interface" entryID="ci_setup"><screen module="Ci" screen="CiSelection" /></item>
-                       <item text="Parental control" entryID="parental_setup"><screen module="ParentalControlSetup" screen="ParentalControlSetup" /></item>
-                       <item text="Startwizard" entryID="startwizzard"><screen module="StartWizard" screen="StartWizard" /></item>
+                       <item level="1" text="Common Interface" entryID="ci_setup"><screen module="Ci" screen="CiSelection" /></item>
+                       <item level="0" text="Parental control" entryID="parental_setup"><screen module="ParentalControlSetup" screen="ParentalControlSetup" /></item>
+                       <item level="0" text="Startwizard" entryID="startwizzard"><screen module="StartWizard" screen="StartWizard" /></item>
                        <!--<item text="Parental Control"><setup id="parental" /></item>-->
                        <!--<item text="Expert -disabled-"><setup id="expert" /></item>-->
                </menu>
index 13ce251..738e882 100644 (file)
@@ -12,8 +12,8 @@
                        <item level="0" text="Aspect Ratio">config.av.aspectratio</item>
                        <item level="0" text="TV System">config.av.tvsystem</item>
                        <item level="1" text="WSS on 4:3">config.av.wss</item>
-                       <item level="0" text="AC3 default">config.av.defaultac3</item>
-                       <item level="0" text="VCR Switch">config.av.vcrswitch</item>
+                       <item level="1" text="AC3 default">config.av.defaultac3</item>
+                       <item level="1" text="VCR Switch">config.av.vcrswitch</item>
                </setup>
                <setup key="usage" title="Customize">
                        <item level="0" text="Setup Mode">config.usage.setup_level</item>
                        <item text="Activate network settings">config.network.activate</item>
                </setup>
                <setup key="RFmod" title="RF output">
-                       <item level="0" text="Modulator">config.rfmod.enable</item>
-                       <item level="1" text="Test mode">config.rfmod.test</item>
-                       <item level="1" text="Sound">config.rfmod.sound</item>
-                       <item level="1" text="Soundcarrier">config.rfmod.soundcarrier</item>
-                       <item level="0" text="Channel">config.rfmod.channel</item>
-                       <item level="0" text="Finetune">config.rfmod.finetune</item>
+                       <item level="1" text="Modulator">config.rfmod.enable</item>
+                       <item level="2" text="Test mode">config.rfmod.test</item>
+                       <item level="2" text="Sound">config.rfmod.sound</item>
+                       <item level="2" text="Soundcarrier">config.rfmod.soundcarrier</item>
+                       <item level="1" text="Channel">config.rfmod.channel</item>
+                       <item level="1" text="Finetune">config.rfmod.finetune</item>
                </setup>
                <setup key="keyboard" title="Keyboard Setup">
                        <item level="0" text="Keyboard Map">config.keyboard.keymap</item>
@@ -67,7 +67,7 @@
                        <item level="0" text="Brightness">config.lcd.bright</item>
                        <item level="0" text="Contrast">config.lcd.contrast</item>
                        <item level="0" text="Standby">config.lcd.standby</item>
-                       <item level="1" text="Invert display">config.lcd.invert</item>
+                       <item level="2" text="Invert display">config.lcd.invert</item>
                </setup>
                <setup key="satconfig" title="Sat / Dish Setup">
                        <item text="Tuner Slot">config.sat.tunerslot</item>
index b509b1a..2576516 100644 (file)
@@ -61,8 +61,8 @@ OFF = 0
 EDIT_BOUQUET = 1
 EDIT_ALTERNATIVES = 2
 
-def append_when_current_valid(current, menu, args):
-       if current and current.valid():
+def append_when_current_valid(current, menu, args, level = 0):
+       if current and current.valid() and level <= config.usage.setup_level.index:
                menu.append(args)
 
 class ChannelContextMenu(Screen):
@@ -88,63 +88,63 @@ class ChannelContextMenu(Screen):
                haveBouquets = config.usage.multibouquet.value
 
                if not (len(current_sel_path) or current_sel_flags & (eServiceReference.isDirectory|eServiceReference.isMarker)):
-                       append_when_current_valid(current, menu, (_("show transponder info"), self.showServiceInformations))
+                       append_when_current_valid(current, menu, (_("show transponder info"), self.showServiceInformations), level = 2)
                if csel.bouquet_mark_edit == OFF and not csel.movemode:
                        if not inBouquetRootList:
                                isPlayable = not (current_sel_flags & (eServiceReference.isMarker|eServiceReference.isDirectory))
                                if isPlayable:
                                        if config.ParentalControl.configured.value:
                                                if parentalControl.getProtectionLevel(csel.getCurrentSelection().toCompareString()) == -1:
-                                                       append_when_current_valid(current, menu, (_("add to parental protection"), boundFunction(self.addParentalProtection, csel.getCurrentSelection())))
+                                                       append_when_current_valid(current, menu, (_("add to parental protection"), boundFunction(self.addParentalProtection, csel.getCurrentSelection())), level = 0)
                                                else:
-                                                       append_when_current_valid(current, menu, (_("remove from parental protection"), boundFunction(self.removeParentalProtection, csel.getCurrentSelection())))
+                                                       append_when_current_valid(current, menu, (_("remove from parental protection"), boundFunction(self.removeParentalProtection, csel.getCurrentSelection())), level = 0)
                                        if haveBouquets:
-                                               append_when_current_valid(current, menu, (_("add service to bouquet"), self.addServiceToBouquetSelected))
+                                               append_when_current_valid(current, menu, (_("add service to bouquet"), self.addServiceToBouquetSelected), level = 0)
                                        else:
-                                               append_when_current_valid(current, menu, (_("add service to favourites"), self.addServiceToBouquetSelected))
+                                               append_when_current_valid(current, menu, (_("add service to favourites"), self.addServiceToBouquetSelected), level = 0)
                                else:
                                        if haveBouquets:
                                                if not inBouquet and current_sel_path.find("PROVIDERS") == -1:
-                                                       append_when_current_valid(current, menu, (_("copy to bouquets"), self.copyCurrentToBouquetList))
+                                                       append_when_current_valid(current, menu, (_("copy to bouquets"), self.copyCurrentToBouquetList), level = 0)
                                        if current_sel_path.find("flags == %d" %(FLAG_SERVICE_NEW_FOUND)) != -1:
-                                               append_when_current_valid(current, menu, (_("remove all new found flags"), self.removeAllNewFoundFlags))
+                                               append_when_current_valid(current, menu, (_("remove all new found flags"), self.removeAllNewFoundFlags), level = 0)
                                if inBouquet:
-                                       append_when_current_valid(current, menu, (_("remove entry"), self.removeCurrentService))
+                                       append_when_current_valid(current, menu, (_("remove entry"), self.removeCurrentService), level = 0)
                                if current_root and current_root.getPath().find("flags == %d" %(FLAG_SERVICE_NEW_FOUND)) != -1:
-                                       append_when_current_valid(current, menu, (_("remove new found flag"), self.removeNewFoundFlag))
+                                       append_when_current_valid(current, menu, (_("remove new found flag"), self.removeNewFoundFlag), level = 0)
                        else:
                                        menu.append((_("add bouquet"), self.showBouquetInputBox))
-                                       append_when_current_valid(current, menu, (_("remove entry"), self.removeBouquet))
+                                       append_when_current_valid(current, menu, (_("remove entry"), self.removeBouquet), level = 0)
 
                if inBouquet: # current list is editable?
                        if csel.bouquet_mark_edit == OFF:
                                if not csel.movemode:
-                                       append_when_current_valid(current, menu, (_("enable move mode"), self.toggleMoveMode))
+                                       append_when_current_valid(current, menu, (_("enable move mode"), self.toggleMoveMode), level = 1)
                                        if not inBouquetRootList and current_root and not (current_root.flags & eServiceReference.isGroup):
                                                menu.append((_("add marker"), self.showMarkerInputBox))
                                                if haveBouquets:
-                                                       append_when_current_valid(current, menu, (_("enable bouquet edit"), self.bouquetMarkStart))
+                                                       append_when_current_valid(current, menu, (_("enable bouquet edit"), self.bouquetMarkStart), level = 0)
                                                else:
-                                                       append_when_current_valid(current, menu, (_("enable favourite edit"), self.bouquetMarkStart))
+                                                       append_when_current_valid(current, menu, (_("enable favourite edit"), self.bouquetMarkStart), level = 0)
                                                if current_sel_flags & eServiceReference.isGroup:
-                                                       append_when_current_valid(current, menu, (_("edit alternatives"), self.editAlternativeServices))
-                                                       append_when_current_valid(current, menu, (_("show alternatives"), self.showAlternativeServices))
-                                                       append_when_current_valid(current, menu, (_("remove all alternatives"), self.removeAlternativeServices))
+                                                       append_when_current_valid(current, menu, (_("edit alternatives"), self.editAlternativeServices), level = 2)
+                                                       append_when_current_valid(current, menu, (_("show alternatives"), self.showAlternativeServices), level = 2)
+                                                       append_when_current_valid(current, menu, (_("remove all alternatives"), self.removeAlternativeServices), level = 2)
                                                elif not current_sel_flags & eServiceReference.isMarker:
-                                                       append_when_current_valid(current, menu, (_("add alternatives"), self.addAlternativeServices))
+                                                       append_when_current_valid(current, menu, (_("add alternatives"), self.addAlternativeServices), level = 2)
                                else:
-                                       append_when_current_valid(current, menu, (_("disable move mode"), self.toggleMoveMode))
+                                       append_when_current_valid(current, menu, (_("disable move mode"), self.toggleMoveMode), level = 0)
                        else:
                                if csel.bouquet_mark_edit == EDIT_BOUQUET:
                                        if haveBouquets:
-                                               append_when_current_valid(current, menu, (_("end bouquet edit"), self.bouquetMarkEnd))
-                                               append_when_current_valid(current, menu, (_("abort bouquet edit"), self.bouquetMarkAbort))
+                                               append_when_current_valid(current, menu, (_("end bouquet edit"), self.bouquetMarkEnd), level = 0)
+                                               append_when_current_valid(current, menu, (_("abort bouquet edit"), self.bouquetMarkAbort), level = 0)
                                        else:
-                                               append_when_current_valid(current, menu, (_("end favourites edit"), self.bouquetMarkEnd))
-                                               append_when_current_valid(current, menu, (_("abort favourites edit"), self.bouquetMarkAbort))
+                                               append_when_current_valid(current, menu, (_("end favourites edit"), self.bouquetMarkEnd), level = 0)
+                                               append_when_current_valid(current, menu, (_("abort favourites edit"), self.bouquetMarkAbort), level = 0)
                                else:
-                                               append_when_current_valid(current, menu, (_("end alternatives edit"), self.bouquetMarkEnd))
-                                               append_when_current_valid(current, menu, (_("abort alternatives edit"), self.bouquetMarkAbort))
+                                               append_when_current_valid(current, menu, (_("end alternatives edit"), self.bouquetMarkEnd), level = 0)
+                                               append_when_current_valid(current, menu, (_("abort alternatives edit"), self.bouquetMarkAbort), level = 0)
 
                menu.append((_("back"), self.cancelClick))
                self["menu"] = MenuList(menu)