From 9e5ad281d5bc0e8112537147031988ed9f4464fe Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Fri, 1 Sep 2023 16:58:21 +0200 Subject: [PATCH] Do not restore add printer dialog size CURA-10896 --- resources/qml/Cura.qml | 31 ++++++++++++++------- resources/qml/WelcomePages/WizardDialog.qml | 5 ---- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 497e90c9b6..4983363946 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -822,14 +822,26 @@ UM.MainWindow } } - Cura.WizardDialog + property var wizardDialog + Component { - id: addMachineDialog - title: catalog.i18nc("@title:window", "Add Printer") - maximumWidth: Screen.width * 2 - maximumHeight: Screen.height * 2 - model: CuraApplication.getAddPrinterPagesModel() - progressBarVisible: false + id: addMachineDialogLoader + + Cura.WizardDialog + { + title: catalog.i18nc("@title:window", "Add Printer") + maximumWidth: Screen.width * 2 + maximumHeight: Screen.height * 2 + model: CuraApplication.getAddPrinterPagesModel() + progressBarVisible: false + onVisibleChanged: + { + if(!visible) + { + wizardDialog = null + } + } + } } Cura.WizardDialog @@ -854,9 +866,8 @@ UM.MainWindow target: Cura.Actions.addMachine function onTriggered() { - // Make sure to show from the first page when the dialog shows up. - addMachineDialog.resetModelState() - addMachineDialog.show() + wizardDialog = addMachineDialogLoader.createObject() + wizardDialog.show() } } diff --git a/resources/qml/WelcomePages/WizardDialog.qml b/resources/qml/WelcomePages/WizardDialog.qml index 8629f47115..387289052b 100644 --- a/resources/qml/WelcomePages/WizardDialog.qml +++ b/resources/qml/WelcomePages/WizardDialog.qml @@ -32,11 +32,6 @@ Window property var model: null // Needs to be set by whoever is using this dialog. property alias progressBarVisible: wizardPanel.progressBarVisible - function resetModelState() - { - model.resetState() - } - WizardPanel { id: wizardPanel