Reuse welcome dialog item to show whats new upon start

CURA-6447
This commit is contained in:
Lipu Fei 2019-04-17 09:58:05 +02:00
parent a49d00c60e
commit 44a0f00f0b
2 changed files with 5 additions and 14 deletions

View file

@ -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

View file

@ -26,6 +26,7 @@ Item
property int shadowOffset: 1 * screenScaleFactor
property alias progressBarVisible: wizardPanel.progressBarVisible
property var model: CuraApplication.getWelcomePagesModel()
onVisibleChanged: