From c486794f33a4d2eec2fd2fb22a51d3531df97753 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 24 Sep 2015 19:16:18 +0200 Subject: [PATCH] Delay showing the Add Machine dialog until after the main window is properly shown Showing the main window causes the Add Machine window to hide apparently so instead make sure we show the add machine dialog after showing the main window. This also handles the "there is no machine" situation a little more cleanly. --- cura/CuraApplication.py | 5 ----- resources/qml/Cura.qml | 20 ++++++++++++++++++-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index a3ed5b2bf9..74c1ee49da 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -173,11 +173,6 @@ class CuraApplication(QtApplication): self.setMainQml(Resources.getPath(self.ResourceTypes.QmlFiles, "Cura.qml")) self.initializeEngine() - manager = self.getMachineManager() - if not self.getMachineManager().getMachineInstances(): - self.requestAddPrinter.emit() - - if self._engine.rootObjects: self.closeSplash() diff --git a/resources/qml/Cura.qml b/resources/qml/Cura.qml index ebfebdd761..8fe6fb7587 100644 --- a/resources/qml/Cura.qml +++ b/resources/qml/Cura.qml @@ -652,14 +652,30 @@ UM.MainWindow onRequestAddPrinter: { addMachineWizard.visible = true - addMachineWizard.firstRun = true + addMachineWizard.firstRun = false } } Component.onCompleted: { UM.Theme.load(UM.Resources.getPath(UM.Resources.Themes, "cura")) - base.visible = true; + visible = true; + addMachineTimer.start(); + } + + Timer + { + id: addMachineTimer; + interval: 100; + repeat: false; + onTriggered: + { + if(UM.MachineManager.activeMachineInstance == "") + { + addMachineWizard.firstRun = true; + addMachineWizard.open(); + } + } } }