change ConfigDummy to ConfigNothing
[vuplus_dvbapp] / lib / python / Screens / ChannelSelection.py
index 01feaab..6c3abb5 100644 (file)
@@ -5,7 +5,7 @@ from Components.ActionMap import NumberActionMap, ActionMap
 from Components.MenuList import MenuList
 from EpgSelection import EPGSelection
 from enigma import eServiceReference, eEPGCache, eServiceCenter, eServiceCenterPtr, iMutableServiceListPtr, iStaticServiceInformationPtr, eTimer, eDVBDB
 from Components.MenuList import MenuList
 from EpgSelection import EPGSelection
 from enigma import eServiceReference, eEPGCache, eServiceCenter, eServiceCenterPtr, iMutableServiceListPtr, iStaticServiceInformationPtr, eTimer, eDVBDB
-from Components.config import config, configElement, ConfigSubsection, configText, currentConfigSelectionElement
+from Components.config import config, ConfigSubsection, ConfigText
 from Screens.FixedMenu import FixedMenu
 from Tools.NumericalTextInput import NumericalTextInput
 from Components.NimManager import nimmanager
 from Screens.FixedMenu import FixedMenu
 from Tools.NumericalTextInput import NumericalTextInput
 from Components.NimManager import nimmanager
@@ -87,7 +87,7 @@ class ChannelContextMenu(Screen):
                                                menu.append((_("remove all new found flags"), self.removeAllNewFoundFlags))
                                if inBouquet:
                                        menu.append((_("remove entry"), self.removeCurrentService))
                                                menu.append((_("remove all new found flags"), self.removeAllNewFoundFlags))
                                if inBouquet:
                                        menu.append((_("remove entry"), self.removeCurrentService))
-                               if current_root.getPath().find("flags == %d" %(FLAG_SERVICE_NEW_FOUND)) != -1:
+                               if current_root is not None and current_root.getPath().find("flags == %d" %(FLAG_SERVICE_NEW_FOUND)) != -1:
                                        menu.append((_("remove new found flag"), self.removeNewFoundFlag))
                        else:
                                        menu.append((_("add bouquet"), self.showBouquetInputBox))
                                        menu.append((_("remove new found flag"), self.removeNewFoundFlag))
                        else:
                                        menu.append((_("add bouquet"), self.showBouquetInputBox))
@@ -480,6 +480,7 @@ class ChannelSelectionBase(Screen):
                self.servicelist = self["list"]
 
                self.numericalTextInput = NumericalTextInput()
                self.servicelist = self["list"]
 
                self.numericalTextInput = NumericalTextInput()
+               self.numericalTextInput.setUseableChars(u'1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ')
 
                self.servicePathTV = [ ]
                self.servicePathRadio = [ ]
 
                self.servicePathTV = [ ]
                self.servicePathRadio = [ ]
@@ -512,6 +513,7 @@ class ChannelSelectionBase(Screen):
                                "9": self.keyNumberGlobal,
                                "0": self.keyNumber0
                        })
                                "9": self.keyNumberGlobal,
                                "0": self.keyNumber0
                        })
+               self.recallBouquetMode()
 
        def appendDVBTypes(self, ref):
                path = ref.getPath()
 
        def appendDVBTypes(self, ref):
                path = ref.getPath()
@@ -552,13 +554,13 @@ class ChannelSelectionBase(Screen):
        def recallBouquetMode(self):
                if self.mode == MODE_TV:
                        self.service_types = self.service_types_tv
        def recallBouquetMode(self):
                if self.mode == MODE_TV:
                        self.service_types = self.service_types_tv
-                       if currentConfigSelectionElement(config.usage.multibouquet) == "yes":
+                       if config.usage.multibouquet.value:
                                self.bouquet_rootstr = '1:7:1:0:0:0:0:0:0:0:(type == 1) FROM BOUQUET "bouquets.tv" ORDER BY bouquet'
                        else:
                                self.bouquet_rootstr = '%s FROM BOUQUET "userbouquet.favourites.tv" ORDER BY bouquet'%(self.service_types)
                else:
                        self.service_types = self.service_types_radio
                                self.bouquet_rootstr = '1:7:1:0:0:0:0:0:0:0:(type == 1) FROM BOUQUET "bouquets.tv" ORDER BY bouquet'
                        else:
                                self.bouquet_rootstr = '%s FROM BOUQUET "userbouquet.favourites.tv" ORDER BY bouquet'%(self.service_types)
                else:
                        self.service_types = self.service_types_radio
