borgend/ui.py

changeset 101
3068b0de12ee
parent 99
281bab8361c8
child 105
55043f86c0b5
equal deleted inserted replaced
100:b141bed9e718 101:3068b0de12ee
206 # See also http://math.andrej.com/2009/04/09/pythons-lambda-is-broken/ 206 # See also http://math.andrej.com/2009/04/09/pythons-lambda-is-broken/
207 cb=(lambda status, errorlog=None, _index=index: 207 cb=(lambda status, errorlog=None, _index=index:
208 self.__status_callback(_index, status, errorlog=errorlog)) 208 self.__status_callback(_index, status, errorlog=errorlog))
209 backups[index].set_status_update_callback(cb) 209 backups[index].set_status_update_callback(cb)
210 210
211 dreamtime.add_callback(self, self.refresh_ui) 211 dreamtime.add_callback(self, self.__sleepwake_callback)
212 212
213 def __rebuild_menu(self): 213 def __rebuild_menu(self):
214 menu=[] 214 menu=[]
215 state=(backup.State.INACTIVE, backup.Errors.OK) 215 state=(backup.State.INACTIVE, backup.Errors.OK)
216 need_reconstruct=None 216 need_reconstruct=None
302 logger.debug("Opening notification for error %s '%s'", 302 logger.debug("Opening notification for error %s '%s'",
303 msgid, errorlog['message']) 303 msgid, errorlog['message'])
304 304
305 notification_workaround(branding.appname_stylised, 305 notification_workaround(branding.appname_stylised,
306 msgid, errorlog['message']) 306 msgid, errorlog['message'])
307
308 def __sleepwake_callback(self, woke):
309 if woke:
310 self.refresh_ui()
307 311
308 def pause_resume_all(self): 312 def pause_resume_all(self):
309 with self.lock: 313 with self.lock:
310 try: 314 try:
311 all_paused=True 315 all_paused=True

mercurial