# HG changeset patch # User Tuomo Valkonen # Date 1638731281 -7200 # Node ID a1c97bc1789edacb216874c6ff934c8e9b3941ba # Parent a70ba964f455a72f88f2aa3c99ecb40adc0b7e90 Sleep wake callback hadn't been updated to menu refresh code changes. Fixed. diff -r a70ba964f455 -r a1c97bc1789e borgend/ui.py --- a/borgend/ui.py Sun Dec 05 15:25:51 2021 +0200 +++ b/borgend/ui.py Sun Dec 05 21:08:01 2021 +0200 @@ -324,8 +324,16 @@ return itemlist, title + def __schedule_refresh(self): + self.updated_recently=True + # Time the refresh if it has not been timed, or if the timer + # is timing for the "long-term" (refresh_timer_time set) + if self.refresh_timer.interval>refresh_interval: + self.refresh_timer.stop() + self.refresh_timer.interval=refresh_interval + self.refresh_timer.start() + # Callbacks -- exception-protected to get any indications of errors - @protect_noreturn def __refresh_callback(self, timer): with self.lock: @@ -336,13 +344,7 @@ logger.debug("Tray status callback") with self.lock: self.statuses[index]=status - self.updated_recently=True - # Time the refresh if it has not been timed, or if the timer - # is timing for the "long-term" (refresh_timer_time set) - if self.refresh_timer.interval>refresh_interval: - self.refresh_timer.stop() - self.refresh_timer.interval=refresh_interval - self.refresh_timer.start() + self.__schedule_refresh() # if errorlog: # if 'msgid' not in errorlog or not isinstance(errorlog['msgid'], str): @@ -377,7 +379,8 @@ @protect_noreturn def __sleepwake_callback(self, woke): if woke: - self.refresh_ui() + with self.lock: + self.__schedule_refresh() @protect_noreturn def quit(self):