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:
Diffstat (limited to 'source/blender/windowmanager/intern/wm_operators.c')
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 058c39749a6..7c11c7ff3af 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -788,7 +788,15 @@ void WM_operator_properties_filesel(wmOperatorType *ot, int filter, short type,
{
PropertyRNA *prop;
- RNA_def_string_file_path(ot->srna, "filepath", "", FILE_MAX, "File Path", "Path to file");
+
+ if(flag & WM_FILESEL_FILEPATH)
+ RNA_def_string_file_path(ot->srna, "filepath", "", FILE_MAX, "File Path", "Path to file");
+
+ if(flag & WM_FILESEL_DIRECTORY)
+ RNA_def_string_dir_path(ot->srna, "directory", "", FILE_MAX, "Directory", "Directory of the file");
+
+ if(flag & WM_FILESEL_FILENAME)
+ RNA_def_string_file_name(ot->srna, "filename", "", FILE_MAX, "File Name", "Name of the file");
if (action == FILE_SAVE) {
prop= RNA_def_boolean(ot->srna, "check_existing", 1, "Check Existing", "Check and warn on overwriting existing files");
@@ -821,7 +829,7 @@ void WM_operator_properties_filesel(wmOperatorType *ot, int filter, short type,
FILE_LOADLIB, FILE_SPECIAL);
RNA_def_property_flag(prop, PROP_HIDDEN);
- if(flag & FILE_RELPATH)
+ if(flag & WM_FILESEL_RELPATH)
RNA_def_boolean(ot->srna, "relative_path", 0, "Relative Path", "Select the file relative to the blend file");
}
@@ -1019,9 +1027,8 @@ int WM_operator_props_popup(bContext *C, wmOperator *op, wmEvent *event)
if(op->type->exec) {
retval= op->type->exec(C, op);
-
- if(op->type->flag & OPTYPE_UNDO)
- ED_undo_push_op(C, op);
+
+ /* ED_undo_push_op(C, op), called by wm_operator_finished now. */
}
if(retval != OPERATOR_CANCELLED)
@@ -1473,7 +1480,7 @@ static void WM_OT_open_mainfile(wmOperatorType *ot)
ot->exec= wm_open_mainfile_exec;
ot->poll= WM_operator_winactive;
- WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_OPENFILE, 0);
+ WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_OPENFILE, WM_FILESEL_FILEPATH);
RNA_def_boolean(ot->srna, "load_ui", 1, "Load UI", "Load user interface setup in the .blend file");
RNA_def_boolean(ot->srna, "use_scripts", 1, "Trusted Source", "Allow blend file execute scripts automatically, default available from system preferences");
@@ -1644,16 +1651,13 @@ static void WM_OT_link_append(wmOperatorType *ot)
ot->flag |= OPTYPE_UNDO;
- WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_LOADLIB, FILE_OPENFILE, FILE_RELPATH);
+ WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_LOADLIB, FILE_OPENFILE, WM_FILESEL_FILEPATH|WM_FILESEL_DIRECTORY|WM_FILESEL_FILENAME| WM_FILESEL_RELPATH);
RNA_def_boolean(ot->srna, "link", 1, "Link", "Link the objects or datablocks rather than appending");
RNA_def_boolean(ot->srna, "autoselect", 1, "Select", "Select the linked objects");
RNA_def_boolean(ot->srna, "active_layer", 1, "Active Layer", "Put the linked objects on the active layer");
RNA_def_boolean(ot->srna, "instance_groups", 1, "Instance Groups", "Create instances for each group as a DupliGroup");
- RNA_def_string_file_name(ot->srna, "filename", "", FILE_MAX, "File Name", "Name of the file");
- RNA_def_string_dir_path(ot->srna, "directory", "", FILE_MAX, "Directory", "Directory of the file");
-
RNA_def_collection_runtime(ot->srna, "files", &RNA_OperatorFileListElement, "Files", "");
}
@@ -1674,7 +1678,6 @@ static int wm_recover_last_session_exec(bContext *C, wmOperator *op)
WM_read_file(C, filename, op->reports);
G.fileflags &= ~G_FILE_RECOVER;
-
return OPERATOR_FINISHED;
}
@@ -1731,7 +1734,7 @@ static void WM_OT_recover_auto_save(wmOperatorType *ot)
ot->invoke= wm_recover_auto_save_invoke;
ot->poll= WM_operator_winactive;
- WM_operator_properties_filesel(ot, BLENDERFILE, FILE_BLENDER, FILE_OPENFILE, 0);
+ WM_operator_properties_filesel(ot, BLENDERFILE, FILE_BLENDER, FILE_OPENFILE, WM_FILESEL_FILEPATH);
}
/* *************** save file as **************** */
@@ -1814,7 +1817,7 @@ static void WM_OT_save_as_mainfile(wmOperatorType *ot)
ot->exec= wm_save_as_mainfile_exec;
ot->poll= WM_operator_winactive;
- WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_SAVE, 0);
+ WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_SAVE, WM_FILESEL_FILEPATH);
RNA_def_boolean(ot->srna, "compress", 0, "Compress", "Write compressed .blend file");
RNA_def_boolean(ot->srna, "relative_remap", 0, "Remap Relative", "Remap relative paths when saving in a different directory");
}
@@ -1863,7 +1866,7 @@ static void WM_OT_save_mainfile(wmOperatorType *ot)
ot->exec= wm_save_as_mainfile_exec;
ot->poll= NULL;
- WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_SAVE, 0);
+ WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE, FILE_BLENDER, FILE_SAVE, WM_FILESEL_FILEPATH);
RNA_def_boolean(ot->srna, "compress", 0, "Compress", "Write compressed .blend file");
RNA_def_boolean(ot->srna, "relative_remap", 0, "Remap Relative", "Remap relative paths when saving in a different directory");
}
@@ -1912,7 +1915,7 @@ static void WM_OT_collada_export(wmOperatorType *ot)
ot->exec= wm_collada_export_exec;
ot->poll= WM_operator_winactive;
- WM_operator_properties_filesel(ot, FOLDERFILE|COLLADAFILE, FILE_BLENDER, FILE_SAVE, 0);
+ WM_operator_properties_filesel(ot, FOLDERFILE|COLLADAFILE, FILE_BLENDER, FILE_SAVE, WM_FILESEL_FILEPATH);
}
/* function used for WM_OT_save_mainfile too */
@@ -1940,7 +1943,7 @@ static void WM_OT_collada_import(wmOperatorType *ot)
ot->exec= wm_collada_import_exec;
ot->poll= WM_operator_winactive;
- WM_operator_properties_filesel(ot, FOLDERFILE|COLLADAFILE, FILE_BLENDER, FILE_OPENFILE, 0);
+ WM_operator_properties_filesel(ot, FOLDERFILE|COLLADAFILE, FILE_BLENDER, FILE_OPENFILE, WM_FILESEL_FILEPATH);
}
#endif
@@ -2264,6 +2267,7 @@ static void tweak_gesture_modal(bContext *C, wmEvent *event)
switch(event->type) {
case MOUSEMOVE:
+ case INBETWEEN_MOUSEMOVE:
wm_subwindow_getorigin(window, gesture->swinid, &sx, &sy);
@@ -2394,6 +2398,7 @@ int WM_gesture_lasso_modal(bContext *C, wmOperator *op, wmEvent *event)
switch(event->type) {
case MOUSEMOVE:
+ case INBETWEEN_MOUSEMOVE:
wm_gesture_tag_redraw(C);