From 44a0f00f0b32e9f2e78632bc1c8a98551b191fef Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 17 Apr 2019 09:58:05 +0200 Subject: [PATCH] Reuse welcome dialog item to show whats new upon start CURA-6447 --- resources/qml/Cura.qml | 18 ++++-------------- .../qml/WelcomePages/WelcomeDialogItem.qml | 1 + 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index 1b05b6987a..f5cbe8ad53 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -100,26 +100,16 @@ UM.MainWindow welcomeDialogItem.visible = false } + // Reuse the welcome dialog item to show "What's New" only. if (CuraApplication.shouldShowWhatsNewDialog()) { - showWhatsNewDialogTimer.start() + welcomeDialogItem.model = CuraApplication.getWhatsNewPagesModel() + welcomeDialogItem.progressBarVisible = false + welcomeDialogItem.visible = true } } } - // HACK: Use a timer here because if we call "Cura.Actions.whatsNew.trigger()" or "whatsNewDialog.show()" when - // the component gets completed or when the application finishes its initialization, the main window has not been - // fully initialized yet. If we should the dialog before the main window is fully initialized, you will see the - // dialog first but when the main windows is fully initialized, the dialog will disappear. Adding a timer here is - // to bypass this problem. - Timer - { - id: showWhatsNewDialogTimer - repeat: false - interval: 1000 - onTriggered: Cura.Actions.whatsNew.trigger() - } - Item { id: backgroundItem diff --git a/resources/qml/WelcomePages/WelcomeDialogItem.qml b/resources/qml/WelcomePages/WelcomeDialogItem.qml index 1ab722598b..7da4c6e897 100644 --- a/resources/qml/WelcomePages/WelcomeDialogItem.qml +++ b/resources/qml/WelcomePages/WelcomeDialogItem.qml @@ -26,6 +26,7 @@ Item property int shadowOffset: 1 * screenScaleFactor + property alias progressBarVisible: wizardPanel.progressBarVisible property var model: CuraApplication.getWelcomePagesModel() onVisibleChanged: