- self.session.nav.SleepTimer.setSleepTime(int(self["input"].getText()))
- self.session.openWithCallback(self.close, MessageBox, _("The sleep timer has been acitvated."), MessageBox.TYPE_INFO)
-
+ if self.status:
+ time = int(self["input"].getText())
+ config.SleepTimer.defaulttime.setValue(time)
+ self.session.nav.SleepTimer.setSleepTime(time)
+ self.session.openWithCallback(self.close, MessageBox, _("The sleep timer has been activated."), MessageBox.TYPE_INFO)
+ else:
+ self.session.nav.SleepTimer.clear()
+ self.session.openWithCallback(self.close, MessageBox, _("The sleep timer has been disabled."), MessageBox.TYPE_INFO)
+