Show 'Done' button when sync was successful

And make it close the window when pressed then.

Contributes to issue CURA-8609.
This commit is contained in:
Ghostkeeper 2021-10-12 17:34:34 +02:00
parent 5b14792c76
commit bfb8d9ddf1
No known key found for this signature in database
GPG Key ID: 68F39EA88EEED5FF

View File

@ -452,8 +452,29 @@ Window
{
id: syncButton
anchors.right: parent.right
text: (typeof syncModel !== "undefined" && syncModel.exportUploadStatus == "error") ? catalog.i18nc("@button", "Try again") : catalog.i18nc("@button", "Sync")
onClicked: syncModel.exportUpload()
text:
{
if(typeof syncModel !== "undefined" && syncModel.exportUploadStatus == "error")
{
return catalog.i18nc("@button", "Try again");
}
if(typeof syncModel !== "undefined" && syncModel.exportUploadStatus == "success")
{
return catalog.i18nc("@button", "Done");
}
return catalog.i18nc("@button", "Sync");
}
onClicked:
{
if(typeof syncModel !== "undefined" && syncModel.exportUploadStatus == "success")
{
materialsSyncDialog.close();
}
else
{
syncModel.exportUpload();
}
}
visible:
{
if(!syncModel) //When the dialog is created, this is not set yet.