diff --git a/cura/UI/WelcomePagesModel.py b/cura/UI/WelcomePagesModel.py index a3aae49ed7..cb47b37bfc 100644 --- a/cura/UI/WelcomePagesModel.py +++ b/cura/UI/WelcomePagesModel.py @@ -76,6 +76,12 @@ class WelcomePagesModel(ListModel): self._current_page_index = page_index self.currentPageIndexChanged.emit() + # Ends the Welcome-Pages. Put as a separate function for cases like the 'decline' in the User-Agreement. + @pyqtSlot() + def atEnd(self) -> None: + self.allFinished.emit() + self.resetState() + # Goes to the next page. # If "from_index" is given, it will look for the next page to show starting from the "from_index" page instead of # the "self._current_page_index". @@ -100,8 +106,7 @@ class WelcomePagesModel(ListModel): # If we have reached the last page, emit allFinished signal and reset. if next_page_index == len(self._items): - self.allFinished.emit() - self.resetState() + self.atEnd() return # Check if the this page should be shown (default yes), if not, keep looking for the next one. diff --git a/resources/qml/WelcomePages/UserAgreementContent.qml b/resources/qml/WelcomePages/UserAgreementContent.qml index 2f4b2a0290..62e30ebbf7 100644 --- a/resources/qml/WelcomePages/UserAgreementContent.qml +++ b/resources/qml/WelcomePages/UserAgreementContent.qml @@ -83,7 +83,7 @@ Item onClicked: { CuraApplication.writeToLog("i", "User declined the User Agreement.") - base.passLastPage() + base.endWizard() CuraApplication.closeApplication() // NOTE: Hard exit, don't use if anything needs to be saved! } } diff --git a/resources/qml/WelcomePages/WizardPanel.qml b/resources/qml/WelcomePages/WizardPanel.qml index 51b131409e..94fb083664 100644 --- a/resources/qml/WelcomePages/WizardPanel.qml +++ b/resources/qml/WelcomePages/WizardPanel.qml @@ -28,11 +28,13 @@ Item signal showNextPage() signal showPreviousPage() signal goToPage(string page_id) // Go to a specific page by the given page_id. + signal endWizard() // Call the corresponding functions in the model onShowNextPage: model.goToNextPage() onShowPreviousPage: model.goToPreviousPage() onGoToPage: model.goToPage(page_id) + onEndWizard: model.atEnd() Rectangle // Panel background {