diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 73b350d75f..58906be9d6 100644 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -50,6 +50,8 @@ class MachineManager(QObject): Preferences.getInstance().addPreference("cura/active_machine", "") + self._global_event_keys = set() + active_machine_id = Preferences.getInstance().getValue("cura/active_machine") self._printer_output_devices = [] @@ -199,6 +201,10 @@ class MachineManager(QObject): def _onGlobalPropertyChanged(self, key, property_name): if property_name == "value": + ## We can get recursion issues. So we store a list of keys that we are still handling to prevent this. + if key in self._global_event_keys: + return + self._global_event_keys.add(key) self.globalValueChanged.emit() if self._active_container_stack and self._active_container_stack != self._global_container_stack: @@ -220,8 +226,6 @@ class MachineManager(QObject): # Remove from the value from the other stacks as well, unless the # top value from the other stacklevels is different than the new value for container in extruder_stack.getContainers(): - if container == extruder_stack.getTop(): - continue if container.__class__ == UM.Settings.InstanceContainer and container.getInstance(key) != None: if container.getProperty(key, "value") != new_value: extruder_stack.getTop().setProperty(key, "value", new_value) @@ -231,6 +235,7 @@ class MachineManager(QObject): if self._global_container_stack.getProperty(key, "value") != new_value: self._global_container_stack.getTop().setProperty(key, "value", new_value) + self._global_event_keys.remove(key) if property_name == "global_inherits_stack": if self._active_container_stack and self._active_container_stack != self._global_container_stack: @@ -254,7 +259,6 @@ class MachineManager(QObject): if not has_errors: self._global_stack_valid = True self.globalValidationChanged.emit() - def _onGlobalContainerChanged(self): if self._global_container_stack: self._global_container_stack.nameChanged.disconnect(self._onMachineNameChanged) diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index cef5f86b33..957a68b94c 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -60,8 +60,6 @@ ScrollView property var settingDefinitionsModel: definitionsModel property var propertyProvider: provider - property var stackId: ExtruderManager.activeExtruderStackId ? ExtruderManager.activeExtruderStackId : Cura.MachineManager.activeMachineId - //Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989 //In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes, //causing nasty issues when selecting different options. So disable asynchronous loading of enum type completely.