-                       if currentConfigSelectionElement(config.usage.multibouquet) == "yes":
+                       if config.usage.multibouquet.value:
                                self.bouquet_rootstr = '1:7:1:0:0:0:0:0:0:0:(type == 1) FROM BOUQUET "bouquets.radio" ORDER BY bouquet'
                        else:
                                self.bouquet_rootstr = '%s FROM BOUQUET "userbouquet.favourites.radio" ORDER BY bouquet'%(self.service_types)
                                self.bouquet_rootstr = '1:7:1:0:0:0:0:0:0:0:(type == 1) FROM BOUQUET "bouquets.radio" ORDER BY bouquet'
                        else:
                                self.bouquet_rootstr = '%s FROM BOUQUET "userbouquet.favourites.radio" ORDER BY bouquet'%(self.service_types)
@@ -799,8 +801,10 @@ class ChannelSelectionBase(Screen):
                                                self.enterPath(self.bouquet_root)
 
        def keyNumberGlobal(self, number):
                                                self.enterPath(self.bouquet_root)
 
        def keyNumberGlobal(self, number):
-               char = self.numericalTextInput.getKey(number)
-               self.servicelist.moveToChar(char)
+               unichar = self.numericalTextInput.getKey(number)
+               charstr = unichar.encode("utf-8")
+               if len(charstr) == 1:
+                       self.servicelist.moveToChar(charstr[0])
 
        def getRoot(self):
                return self.servicelist.getRoot()
 
        def getRoot(self):
                return self.servicelist.getRoot()
@@ -873,13 +877,13 @@ HISTORYSIZE = 20
 
 #config for lastservice
 config.tv = ConfigSubsection()
 
 #config for lastservice
 config.tv = ConfigSubsection()
-config.tv.lastservice = configElement("config.tv.lastservice", configText, "", 0)
-config.tv.lastroot = configElement("config.tv.lastroot", configText, "", 0)
+config.tv.lastservice = ConfigText()
+config.tv.lastroot = ConfigText()
 config.radio = ConfigSubsection()
 config.radio = ConfigSubsection()
-config.radio.lastservice = configElement("config.radio.lastservice", configText, "", 0)
-config.radio.lastroot = configElement("config.radio.lastroot", configText, "", 0)
+config.radio.lastservice = ConfigText()
+config.radio.lastroot = ConfigText()
 config.servicelist = ConfigSubsection()
 config.servicelist = ConfigSubsection()
-config.servicelist.lastmode = configElement("config.servicelist.lastmode", configText, "tv", 0)
+config.servicelist.lastmode = ConfigText(default = "tv")
 
 class ChannelSelection(ChannelSelectionBase, ChannelSelectionEdit, ChannelSelectionEPG):
        def __init__(self, session):
 
 class ChannelSelection(ChannelSelectionBase, ChannelSelectionEdit, ChannelSelectionEPG):
        def __init__(self, session):
@@ -929,7 +933,7 @@ class ChannelSelection(ChannelSelectionBase, ChannelSelectionEdit, ChannelSelect
        def setModeRadio(self):
                if self.revertMode is None and config.servicelist.lastmode.value == "tv":
                        self.revertMode = MODE_TV
        def setModeRadio(self):
                if self.revertMode is None and config.servicelist.lastmode.value == "tv":
                        self.revertMode = MODE_TV
-               if currentConfigSelectionElement(config.usage.e1like_radio_mode) == "yes":
+               if config.usage.e1like_radio_mode.value == "yes":
                        self.history = self.history_radio
                        self.lastservice = config.radio.lastservice
                        self.lastroot = config.radio.lastroot
                        self.history = self.history_radio
                        self.lastservice = config.radio.lastservice
                        self.lastroot = config.radio.lastroot
@@ -938,7 +942,7 @@ class ChannelSelection(ChannelSelectionBase, ChannelSelectionEdit, ChannelSelect
                        self.setMode()
 
        def __onCreate(self):
                        self.setMode()
 
        def __onCreate(self):
-               if currentConfigSelectionElement(config.usage.e1like_radio_mode) == "yes":
+               if config.usage.e1like_radio_mode.value == "yes":
                        if config.servicelist.lastmode.value == "tv":
                                self.setModeTv()
                        else:
                        if config.servicelist.lastmode.value == "tv":
                                self.setModeTv()
                        else:
@@ -1127,8 +1131,8 @@ class ChannelSelectionRadio(ChannelSelectionBase, ChannelSelectionEdit, ChannelS
                ChannelSelectionEPG.__init__(self)
 
                config.radio = ConfigSubsection();
                ChannelSelectionEPG.__init__(self)
 
                config.radio = ConfigSubsection();
-               config.radio.lastservice = configElement("config.radio.lastservice", configText, "", 0);
-               config.radio.lastroot = configElement("config.radio.lastroot", configText, "", 0);
+               config.radio.lastservice = ConfigText()
+               config.radio.lastroot = ConfigText()
                self.onLayoutFinish.append(self.onCreate)
 
                self.info = session.instantiateDialog(RadioInfoBar)
                self.onLayoutFinish.append(self.onCreate)
 
                self.info = session.instantiateDialog(RadioInfoBar)