From 64aa9776960675689acfcf23cccfffadae3f4c59 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 24 Feb 2016 13:05:21 +0100 Subject: [PATCH] Properly update global_only on profile switch In the setting override model for per-object settings now gets its global_only property also updated on a profile switch. This is needed because the settings also change during a profile switch but the change event is not triggered. Contributes to issue CURA-458. --- plugins/PerObjectSettingsTool/SettingOverrideModel.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/PerObjectSettingsTool/SettingOverrideModel.py b/plugins/PerObjectSettingsTool/SettingOverrideModel.py index c5e4200a75..860650015c 100644 --- a/plugins/PerObjectSettingsTool/SettingOverrideModel.py +++ b/plugins/PerObjectSettingsTool/SettingOverrideModel.py @@ -83,9 +83,13 @@ class SettingOverrideModel(ListModel): def _onProfileChanged(self): if self._activeProfile: #Unlink from the old profile. self._activeProfile.settingValueChanged.disconnect(self._onProfileSettingValueChanged) + old_profile = self._activeProfile self._activeProfile = Application.getInstance().getMachineManager().getWorkingProfile() self._activeProfile.settingValueChanged.connect(self._onProfileSettingValueChanged) #Re-link to the new profile. - self._onProfileSettingValueChanged() #Also update the settings for the new profile! + for setting_name in old_profile.getChangedSettings().keys(): #Update all changed settings in the old and new profiles. + self._onProfileSettingValueChanged(setting_name) + for setting_name in self._activeProfile.getChangedSettings().keys(): + self._onProfileSettingValueChanged(setting_name) ## Updates the global_only property of a setting once a setting value # changes.