Fix keymap editing not tagging dirty

Partial fix for T65629
This commit is contained in:
Campbell Barton 2019-07-01 16:09:21 +10:00
parent 6f61b6aa44
commit c74626c54f
Notes: blender-bot 2023-02-14 03:31:57 +01:00
Referenced by issue #65629, Modifying keymap won't tag prefs dirty
2 changed files with 5 additions and 1 deletions

View File

@ -286,6 +286,7 @@ class PREFERENCES_OT_keymap_restore(Operator):
km = context.keymap
km.restore_to_default()
context.preferences.is_dirty = True
return {'FINISHED'}
@ -333,6 +334,7 @@ class PREFERENCES_OT_keyitem_add(Operator):
km.show_expanded_items = True
km.show_expanded_children = True
context.preferences.is_dirty = True
return {'FINISHED'}
@ -354,6 +356,8 @@ class PREFERENCES_OT_keyitem_remove(Operator):
km = context.keymap
kmi = km.keymap_items.from_id(self.item_id)
km.keymap_items.remove(kmi)
context.preferences.is_dirty = True
return {'FINISHED'}

View File

@ -5808,8 +5808,8 @@ void RNA_def_userdef(BlenderRNA *brna)
prop = RNA_def_property(srna, "is_dirty", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "runtime.is_dirty", 0);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Dirty", "Preferences have changed");
RNA_def_property_update(prop, 0, "rna_userdef_ui_update");
rna_def_userdef_view(brna);
rna_def_userdef_edit(brna);