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:
authorJacques Lucke <mail@jlucke.com>2018-10-22 18:18:42 +0300
committerJacques Lucke <mail@jlucke.com>2018-10-22 18:18:42 +0300
commit650cdc6b2d91b12a80d7c8e680224c4713cfeb5e (patch)
tree0a568ce7f9f097ee2817e3d6c069f392e8366418 /source/blender/editors/screen/screen_ops.c
parent0628fe7a6cf33bec370a4db53bb9d5980fa40162 (diff)
Drag & Drop: Support Open/Link/Append when dropping .blend file
When a .blend file is dropped into Blender a small menu opens. In that menu the user can choose between three options: Open, Link and Append. Reviewers: brecht Differential Revision: https://developer.blender.org/D3801
Diffstat (limited to 'source/blender/editors/screen/screen_ops.c')
-rw-r--r--source/blender/editors/screen/screen_ops.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 27c9f522c54..150e1b1f5a5 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -4855,7 +4855,7 @@ static void keymap_modal_set(wmKeyConfig *keyconf)
}
-static bool open_file_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event), const char **UNUSED(tooltip))
+static bool blend_file_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event), const char **UNUSED(tooltip))
{
if (drag->type == WM_DRAG_PATH) {
if (drag->icon == ICON_FILE_BLEND)
@@ -4864,11 +4864,10 @@ static bool open_file_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent
return 0;
}
-static void open_file_drop_copy(wmDrag *drag, wmDropBox *drop)
+static void blend_file_drop_copy(wmDrag *drag, wmDropBox *drop)
{
/* copy drag path to properties */
RNA_string_set(drop->ptr, "filepath", drag->path);
- drop->opcontext = WM_OP_EXEC_DEFAULT;
}
@@ -5055,7 +5054,7 @@ void ED_keymap_screen(wmKeyConfig *keyconf)
/* dropbox for entire window */
lb = WM_dropboxmap_find("Window", 0, 0);
- WM_dropbox_add(lb, "WM_OT_open_mainfile", open_file_drop_poll, open_file_drop_copy);
+ WM_dropbox_add(lb, "WM_OT_drop_blend_file", blend_file_drop_poll, blend_file_drop_copy);
WM_dropbox_add(lb, "UI_OT_drop_color", UI_drop_color_poll, UI_drop_color_copy);
keymap_modal_set(keyconf);