mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
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.
This commit is contained in:
parent
dc1ee1d73b
commit
64aa977696
1 changed files with 5 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue