summaryrefslogtreecommitdiff
path: root/src/DragAndDropHandler.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-12-29 18:43:43 +0100
committerJörg Frings-Fürst <debian@jff.email>2023-12-29 18:43:43 +0100
commit14bc7db2e07c5d1ccfb4d723c9dba395e6c93171 (patch)
tree7b00861348dedd18d3651537128bbe783dab364c /src/DragAndDropHandler.vala
parent1bf62485f701b52ae27433e3570ac24cd7da886f (diff)
parent67d142325abb0d9345baef77f00a047a7dc1eca3 (diff)
Merge branch 'release/debian/0.32.4-1'debian/0.32.4-1
Diffstat (limited to 'src/DragAndDropHandler.vala')
-rw-r--r--src/DragAndDropHandler.vala10
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."));