UI: clarify auto-save preference

- Grey out the option when factory settings have been loaded.
- Note it it's tool-top that it's ignored when factory settings
  have been loaded.

Suggestions by @JulienKaspar
This commit is contained in:
Campbell Barton 2019-08-11 17:51:09 +10:00
parent 22cdadaa32
commit 18ba66d75e
2 changed files with 7 additions and 2 deletions

View File

@ -86,7 +86,9 @@ class USERPREF_MT_save_load(Menu):
prefs = context.preferences
layout.prop(prefs, "use_preferences_save", text="Auto-Save Preferences")
row = layout.row()
row.active = not bpy.app.use_userpref_skip_save_on_exit
row.prop(prefs, "use_preferences_save", text="Auto-Save Preferences")
layout.separator()

View File

@ -5820,7 +5820,10 @@ void RNA_def_userdef(BlenderRNA *brna)
/* Preferences Flags */
prop = RNA_def_property(srna, "use_preferences_save", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "pref_flag", USER_PREF_FLAG_SAVE);
RNA_def_property_ui_text(prop, "Save on Exit", "Save preferences on exit when modified");
RNA_def_property_ui_text(prop,
"Save on Exit",
"Save preferences on exit when modified "
"(unless factory settings have been loaded)");
prop = RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "runtime.is_dirty", 0);