diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2023-12-17 19:58:57 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2023-12-17 19:58:57 +0100 |
commit | 270fbc11b9744b76bcc52a3cf58fe896d7352724 (patch) | |
tree | fb359e210d2d9c30f5ad36a447ea29b62ae9bb56 /src/DragAndDropHandler.vala | |
parent | 841f952294b349b2b8e2afb5305ce34a3b59bb4b (diff) | |
parent | 4cb46f4de4b881e5b1f65af017dca6f3917e55e5 (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'src/DragAndDropHandler.vala')
-rw-r--r-- | src/DragAndDropHandler.vala | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/DragAndDropHandler.vala b/src/DragAndDropHandler.vala index ece6d9d..9ac6e46 100644 --- a/src/DragAndDropHandler.vala +++ b/src/DragAndDropHandler.vala @@ -28,6 +28,7 @@ public class DragAndDropHandler { private Gtk.Widget event_source; private File? drag_destination = null; private ExporterUI exporter = null; + private Gdk.DragAction action = Gdk.DragAction.COPY; public DragAndDropHandler(Page page) { this.page = page; @@ -47,7 +48,7 @@ public class DragAndDropHandler { // register what's available on this DnD Source Gtk.drag_source_set(event_source, Gdk.ModifierType.BUTTON1_MASK, SOURCE_TARGET_ENTRIES, - Gdk.DragAction.COPY); + Gdk.DragAction.COPY | Gdk.DragAction.MOVE); // attach to the event source's DnD signals, not the Page's, which is a NO_WINDOW widget // and does not emit them @@ -100,6 +101,8 @@ public class DragAndDropHandler { if (page == null || page.get_view().get_selected_count() == 0) return; + action = context.get_suggested_action(); + switch (target_type) { case TargetType.XDS: // Fetch the XDS property that has been set with the destination path @@ -147,7 +150,7 @@ public class DragAndDropHandler { return; } - debug("Exporting to %s", drag_destination.get_path()); + debug("Exporting to %s, mode %s", drag_destination.get_path(), action == Gdk.DragAction.COPY ? "current" : "unmodified"); // drag-and-drop export doesn't pop up an export dialog, so use what are likely the // most common export settings (the current -- or "working" -- file format, with @@ -155,7 +158,8 @@ public class DragAndDropHandler { if (drag_destination.get_path() != null) { exporter = new ExporterUI(new Exporter( (Gee.Collection<Photo>) page.get_view().get_selected_sources(), - drag_destination, Scaling.for_original(), ExportFormatParameters.current())); + drag_destination, Scaling.for_original(), action == Gdk.DragAction.COPY ? ExportFormatParameters.current() + : ExportFormatParameters.unmodified())); exporter.export(on_export_completed); } else { AppWindow.error_message(_("Photos cannot be exported to this directory.")); |