SleepTimerEdit: Make the abort handling correctly
authorLittlesat <littlesat99@yahoo.com>
Fri, 1 Mar 2013 15:31:41 +0000 (16:31 +0100)
committerLittlesat <littlesat99@yahoo.com>
Fri, 1 Mar 2013 15:31:41 +0000 (16:31 +0100)
lib/python/Screens/SleepTimerEdit.py

index 33461e1..9312a95 100644 (file)
@@ -68,8 +68,17 @@ class SleepTimerEdit(ConfigListScreen, Screen):
                        self.close(True)
                self.close()
 
-       def cancel(self):
-               self.close()
+       def cancel(self, answer = None):
+               if answer is None:
+                       if self["config"].isChanged():
+                               self.session.openWithCallback(self.cancel, MessageBox, _("Really close without saving settings?"))
+                       else:
+                               answer = True
+               elif answer:
+                       if self["config"].isChanged():
+                               for x in self["config"].list:
+                                       x[1].cancel()
+                       self.close()
 
        def getCurrentEntry(self):
                return self["config"].getCurrent()[0]