fix some misspellings
[enigma2.git] / lib / python / Screens / AudioSelection.py
index b5278389549617f601c73edaa22eeb3651063c91..4c6896201d5e04aeb6d4b456761c1b10db7788e2 100644 (file)
@@ -51,12 +51,12 @@ class AudioSelection(Screen, ConfigListScreen):
                self.settings = ConfigSubsection()
                choicelist = [(PAGE_AUDIO,_("audio tracks")), (PAGE_SUBTITLES,_("Subtitles"))]
                self.settings.menupage = ConfigSelection(choices = choicelist, default=page)
-               self.settings.menupage.addNotifier(self.fillList)
                self.onLayoutFinish.append(self.__layoutFinished)
 
        def __layoutFinished(self):
                self["config"].instance.setSelectionEnable(False)
                self.focus = FOCUS_STREAMS
+               self.settings.menupage.addNotifier(self.fillList)
 
        def fillList(self, arg=None):
                streams = []
@@ -76,11 +76,15 @@ class AudioSelection(Screen, ConfigListScreen):
 
                        if n > 0:
                                self.audioChannel = service.audioChannel()
-                               choicelist = [("0",_("left")), ("1",_("stereo")), ("2", _("right"))]
-                               self.settings.channelmode = ConfigSelection(choices = choicelist, default = str(self.audioChannel.getCurrentChannel()))
-                               self.settings.channelmode.addNotifier(self.changeMode, initial_call = False)
-                               conflist.append(getConfigListEntry(_("Channel"), self.settings.channelmode))
-                               self["key_green"].setBoolean(True)
+                               if self.audioChannel:
+                                       choicelist = [("0",_("left")), ("1",_("stereo")), ("2", _("right"))]
+                                       self.settings.channelmode = ConfigSelection(choices = choicelist, default = str(self.audioChannel.getCurrentChannel()))
+                                       self.settings.channelmode.addNotifier(self.changeMode, initial_call = False)
+                                       conflist.append(getConfigListEntry(_("Channel"), self.settings.channelmode))
+                                       self["key_green"].setBoolean(True)
+                               else:
+                                       conflist.append(('',))
+                                       self["key_green"].setBoolean(False)
                                selectedAudio = self.audioTracks.getCurrentTrack()
                                for x in range(n):
                                        number = str(x)
@@ -136,7 +140,7 @@ class AudioSelection(Screen, ConfigListScreen):
                                        language = _("<unknown>")
                                        selected = ""
 
-                                       if sel and x[:4] == sel[:4]:
+                                       if sel and x == sel:
                                                selected = _("Running")
                                                selectedidx = idx
                                        
@@ -155,7 +159,7 @@ class AudioSelection(Screen, ConfigListScreen):
                                                number = "%x%02x" % (x[3],x[2])
 
                                        elif x[0] == 2:
-                                               types = (_("<unknown>"), "UTF-8 text", "SSA", "AAS", ".SRT file", "VOB")
+                                               types = (_("<unknown>"), "UTF-8 text", "SSA", "AAS", ".SRT file", "VOB", "PGS (unsupported)")
                                                description = types[x[2]]
 
                                        streams.append((x, "", number, description, language, selected))
@@ -218,7 +222,7 @@ class AudioSelection(Screen, ConfigListScreen):
                config.av.downmix_ac3.save()
 
        def changeMode(self, mode):
-               if mode is not None:
+               if mode is not None and self.audioChannel:
                        self.audioChannel.selectChannel(int(mode.getValue()))
 
        def changeAudio(self, audio):
@@ -300,7 +304,7 @@ class AudioSelection(Screen, ConfigListScreen):
                                else:
                                        self.enableSubtitle(cur[0])
                                        self.__updatedInfo()
-               #self.close()
+                       self.close(0)
                elif self.focus == FOCUS_CONFIG:
                        self.keyRight()