mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 15:13:56 -06:00
Implement syncing feature for Ultimaker account
Updated account syncing functionality for logged-in and non-logged-in sessions in Ultimaker. More specifically, syncing is now engaged when the UI becomes visible and stopped when adding a machine action is triggered. The modifications also include fallback to login if the user is not logged in. CURA-11465
This commit is contained in:
parent
f89d4ddb4c
commit
c3b0fa5bd3
3 changed files with 17 additions and 1 deletions
|
@ -190,6 +190,20 @@ class Account(QObject):
|
|||
def isLoggedIn(self) -> bool:
|
||||
return self._logged_in
|
||||
|
||||
@pyqtSlot()
|
||||
def stopSyncing(self) -> None:
|
||||
Logger.debug(f"Stopping sync of cloud printers")
|
||||
self._setManualSyncEnabled(True)
|
||||
if self._update_timer.isActive():
|
||||
self._update_timer.stop()
|
||||
|
||||
@pyqtSlot()
|
||||
def startSyncing(self) -> None:
|
||||
Logger.debug(f"Starting sync of cloud printers")
|
||||
self._setManualSyncEnabled(False)
|
||||
if not self._update_timer.isActive():
|
||||
self._update_timer.start()
|
||||
|
||||
def _onLoginStateChanged(self, logged_in: bool = False, error_message: Optional[str] = None) -> None:
|
||||
if error_message:
|
||||
if self._error_message:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue