mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Expose Account.SyncState as an Enum to QML
Provides a single source of truth CURA-7290
This commit is contained in:
parent
8937c63219
commit
1ae050bbc5
5 changed files with 38 additions and 35 deletions
|
@ -10,6 +10,7 @@ from UM.Logger import Logger # To log errors talking to the API.
|
|||
from UM.Message import Message
|
||||
from UM.Signal import Signal
|
||||
from cura.API import Account
|
||||
from cura.API.Account import SyncState
|
||||
from cura.CuraApplication import CuraApplication
|
||||
from cura.Settings.CuraStackBuilder import CuraStackBuilder
|
||||
from cura.Settings.GlobalStack import GlobalStack
|
||||
|
@ -89,7 +90,7 @@ class CloudOutputDeviceManager:
|
|||
Logger.info("Syncing cloud printer clusters")
|
||||
|
||||
self._syncing = True
|
||||
self._account.setSyncState(self.SYNC_SERVICE_NAME, Account.SyncState.SYNCING)
|
||||
self._account.setSyncState(self.SYNC_SERVICE_NAME, SyncState.SYNCING)
|
||||
self._api.getClusters(self._onGetRemoteClustersFinished, self._onGetRemoteClusterFailed)
|
||||
|
||||
def _onGetRemoteClustersFinished(self, clusters: List[CloudClusterResponse]) -> None:
|
||||
|
@ -119,11 +120,11 @@ class CloudOutputDeviceManager:
|
|||
self._connectToActiveMachine()
|
||||
|
||||
self._syncing = False
|
||||
self._account.setSyncState(self.SYNC_SERVICE_NAME, Account.SyncState.SUCCESS)
|
||||
self._account.setSyncState(self.SYNC_SERVICE_NAME, SyncState.SUCCESS)
|
||||
|
||||
def _onGetRemoteClusterFailed(self):
|
||||
self._syncing = False
|
||||
self._account.setSyncState(self.SYNC_SERVICE_NAME, Account.SyncState.ERROR)
|
||||
self._account.setSyncState(self.SYNC_SERVICE_NAME, SyncState.ERROR)
|
||||
|
||||
def _onDevicesDiscovered(self, clusters: List[CloudClusterResponse]) -> None:
|
||||
"""**Synchronously** create machines for discovered devices
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue