Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Poirier <theeth@yahoo.com>2010-01-28 22:54:06 +0300
committerMartin Poirier <theeth@yahoo.com>2010-01-28 22:54:06 +0300
commitb81cb0200ba11a1f656712fd521c47e8e3a192b8 (patch)
tree7b8dbe8fb68060cfc4b27057aed5b2c2cc23035f /source/blender/makesrna/intern/rna_wm_api.c
parent6f3dfe81c0ff9d998528df7cc4bf94965270ed10 (diff)
Keyconfig import and remove
- Keyconfig are now marked as user_defined when it is the case - Import keyconfig operator: select an exported keyconfig .py file, copies it to the scripts folder (keep the original copy if wanted, default True), imports and select as active config. The active keyconfig is stored in the user default file, so that still has to be saved after import. - Remove keyconfig operator and button next to the keyconfig name (poll False if not user_defined). Removes the keyconfig from the list and deletes the file from the folder. Remaining bug: The file is copied in the user defined script folder (if present) or the /scripts/ui folder. The problem is that it might be imported before operators defined in python are imported themselves. One solution would be to use a separate folder for keyconfigs that is imported after all others.
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_wm_api.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c
index 3fa646598d6..9759e72165a 100644
--- a/source/blender/makesrna/intern/rna_wm_api.c
+++ b/source/blender/makesrna/intern/rna_wm_api.c
@@ -182,12 +182,16 @@ void RNA_api_wm(StructRNA *srna)
RNA_def_function_ui_description(func, "Show up the file selector.");
rna_generic_op_invoke(func, 0, 0);
- func= RNA_def_function(srna, "add_keyconfig", "WM_keyconfig_add");
+ func= RNA_def_function(srna, "add_keyconfig", "WM_keyconfig_add_user");
parm= RNA_def_string(func, "name", "", 0, "Name", "");
RNA_def_property_flag(parm, PROP_REQUIRED);
parm= RNA_def_pointer(func, "keyconfig", "KeyConfig", "Key Configuration", "Added key configuration.");
RNA_def_function_return(func, parm);
+ func= RNA_def_function(srna, "remove_keyconfig", "WM_keyconfig_remove");
+ parm= RNA_def_pointer(func, "keyconfig", "KeyConfig", "Key Configuration", "Removed key configuration.");
+ RNA_def_property_flag(parm, PROP_REQUIRED);
+
/* invoke functions, for use with python */
func= RNA_def_function(srna, "invoke_props_popup", "WM_operator_props_popup");
RNA_def_function_ui_description(func, "Operator popup invoke.");