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:
authorCampbell Barton <ideasman42@gmail.com>2010-09-17 13:27:31 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-09-17 13:27:31 +0400
commit5452f335d7fd768fda7320419e3581e5309529fe (patch)
treef80553108d8541e2d070c02fe86778494f31c188 /source/blender/makesrna/intern/rna_wm_api.c
parent945ae254092dcbb284072fd4ffcc80b33bff27f6 (diff)
New optional operator function, check(), it takes the same arguments as execute().
This runs after changing a property and allows correcting incompatible options. Returning True will redraw the UI. Currently this is used for setting the write extension when saving files, so changing the image format also corrects the extension. The same is accessible from python where its used when saving SVG/EPS/PNG files. This fixes: [#23828] obj export problems, [#23760] Exporting OBJ and filetype ending also fixed document submission operator. Now the filename in the file selector is the one used for writing this means we remove the "Save Over" popup which could be overlooked too easily. Instead display the filename field with red tint, and a note in the tooltip.
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_wm_api.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c
index b13d7627a34..36dd6efc256 100644
--- a/source/blender/makesrna/intern/rna_wm_api.c
+++ b/source/blender/makesrna/intern/rna_wm_api.c
@@ -165,6 +165,15 @@ void RNA_api_operator(StructRNA *srna)
RNA_def_property_flag(parm, PROP_ENUM_FLAG);
RNA_def_function_return(func, parm);
+ /* check */
+ func= RNA_def_function(srna, "check", NULL);
+ RNA_def_function_ui_description(func, "Check the operator settings.");
+ RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL);
+ RNA_def_pointer(func, "context", "Context", "", "");
+
+ parm= RNA_def_boolean(func, "result", 0, "result", ""); // better name?
+ RNA_def_function_return(func, parm);
+
/* invoke */
func= RNA_def_function(srna, "invoke", NULL);
RNA_def_function_ui_description(func, "Invoke the operator.");