Ejemplo n.º 1
0
    def keyOK(self):
        if self["config"].instance is None:
            return
        if self.reorderingEnabled:
            if not self.reorderingMode:
                self["config"].instance.setForegroundColorSelected(gRGB(0xFF0505))
                self.reorderingMode = True
            else:
                self["config"].instance.setForegroundColorSelected(gRGB(0xFFFFFF))
                self.reorderingMode = False
            self.runSetup()
            return

        curIndex = self["config"].getCurrentIndex()
        currItem = self["config"].list[curIndex][1]
        if curIndex < len(self.listOfHostsNames):
            hostName = self.listOfHostsNames[curIndex]
            if self.hostsConfigsAvailableList[curIndex] and IsHostEnabled(hostName):
                addConf = False
                try:
                    self.host = __import__('Plugins.Extensions.IPTVPlayer.hosts.host' + hostName, globals(), locals(), ['GetConfigList'], -1)
                    if(len(self.host.GetConfigList()) < 1):
                        printDBG('ConfigMenu host "%s" does not have additional configs' % hostName)
                    else:
                        self.session.open(ConfigHostMenu, hostName=hostName)
                        addConf = True
                except Exception:
                    printExc('ConfigMenu host "%s" does not have method GetConfigList' % hostName)
                if not addConf:
                    self.hostsConfigsAvailableList[curIndex] = False
                    self.onSelectionChanged()
                    self.session.open(MessageBox, _("Service [%s] has no additional settings.") % hostName, type=MessageBox.TYPE_INFO, timeout=5)
        else:
            ConfigBaseWidget.keyOK(self)
Ejemplo n.º 2
0
   def keyOK(self):
       if self["config"].instance is None:
           return
       if self.reorderingEnabled:
           if not self.reorderingMode:
               self["config"].instance.setForegroundColorSelected(gRGB(0xFF0505))
               self.reorderingMode = True
           else:
               self["config"].instance.setForegroundColorSelected(gRGB(0xFFFFFF))
               self.reorderingMode = False
           self.runSetup()
           return
 
       curIndex = self["config"].getCurrentIndex()
       currItem = self["config"].list[curIndex][1]
       if curIndex < len(self.listOfHostsNames):
           hostName = self.listOfHostsNames[curIndex]
           if self.hostsConfigsAvailableList[curIndex] and IsHostEnabled(hostName):
               addConf = False
               try:
                   self.host = __import__('Plugins.Extensions.IPTVPlayer.hosts.host' + hostName, globals(), locals(), ['GetConfigList'], -1)
                   if( len(self.host.GetConfigList()) < 1 ):
                       printDBG('ConfigMenu host "%s" does not have additional configs' % hostName)
                   else:
                       self.session.open(ConfigHostMenu, hostName = hostName)
                       addConf = True
               except:
                   printExc('ConfigMenu host "%s" does not have method GetConfigList' % hostName)
               if not addConf:
                   self.hostsConfigsAvailableList[curIndex] = False
                   self.onSelectionChanged()
                   self.session.open(MessageBox, _("Service [%s] has no additional settings.") % hostName, type=MessageBox.TYPE_INFO, timeout=5)
       else:
           ConfigBaseWidget.keyOK(self)
 def keyOK(self):
     curIndex = self["config"].getCurrentIndex()
     currItem = self["config"].list[curIndex][1]
     if isinstance(currItem, ConfigDirectory):
         def SetDirPathCallBack(curIndex, newPath):
             if None != newPath: self["config"].list[curIndex][1].value = newPath
         self.session.openWithCallback(boundFunction(SetDirPathCallBack, curIndex), IPTVDirectorySelectorWidget, currDir=currItem.value, title="Wybierz katalog")
     elif config.plugins.iptvplayer.fakePin == currItem:
         self.changePin(start = True)
     elif config.plugins.iptvplayer.fakeUpdate == currItem:
         self.keyUpdate()
     elif config.plugins.iptvplayer.fakeHostsList == currItem:
         self.hostsList()
     else:
         ConfigBaseWidget.keyOK(self)
Ejemplo n.º 4
0
 def keyOK(self):
     curIndex = self["config"].getCurrentIndex()
     currItem = self["config"].list[curIndex][1]
     if isinstance(currItem, ConfigDirectory):
         def SetDirPathCallBack(curIndex, newPath):
             if None != newPath: self["config"].list[curIndex][1].value = newPath
         self.session.openWithCallback(boundFunction(SetDirPathCallBack, curIndex), IPTVDirectorySelectorWidget, currDir=currItem.value, title="Wybierz katalog")
     elif config.plugins.iptvplayer.fakePin == currItem:
         self.changePin(start = True)
     elif config.plugins.iptvplayer.fakeUpdate == currItem:
         self.keyUpdate()
     elif config.plugins.iptvplayer.fakeHostsList == currItem:
         self.hostsList()
     else:
         ConfigBaseWidget.keyOK(self)