From 3e1b695c430579717029321aa5d69061acde6dd0 Mon Sep 17 00:00:00 2001 From: Nino van Hooff Date: Tue, 12 May 2020 11:55:50 +0200 Subject: [PATCH] Add some missing account sync timer logic CURA-7290 --- cura/API/Account.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cura/API/Account.py b/cura/API/Account.py index c02e685263..4741c4002c 100644 --- a/cura/API/Account.py +++ b/cura/API/Account.py @@ -146,11 +146,18 @@ class Account(QObject): self._error_message.show() self._logged_in = False self.loginStateChanged.emit(False) + if self._update_timer.isActive(): + self._update_timer.stop() return if self._logged_in != logged_in: self._logged_in = logged_in self.loginStateChanged.emit(logged_in) + if logged_in: + self.sync() + else: + if self._update_timer.isActive(): + self._update_timer.stop() @pyqtSlot() def login(self) -> None: @@ -192,8 +199,14 @@ class Account(QObject): @pyqtSlot() def sync(self) -> None: - """Checks for new cloud printers""" + """Signals all sync services to start syncing + This can be considered a forced sync: even when a + sync is currently running, a sync will be requested. + """ + + if self._update_timer.isActive(): + self._update_timer.stop() self.syncRequested.emit() @pyqtSlot()