[Bf-blender-cvs] [c74626c54fa] master: Fix keymap editing not tagging dirty
Campbell Barton
noreply at git.blender.org
Mon Jul 1 08:12:10 CEST 2019
Commit: c74626c54fadc55c9291b12c8c354a3a978eb286
Author: Campbell Barton
Date: Mon Jul 1 16:09:21 2019 +1000
Branches: master
https://developer.blender.org/rBc74626c54fadc55c9291b12c8c354a3a978eb286
Fix keymap editing not tagging dirty
Partial fix for T65629
===================================================================
M release/scripts/startup/bl_operators/userpref.py
M source/blender/makesrna/intern/rna_userdef.c
===================================================================
diff --git a/release/scripts/startup/bl_operators/userpref.py b/release/scripts/startup/bl_operators/userpref.py
index 706afc6dcf8..152dab23dcf 100644
--- a/release/scripts/startup/bl_operators/userpref.py
+++ b/release/scripts/startup/bl_operators/userpref.py
@@ -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'}
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index bfdb55800a2..8a9b8a14563 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -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);
More information about the Bf-blender-cvs
mailing list