CURA-5253 Initialize UI elements right after the qml files were loaded.

This commit is contained in:
Diego Prado Gesto 2018-04-30 15:09:52 +02:00
parent 90eb4eb651
commit b582ac7526
2 changed files with 9 additions and 8 deletions

View File

@ -724,12 +724,6 @@ class CuraApplication(QtApplication):
controller = self.getController() controller = self.getController()
# Initialize UI state
controller.setActiveStage("PrepareStage")
controller.setActiveView("SolidView")
controller.setCameraTool("CameraTool")
controller.setSelectionTool("SelectionTool")
t = controller.getTool("TranslateTool") t = controller.getTool("TranslateTool")
if t: if t:
t.setEnabledAxis([ToolHandle.XAxis, ToolHandle.YAxis, ToolHandle.ZAxis]) t.setEnabledAxis([ToolHandle.XAxis, ToolHandle.YAxis, ToolHandle.ZAxis])
@ -766,8 +760,11 @@ class CuraApplication(QtApplication):
self._qml_import_paths.append(Resources.getPath(self.ResourceTypes.QmlFiles)) self._qml_import_paths.append(Resources.getPath(self.ResourceTypes.QmlFiles))
self.initializeEngine() self.initializeEngine()
# Make sure the correct stage is activated after QML is loaded # Initialize UI state
controller.setActiveStage("PrepareStage") controller.setActiveStage("PrepareStage")
controller.setActiveView("SolidView")
controller.setCameraTool("CameraTool")
controller.setSelectionTool("SelectionTool")
# Hide the splash screen # Hide the splash screen
self.closeSplash() self.closeSplash()

View File

@ -201,7 +201,11 @@ Rectangle
// the connection to UM.ActiveView will trigger update so there is no reason to call it manually here // the connection to UM.ActiveView will trigger update so there is no reason to call it manually here
} }
onCurrentIndexChanged: viewModeButton.setActiveIndex(model.getItem(currentIndex).id) onCurrentIndexChanged:
{
if (model.getItem(currentIndex).id != undefined)
viewModeButton.setActiveIndex(model.getItem(currentIndex).id)
}
currentIndex: getActiveIndex() currentIndex: getActiveIndex()
// watch the active view proxy for changes made from the menu item // watch the active view proxy for changes made from the menu item