mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-09-13 20:43:16 +08:00
Fix visibilty preset update
CURA-5088
This commit is contained in:
parent
90fa49b6a1
commit
f0dc138b37
@ -165,14 +165,18 @@ class SettingVisibilityPresetsModel(ListModel):
|
||||
matching_preset_item = item
|
||||
break
|
||||
|
||||
item_to_set = self._active_preset_item
|
||||
if matching_preset_item is None:
|
||||
# The new visibility setup is "custom" should be custom
|
||||
if self._active_preset_item["id"] == "custom":
|
||||
# We are already in custom, just save the settings
|
||||
self._preferences.setValue("cura/custom_visible_settings", visibility_string)
|
||||
else:
|
||||
self._active_preset_item = self.items[0] # 0 is custom
|
||||
self.activePresetChanged.emit()
|
||||
item_to_set = self.items[0] # 0 is custom
|
||||
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()
|
||||
|
@ -78,15 +78,6 @@ UM.PreferencesPage
|
||||
{
|
||||
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…
x
Reference in New Issue
Block a user