From bfb6b4765a85a65047655ad4282756ca31229c3e Mon Sep 17 00:00:00 2001 From: Andreas Monzner Date: Thu, 2 Oct 2008 20:56:56 +0000 Subject: [PATCH] restore video mode to prev valid mode, when change to another mode was not ok --- lib/python/Plugins/SystemPlugins/Videomode/plugin.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/python/Plugins/SystemPlugins/Videomode/plugin.py b/lib/python/Plugins/SystemPlugins/Videomode/plugin.py index eb58568e..b51cc08d 100644 --- a/lib/python/Plugins/SystemPlugins/Videomode/plugin.py +++ b/lib/python/Plugins/SystemPlugins/Videomode/plugin.py @@ -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) -- 2.30.2