restore video mode to prev valid mode, when change to another mode was not
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 2 Oct 2008 20:56:56 +0000 (20:56 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 2 Oct 2008 20:56:56 +0000 (20:56 +0000)
ok

lib/python/Plugins/SystemPlugins/Videomode/plugin.py

index eb58568..b51cc08 100644 (file)
@@ -108,6 +108,9 @@ class VideoSetup(Screen, ConfigListScreen):
 
        def confirm(self, confirmed):
                if not confirmed:
+                       config.av.videoport.value = self.last_good[0]
+                       config.av.videomode[self.last_good[0]].value = self.last_good[1]
+                       config.av.videorate[self.last_good[1]].value = self.last_good[2]
                        self.hw.setMode(*self.last_good)
                else:
                        self.keySave()
@@ -121,8 +124,11 @@ class VideoSetup(Screen, ConfigListScreen):
        def apply(self):
                port = config.av.videoport.value
                mode = config.av.videomode[port].value
-               rate = config.av.videorate[mode].value
+               rate =config.av.videorate[mode].value
                if (port, mode, rate) != self.last_good:
+                       config.av.videoport.value = self.last_good[0]
+                       config.av.videomode[port].value = self.last_good[1]
+                       config.av.videorate[mode].value = self.last_good[2]
                        self.hw.setMode(port, mode, rate)
                        from Screens.MessageBox import MessageBox
                        self.session.openWithCallback(self.confirm, MessageBox, "Is this videomode ok?", MessageBox.TYPE_YESNO, timeout = 20, default = False)