From f2aba01eff3290dca8bb40215c63c67928eab5d6 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 5 Oct 2021 13:32:37 +0200 Subject: [PATCH] Reset page index to 0 when re-opening sync dialogue When the user previously opened the dialog and advanced through the pages, but closes the window, then they'll probably have to restart when they want to try it again. Contributes to issue CURA-8609. --- cura/Machines/Models/MaterialManagementModel.py | 1 + resources/qml/Preferences/Materials/MaterialsSyncDialog.qml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/cura/Machines/Models/MaterialManagementModel.py b/cura/Machines/Models/MaterialManagementModel.py index 31f9bfbc92..8f1d421ffb 100644 --- a/cura/Machines/Models/MaterialManagementModel.py +++ b/cura/Machines/Models/MaterialManagementModel.py @@ -277,6 +277,7 @@ class MaterialManagementModel(QObject): self._sync_all_dialog = cura.CuraApplication.CuraApplication.getInstance().createQmlComponent(qml_path, {}) if self._sync_all_dialog is None: # Failed to load QML file. return + self._sync_all_dialog.setProperty("pageIndex", 0) self._sync_all_dialog.show() @pyqtSlot(result = QUrl) diff --git a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml index 8d7be1e119..88532d20e4 100644 --- a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml +++ b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml @@ -20,6 +20,8 @@ Window height: minimumHeight modality: Qt.ApplicationModal + property alias pageIndex: swipeView.currentIndex + SwipeView { id: swipeView