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.
This commit is contained in:
Arjen Hiemstra 2015-09-24 19:16:18 +02:00
parent ca7ed0d93e
commit c486794f33
2 changed files with 18 additions and 7 deletions

View File

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

View File

@ -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();
}
}
}
}