mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 01:37:51 -06:00
Fix visibilty preset update
CURA-5088
This commit is contained in:
parent
90fa49b6a1
commit
f0dc138b37
2 changed files with 7 additions and 12 deletions
|
@ -165,14 +165,18 @@ class SettingVisibilityPresetsModel(ListModel):
|
||||||
matching_preset_item = item
|
matching_preset_item = item
|
||||||
break
|
break
|
||||||
|
|
||||||
|
item_to_set = self._active_preset_item
|
||||||
if matching_preset_item is None:
|
if matching_preset_item is None:
|
||||||
# The new visibility setup is "custom" should be custom
|
# The new visibility setup is "custom" should be custom
|
||||||
if self._active_preset_item["id"] == "custom":
|
if self._active_preset_item["id"] == "custom":
|
||||||
# We are already in custom, just save the settings
|
# We are already in custom, just save the settings
|
||||||
self._preferences.setValue("cura/custom_visible_settings", visibility_string)
|
self._preferences.setValue("cura/custom_visible_settings", visibility_string)
|
||||||
else:
|
else:
|
||||||
self._active_preset_item = self.items[0] # 0 is custom
|
item_to_set = self.items[0] # 0 is custom
|
||||||
self.activePresetChanged.emit()
|
|
||||||
else:
|
else:
|
||||||
self._active_preset_item = matching_preset_item
|
item_to_set = matching_preset_item
|
||||||
|
|
||||||
|
if self._active_preset_item is None or self._active_preset_item["id"] != item_to_set["id"]:
|
||||||
|
self._active_preset_item = item_to_set
|
||||||
|
self._preferences.setValue("cura/active_setting_visibility_preset", self._active_preset_item["id"])
|
||||||
self.activePresetChanged.emit()
|
self.activePresetChanged.emit()
|
||||||
|
|
|
@ -78,15 +78,6 @@ UM.PreferencesPage
|
||||||
{
|
{
|
||||||
definitionsModel.setAllExpandedVisible(false)
|
definitionsModel.setAllExpandedVisible(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// After change set "Custom" option
|
|
||||||
|
|
||||||
// If already "Custom" then don't do nothing
|
|
||||||
if (visibilityPreset.currentIndex != visibilityPreset.model.count - 1)
|
|
||||||
{
|
|
||||||
visibilityPreset.currentIndex = visibilityPreset.model.count - 1
|
|
||||||
UM.Preferences.setValue("cura/active_setting_visibility_preset", visibilityPreset.model.getItem(visibilityPreset.currentIndex).id)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue