diff options
author | Andrea Weikert <elubie@gmx.net> | 2009-09-12 23:54:39 +0400 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2009-09-12 23:54:39 +0400 |
commit | 9a25d22326060395b09cd6d81d7b4ac080bafb8f (patch) | |
tree | eb9ef68ff4b155f69d3d8beedc221b72d92ea83c /source/blender/windowmanager/intern/wm_event_system.c | |
parent | c1e2e3fea2dd1b22cf22a9dca4d88bde2d280ab6 (diff) |
2.5 filebrowser
Appending and Linking
* Linking Operator, invokes filebrowser for Append/Link
* Separated the append/link function into three parts:
** BLO_library_append_begin finds main for appending
** BLO_library_append_named_part appends one Object,Group, Material, ...
** BLO_library_append_end actually reads and expands the libraries
NOTE 1:
I also changed the returned properties for the filebrowser operators to the following convention:
"path" - the full path to a file or directory, means what is in directory + filename buttons in filebrowser
"directory" - the content of the directory button in filebrowser
"filename" - the content of the filename button in filebrowser
Usually only path should be required, but in some cases it might be more convenient to retrieve the parts separately.
Ton, Brecht: If you have time to take a look, let me know if anything needs to be fixed.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_event_system.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 3c03d24ca93..79441f33610 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -895,9 +895,7 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa switch(event->val) { case EVT_FILESELECT_OPEN: case EVT_FILESELECT_FULL_OPEN: - { - char *dir= NULL; char *path= RNA_string_get_alloc(handler->op->ptr, "filename", NULL, 0); - + { if(event->val==EVT_FILESELECT_OPEN) ED_area_newspace(C, handler->op_area, SPACE_FILE); else @@ -908,8 +906,6 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa sfile->op= handler->op; ED_fileselect_set_params(sfile); - dir = NULL; - MEM_freeN(path); action= WM_HANDLER_BREAK; } @@ -920,7 +916,7 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa { /* XXX validate area and region? */ bScreen *screen= CTX_wm_screen(C); - char *path= RNA_string_get_alloc(handler->op->ptr, "filename", NULL, 0); + char *path= RNA_string_get_alloc(handler->op->ptr, "path", NULL, 0); if(screen != handler->filescreen) ED_screen_full_prevspace(C); @@ -1250,7 +1246,7 @@ void WM_event_fileselect_event(bContext *C, void *ophandle, int eventval) } } -/* operator is supposed to have a filled "filename" property */ +/* operator is supposed to have a filled "path" property */ /* optional property: filetype (XXX enum?) */ /* Idea is to keep a handler alive on window queue, owning the operator. |