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/editors/space_text | |
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/editors/space_text')
-rw-r--r-- | source/blender/editors/space_text/text_ops.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 3411d9114df..3568f50dfe1 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -192,7 +192,7 @@ static int open_exec(bContext *C, wmOperator *op) Text *text; char str[FILE_MAX]; - RNA_string_get(op->ptr, "filename", str); + RNA_string_get(op->ptr, "path", str); text= add_text(str, G.sce); @@ -211,10 +211,10 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *event) Text *text= CTX_data_edit_text(C); char *path= (text && text->name)? text->name: G.sce; - if(RNA_property_is_set(op->ptr, "filename")) + if(RNA_property_is_set(op->ptr, "path")) return open_exec(C, op); - RNA_string_set(op->ptr, "filename", path); + RNA_string_set(op->ptr, "path", path); WM_event_add_fileselect(C, op); return OPERATOR_RUNNING_MODAL; @@ -233,7 +233,7 @@ void TEXT_OT_open(wmOperatorType *ot) ot->poll= text_new_poll; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE); + WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE, FILE_SPECIAL); } /******************* reload operator *********************/ @@ -420,7 +420,7 @@ static int save_as_exec(bContext *C, wmOperator *op) if(!text) return OPERATOR_CANCELLED; - RNA_string_get(op->ptr, "filename", str); + RNA_string_get(op->ptr, "path", str); if(text->name) MEM_freeN(text->name); text->name= BLI_strdup(str); @@ -438,7 +438,7 @@ static int save_as_invoke(bContext *C, wmOperator *op, wmEvent *event) Text *text= CTX_data_edit_text(C); char *str; - if(RNA_property_is_set(op->ptr, "filename")) + if(RNA_property_is_set(op->ptr, "path")) return save_as_exec(C, op); if(text->name) @@ -448,7 +448,7 @@ static int save_as_invoke(bContext *C, wmOperator *op, wmEvent *event) else str= G.sce; - RNA_string_set(op->ptr, "filename", str); + RNA_string_set(op->ptr, "path", str); WM_event_add_fileselect(C, op); return OPERATOR_RUNNING_MODAL; @@ -467,7 +467,7 @@ void TEXT_OT_save_as(wmOperatorType *ot) ot->poll= text_edit_poll; /* properties */ - WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE); + WM_operator_properties_filesel(ot, FOLDERFILE|TEXTFILE|PYSCRIPTFILE, FILE_SPECIAL); } /******************* run script operator *********************/ |