X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/674719294af7449c52d93b1969aeebbaa9117cbe..9a8c3eab7a0823b5dfc6111f07a04cf05d00b57b:/SleepTimer.py diff --git a/SleepTimer.py b/SleepTimer.py index 82acc124..891cd258 100644 --- a/SleepTimer.py +++ b/SleepTimer.py @@ -7,7 +7,7 @@ from Tools import Notifications from Components.config import config, ConfigYesNo, ConfigSelection, ConfigSubsection from Screens.MessageBox import MessageBox -from Screens.Standby import Standby, TryQuitMainloop, inStandby, inTryQuitMainloop +import Screens.Standby class SleepTimerEntry(timer.TimerEntry): def __init__(self, begin): @@ -21,15 +21,13 @@ class SleepTimerEntry(timer.TimerEntry): def activate(self): if self.state == self.StateRunning: if config.SleepTimer.action.value == "shutdown": - global inTryQuitMainloop - if config.SleepTimer.ask.value and not inTryQuitMainloop: - Notifications.AddNotificationWithCallback(self.shutdown, MessageBox, _("A sleep timer want's to shut down\nyour Dreambox. Shutdown now?"), timeout = 20) + if config.SleepTimer.ask.value and not Screens.Standby.inTryQuitMainloop: + Notifications.AddNotificationWithCallback(self.shutdown, MessageBox, _("A sleep timer wants to shut down\nyour Dreambox. Shutdown now?"), timeout = 20) else: self.shutdown(True) elif config.SleepTimer.action.value == "standby": - global inStandby - if config.SleepTimer.ask.value and not inStandby: - Notifications.AddNotificationWithCallback(self.standby, MessageBox, _("A sleep timer want's to set your\nDreambox to standby. Do that now?"), timeout = 20) + if config.SleepTimer.ask.value and not Screens.Standby.inStandby: + Notifications.AddNotificationWithCallback(self.standby, MessageBox, _("A sleep timer wants to set your\nDreambox to standby. Do that now?"), timeout = 20) else: self.standby(True) @@ -39,16 +37,14 @@ class SleepTimerEntry(timer.TimerEntry): return False def shutdown(self, answer): - global inTryQuitMainloop if answer is not None: - if answer and not inTryQuitMainloop: - Notifications.AddNotification(TryQuitMainloop, 1) + if answer and not Screens.Standby.inTryQuitMainloop: + Notifications.AddNotification(Screens.Standby.TryQuitMainloop, 1) def standby(self, answer): if answer is not None: - global inStandby - if answer and not inStandby: - Notifications.AddNotification(Standby) + if answer and not Screens.Standby.inStandby: + Notifications.AddNotification(Screens.Standby.Standby) class SleepTimer(timer.Timer): def __init__(self):