No longer create two instances of the setting view.

This caused a bunch of issues with the getPluginId, as one of the instances
didn't got added to the registry (and as such, never got an ID)

CURA-5829
This commit is contained in:
Jaime van Kessel 2018-11-05 11:48:19 +01:00
parent f0e205423f
commit 9f13de9f0d
2 changed files with 2 additions and 2 deletions

View file

@ -210,7 +210,7 @@ Item
target: UM.Preferences target: UM.Preferences
onPreferenceChanged: onPreferenceChanged:
{ {
layerTypeCombobox.currentIndex = UM.SimulationView.compatibilityMode ? 1 : UM.Preferences.getValue("layerview/layer_view_type"); layerTypeCombobox.currentIndex = UM.SimulationView.compatibilityMode ? 1 : UM.Preferences.getValue("layerview/layer_view_type")
layerTypeCombobox.updateLegends(layerTypeCombobox.currentIndex) layerTypeCombobox.updateLegends(layerTypeCombobox.currentIndex)
viewSettings.extruder_opacities = UM.Preferences.getValue("layerview/extruder_opacities").split("|") viewSettings.extruder_opacities = UM.Preferences.getValue("layerview/extruder_opacities").split("|")
viewSettings.show_travel_moves = UM.Preferences.getValue("layerview/show_travel_moves") viewSettings.show_travel_moves = UM.Preferences.getValue("layerview/show_travel_moves")

View file

@ -25,4 +25,4 @@ def createSimulationViewProxy(engine, script_engine):
def register(app): def register(app):
simulation_view = SimulationView.SimulationView() simulation_view = SimulationView.SimulationView()
qmlRegisterSingletonType(SimulationViewProxy.SimulationViewProxy, "UM", 1, 0, "SimulationView", simulation_view.getProxy) qmlRegisterSingletonType(SimulationViewProxy.SimulationViewProxy, "UM", 1, 0, "SimulationView", simulation_view.getProxy)
return { "view": SimulationView.SimulationView()} return { "view": simulation_view}