comparison sat_frontends/quick_frontend/quick_app.py @ 2898:fc78d53f0ffa

quick frontend (app): added debug logs on sync state change + refill contact lists on resync when AUTO_RESYNC is set
author Goffi <goffi@goffi.org>
date Sun, 07 Apr 2019 21:06:57 +0200
parents c7c52c0dc13a
children 5b0f897689b7
comparison
equal deleted inserted replaced
2897:82d8243e6ad1 2898:fc78d53f0ffa
457 @param state(bool): True: if the backend is resynchronising 457 @param state(bool): True: if the backend is resynchronising
458 False when we lose synchronisation, for instance if frontend is going to sleep 458 False when we lose synchronisation, for instance if frontend is going to sleep
459 or if connection has been lost and a reconnection is needed 459 or if connection has been lost and a reconnection is needed
460 """ 460 """
461 if state: 461 if state:
462 log.debug(u"we are synchronised with server")
462 if self.AUTO_RESYNC: 463 if self.AUTO_RESYNC:
463 # we are resynchronising all widgets 464 # we are resynchronising all widgets
465 log.debug(u"doing a full widgets resynchronisation")
464 for w in self.widgets: 466 for w in self.widgets:
465 try: 467 try:
466 resync = w.resync 468 resync = w.resync
467 except AttributeError: 469 except AttributeError:
468 pass 470 pass
469 else: 471 else:
470 resync() 472 resync()
473 self.contact_lists.fill()
474
471 self._sync = state 475 self._sync = state
472 else: 476 else:
477 log.debug(u"we have lost synchronisation with server")
473 self._sync = state 478 self._sync = state
474 # we've lost synchronisation, all widgets must be notified 479 # we've lost synchronisation, all widgets must be notified
475 # note: this is always called independently of AUTO_RESYNC 480 # note: this is always called independently of AUTO_RESYNC
476 for w in self.widgets: 481 for w in self.widgets:
477 try: 482 try: