def update(self): if self.timeout > 0: self.timeout -= 1 self.setInformativeText(_("Shutting in") + " {0}".format(self.timeout)) else: shutdown = Shutdown() if shutdown.start_shutting(): events.trigger_quit()
def check_timeout(self): if self.cancel: return False elif self.timeout > 0: self.timeout -= 1 self.label.set_text(_("Shutting in") + " {0}".format(self.timeout)) return True else: shutdown = Shutdown() if shutdown.start_shutting(): #self.quit() events.trigger_quit() return False