Change button to 'done' once USB export has completed

Also important to keep in mind: It won't change to 'done' if the user cancelled the file dialogue.

Contributes to issue CURA-8609.
This commit is contained in:
Ghostkeeper 2021-10-29 15:06:44 +02:00
parent 6c416742fb
commit c58d03ad4c
No known key found for this signature in database
GPG Key ID: D2A8871EE34EC59A

View File

@ -682,12 +682,22 @@ Window
}
Cura.PrimaryButton
{
id: exportUsbButton
anchors.right: parent.right
text: catalog.i18nc("@button", "Export material archive")
property bool hasExported: false
text: hasExported ? catalog.i18nc("@button", "Done") : catalog.i18nc("@button", "Export material archive")
onClicked:
{
exportUsbDialog.folder = syncModel.getPreferredExportAllPath();
exportUsbDialog.open();
if(!hasExported)
{
exportUsbDialog.folder = syncModel.getPreferredExportAllPath();
exportUsbDialog.open();
}
else
{
materialsSyncDialog.close();
}
}
}
}
@ -719,6 +729,7 @@ Window
{
syncModel.exportAll(fileUrl);
CuraApplication.setDefaultPath("dialog_material_path", folder);
exportUsbButton.hasExported = true;
}
}
}