diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-17 13:27:31 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-17 13:27:31 +0400 |
commit | 5452f335d7fd768fda7320419e3581e5309529fe (patch) | |
tree | f80553108d8541e2d070c02fe86778494f31c188 /source/blender/windowmanager/WM_types.h | |
parent | 945ae254092dcbb284072fd4ffcc80b33bff27f6 (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/windowmanager/WM_types.h')
-rw-r--r-- | source/blender/windowmanager/WM_types.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 807125765f7..a732524ca03 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -385,6 +385,12 @@ typedef struct wmOperatorType { * any interface code or input device state. * - see defines below for return values */ int (*exec)(struct bContext *, struct wmOperator *); + + /* this callback executes on a running operator whenever as property + * is changed. It can correct its own properties or report errors for + * invalid settings in exceptional cases. + * Boolean return value, True denotes a change has been made and to redraw */ + int (*check)(struct bContext *, struct wmOperator *); /* for modal temporary operators, initially invoke is called. then * any further events are handled in modal. if the operation is |