Inform the Cloud page about new cloud printers

Properly close the welcome screen if the user has signed in and has
cloud printers linked to his/her account. If he doesn't have any, move
to the next page of the welcome wizard.

CURA-7019
This commit is contained in:
Kostas Karmas 2020-04-23 09:59:32 +02:00
parent 1262d1f641
commit 1602b71841
3 changed files with 19 additions and 12 deletions

View file

@ -29,10 +29,12 @@ class Account(QObject):
# Signal emitted when user logged in or out.
loginStateChanged = pyqtSignal(bool)
accessTokenChanged = pyqtSignal()
cloudPrintersDetectedChanged = pyqtSignal(bool)
def __init__(self, application: "CuraApplication", parent = None) -> None:
super().__init__(parent)
self._application = application
self._new_cloud_printers_detected = False
self._error_message = None # type: Optional[Message]
self._logged_in = False
@ -74,6 +76,10 @@ class Account(QObject):
def isLoggedIn(self) -> bool:
return self._logged_in
@pyqtProperty(bool, notify=cloudPrintersDetectedChanged)
def newCloudPrintersDetected(self) -> bool:
return self._new_cloud_printers_detected
def _onLoginStateChanged(self, logged_in: bool = False, error_message: Optional[str] = None) -> None:
if error_message:
if self._error_message: