add missing file
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Mon, 30 Oct 2006 16:08:20 +0000 (16:08 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Mon, 30 Oct 2006 16:08:20 +0000 (16:08 +0000)
lib/python/Screens/ChannelSelection.py
lib/python/Screens/Makefile.am
lib/python/Screens/ScanSetup.py
lib/python/Screens/Subtitles.py [new file with mode: 0644]
lib/python/Screens/__init__.py

index ff2928e..5b8299c 100644 (file)
@@ -753,8 +753,8 @@ class ChannelSelectionBase(Screen):
                                                        else:
                                                                service_name = _("Services")
                                                        try:
-                                                               service_name += str(' - %s'%(nimmanager.getSatDescription(orbpos)))
-                                                               service.setName(service_name) # why we need this cast?
+                                                               service_name += str(' - %s'%(nimmanager.getSatDescription(orbpos).decode("latin-1").encode("utf-8")))
+                                                               service.setName(service_name)
                                                        except:
                                                                if orbpos == 0xFFFF: #Cable
                                                                        n = ("%s (%s)") % (service_name, _("Cable"))
index 2063bfb..455209f 100644 (file)
@@ -7,7 +7,7 @@ install_PYTHON = \
        Satconfig.py ScanSetup.py NetworkSetup.py Ci.py TimerEntry.py Volume.py \
        EpgSelection.py EventView.py Mute.py Standby.py ServiceInfo.py \
        InfoBarGenerics.py HelpMenu.py Wizard.py __init__.py \
-       Dish.py LanguageSelection.py StartWizard.py PiPSetup.py \
+       Dish.py LanguageSelection.py StartWizard.py PiPSetup.py Subtitles.py \
        TutorialWizard.py PluginBrowser.py MinuteInput.py Scart.py PVRState.py \
        Console.py InputBox.py ChoiceBox.py SimpleSummary.py ImageWizard.py \
        MediaPlayer.py TimerSelection.py PictureInPicture.py TimeDateInput.py \
index 1e164d4..f6ef01c 100644 (file)
@@ -483,7 +483,8 @@ class ScanSetup(ConfigListScreen, Screen):
                        elif self.scan_type.value == "single_satellite":
                                sat = self.satList[self.scan_nims.index][self.scan_satselection[self.scan_nims.index].index]
                                getInitialTransponderList(tlist, sat[0])
-                               flags |= eComponentScan.scanNetworkSearch
+                               if sat[2] & 1:
+                                       flags |= eComponentScan.scanNetworkSearch
                                tmp = self.scan_clearallservices.value
                                if tmp == "yes":
                                        flags |= eComponentScan.scanRemoveServices
diff --git a/lib/python/Screens/Subtitles.py b/lib/python/Screens/Subtitles.py
new file mode 100644 (file)
index 0000000..6a1deed
--- /dev/null
@@ -0,0 +1,74 @@
+from Screen import Screen
+from Components.ActionMap import ActionMap
+from Components.ConfigList import ConfigList, ConfigListScreen
+from Components.config import config, getConfigListEntry, ConfigNothing
+from Components.Label import Label
+
+from Tools.ISO639 import LanguageCodes
+
+class Subtitles(Screen, ConfigListScreen):
+       def __init__(self, session):
+               Screen.__init__(self, session)
+        
+               self["actions"] = ActionMap(["SetupActions"],
+               {
+                       "ok": self.ok,
+                       "cancel": self.cancel,
+               }, -2)
+
+               self.list = []
+               ConfigListScreen.__init__(self, self.list)
+               self.infobar = self.session.infobar
+               if self.subtitlesEnabled():
+                       self.list.append(getConfigListEntry(_("Disable Subtitles"), ConfigNothing(), None))
+                       sel = self.infobar.selected_subtitle
+               else:
+                       sel = None
+               for x in self.getSubtitleList():
+                       if sel and sel == x:
+                               text = _("Running")
+                       else:
+                               text = _("Enable")
+                       if x[0] == 0:
+                               self.list.append(getConfigListEntry(text+" DVB "+LanguageCodes[x[4]][0], ConfigNothing(), x))
+                       elif x[0] == 1:
+                               if x[4] == 'und': #undefined
+                                       self.list.append(getConfigListEntry(text+" TTX "+_("Page")+" "+str(x[2])+"/"+str(x[3]), ConfigNothing(), x))
+                               else:
+                                       self.list.append(getConfigListEntry(text+" TTX "+LanguageCodes[x[4]][0], ConfigNothing(), x))
+#              return _("Disable subtitles")
+               self["config"].list = self.list
+               self["config"].l.setList(self.list)
+
+       def getSubtitleList(self):
+               s = self.infobar and self.infobar.getCurrentServiceSubtitle()
+               l = s and s.getSubtitleList() or [ ]
+               return l
+
+       def subtitlesEnabled(self):
+               return self.infobar.subtitles_enabled
+
+       def enableSubtitle(self, subtitles):
+               if self.infobar.selected_subtitle != subtitles:
+                       print "enable subtitles", subtitles
+                       self.infobar.subtitles_enabled = False
+                       self.infobar.selected_subtitle = subtitles
+                       self.infobar.subtitles_enabled = True
+
+       def disableSubtitles(self):
+               self.infobar.subtitles_enabled = False
+
+       def keyLeft(self):
+               ConfigListScreen.keyLeft(self)
+
+       def keyRight(self):
+               ConfigListScreen.keyRight(self)
+
+       def ok(self):
+               if len(self.list):
+                       cur = self["config"].getCurrent()
+                       self.enableSubtitle(cur[2])
+               self.close(1)
+
+       def cancel(self):
+               self.close()
index 9ce0dc6..6e57497 100644 (file)
@@ -1,6 +1,6 @@
 __all__ = ["ChannelSelection", "ClockDisplay", "ConfigMenu", 
        "InfoBar", "MessageBox", "Menu", "MovieSelection", 
-       "Screen", "ServiceScan", "About",
+       "Screen", "ServiceScan", "About", "Subtitles", 
        "TimerEdit", "Setup", "HarddiskSetup", "FixedMenu",
        "Satconfig", "Scanconfig", "Ci.py", "Volume.py", "Mute.py",
        "EpgSelection", "EventView", "Standby", "ServiceInfo",