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/editors/space_file/file_panels.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/editors/space_file/file_panels.c')
-rw-r--r--source/blender/editors/space_file/file_panels.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c
index 4a505bc022f..33d740e18a6 100644
--- a/source/blender/editors/space_file/file_panels.c
+++ b/source/blender/editors/space_file/file_panels.c
@@ -170,7 +170,9 @@ static void file_panel_operator(const bContext *C, Panel *pa)
SpaceFile *sfile= CTX_wm_space_file(C);
wmOperator *op= sfile->op;
int empty= 1, flag;
-
+
+ uiBlockSetFunc(uiLayoutGetBlock(pa->layout), file_draw_check_cb, NULL, NULL);
+
if(op->type->ui) {
op->layout= pa->layout;
op->type->ui((bContext*)C, op);
@@ -197,6 +199,8 @@ static void file_panel_operator(const bContext *C, Panel *pa)
if(empty)
uiItemL(pa->layout, "No properties.", 0);
}
+
+ uiBlockSetFunc(uiLayoutGetBlock(pa->layout), NULL, NULL, NULL);
}
void file_panels_register(ARegionType *art)