diff options
author | Robin Gareus <robin@gareus.org> | 2013-03-21 21:33:02 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2013-03-21 21:33:02 +0100 |
commit | 268553ecd471e31d0a1a3976f02389260130e41d (patch) | |
tree | e66d6775992b8dfb39361550dde915a7b80d7b58 /gtk2_ardour/editor_canvas.cc | |
parent | d99b5dfa37c7248e24a0266188752dfa6c9bb3f6 (diff) |
honor CTRL modifier when drag/drop importing files (copy vs embed)
Diffstat (limited to 'gtk2_ardour/editor_canvas.cc')
-rw-r--r-- | gtk2_ardour/editor_canvas.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index 383241aec0..8c9970275d 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -412,14 +412,14 @@ Editor::track_canvas_drag_data_received (const RefPtr<Gdk::DragContext>& context } bool -Editor::idle_drop_paths (vector<string> paths, framepos_t frame, double ypos) +Editor::idle_drop_paths (vector<string> paths, framepos_t frame, double ypos, bool copy) { - drop_paths_part_two (paths, frame, ypos); + drop_paths_part_two (paths, frame, ypos, copy); return false; } void -Editor::drop_paths_part_two (const vector<string>& paths, framepos_t frame, double ypos) +Editor::drop_paths_part_two (const vector<string>& paths, framepos_t frame, double ypos, bool copy) { RouteTimeAxisView* tv; @@ -430,7 +430,7 @@ Editor::drop_paths_part_two (const vector<string>& paths, framepos_t frame, doub frame = 0; - if (Profile->get_sae() || Config->get_only_copy_imported_files()) { + if (Profile->get_sae() || Config->get_only_copy_imported_files() || copy) { do_import (paths, Editing::ImportDistinctFiles, Editing::ImportAsTrack, SrcBest, frame); } else { do_embed (paths, Editing::ImportDistinctFiles, ImportAsTrack, frame); @@ -444,7 +444,7 @@ Editor::drop_paths_part_two (const vector<string>& paths, framepos_t frame, doub /* select the track, then embed/import */ selection->set (tv); - if (Profile->get_sae() || Config->get_only_copy_imported_files()) { + if (Profile->get_sae() || Config->get_only_copy_imported_files() || copy) { do_import (paths, Editing::ImportSerializeFiles, Editing::ImportToTrack, SrcBest, frame); } else { do_embed (paths, Editing::ImportSerializeFiles, ImportToTrack, frame); @@ -481,14 +481,15 @@ Editor::drop_paths (const RefPtr<Gdk::DragContext>& context, snap_to (frame); + bool copy = ((context->get_actions() & (Gdk::ACTION_COPY | Gdk::ACTION_LINK | Gdk::ACTION_MOVE)) == Gdk::ACTION_COPY); #ifdef GTKOSX /* We are not allowed to call recursive main event loops from within the main event loop with GTK/Quartz. Since import/embed wants to push up a progress dialog, defer all this till we go idle. */ - Glib::signal_idle().connect (sigc::bind (sigc::mem_fun (*this, &Editor::idle_drop_paths), paths, frame, cy)); + Glib::signal_idle().connect (sigc::bind (sigc::mem_fun (*this, &Editor::idle_drop_paths), paths, frame, cy, copy)); #else - drop_paths_part_two (paths, frame, cy); + drop_paths_part_two (paths, frame, cy, copy); #endif } |