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

@ -15,14 +15,18 @@ Item
{
UM.I18nCatalog { id: catalog; name: "cura" }
property bool isLoggedIn: Cura.API.account.isLoggedIn
property bool newCloudPrintersDetected: Cura.API.account.newCloudPrintersDetected
onIsLoggedInChanged:
onNewCloudPrintersDetectedChanged:
{
if(isLoggedIn)
// When the user signs in successfully, it will be checked whether he/she has cloud printers connected to
// the account. If he/she does, then the welcome wizard can close. If not, then proceed to the next page (if any)
if(newCloudPrintersDetected)
{
base.endWizard()
}
else
{
// If the user created an account or logged in by pressing any button on this page, all the actions that
// need / can be done by this page are completed, so we can just go to the next (if any).
base.showNextPage()
}
}