comparison cagou/core/cagou_main.py @ 272:c4990a7d5dbd

core: check if resync exist in widget before calling it
author Goffi <goffi@goffi.org>
date Wed, 20 Mar 2019 09:29:44 +0100
parents 896f78760b63
children 7d5297984191
comparison
equal deleted inserted replaced
271:23d4358803c7 272:c4990a7d5dbd
436 QuickApp.sync.fset(self, state) 436 QuickApp.sync.fset(self, state)
437 # widget are resynchronised in onVisible event, 437 # widget are resynchronised in onVisible event,
438 # so we must call resync for widgets which are already visible 438 # so we must call resync for widgets which are already visible
439 if state: 439 if state:
440 for w in self.visible_widgets: 440 for w in self.visible_widgets:
441 w.resync() 441 try:
442 resync = w.resync
443 except AttributeError:
444 pass
445 else:
446 resync()
442 447
443 def onBridgeConnected(self): 448 def onBridgeConnected(self):
444 super(Cagou, self).onBridgeConnected() 449 super(Cagou, self).onBridgeConnected()
445 self.registerSignal("otrState", iface="plugin") 450 self.registerSignal("otrState", iface="plugin")
446 self.bridge.getReady(self.onBackendReady) 451 self.bridge.getReady(self.onBackendReady)