summaryrefslogtreecommitdiff
path: root/src/Exporter.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/Exporter.vala
parent1bf62485f701b52ae27433e3570ac24cd7da886f (diff)
parent67d142325abb0d9345baef77f00a047a7dc1eca3 (diff)
Merge branch 'release/debian/0.32.4-1'HEADdebian/0.32.4-1master
Diffstat (limited to 'src/Exporter.vala')
-rw-r--r--src/Exporter.vala42
1 files changed, 31 insertions, 11 deletions
diff --git a/src/Exporter.vala b/src/Exporter.vala
index a7f7b6b..cf63938 100644
--- a/src/Exporter.vala
+++ b/src/Exporter.vala
@@ -54,6 +54,7 @@ public class Exporter : Object {
public enum Overwrite {
YES,
NO,
+ SKIP_ALL,
CANCEL,
REPLACE_ALL,
RENAME,
@@ -270,6 +271,15 @@ public class Exporter : Object {
return false;
+ case Overwrite.SKIP_ALL:
+ completed_count = to_export.size;
+ if (monitor != null) {
+ if (!monitor(completed_count, to_export.size)) {
+ cancellable.cancel();
+
+ }
+ }
+ return false;
case Overwrite.NO:
default:
completed_count++;
@@ -346,30 +356,40 @@ public class ExporterUI {
progress_dialog.set_modal(false);
string question = _("File %s already exists. Replace?").printf(file.get_basename());
int response = AppWindow.export_overwrite_or_replace_question(question,
- _("_Skip"), _("Rename"), _("Rename All"),_("_Replace"), _("Replace _All"), _("_Cancel"), _("Export"));
+ _("_Skip"), _("Rename"), _("_Replace"), _("_Cancel"), _("Export file conflict"));
progress_dialog.set_modal(true);
+ var apply_all = (response & 0x80) != 0;
+ response &= 0x0f;
+
switch (response) {
case 2:
- return Exporter.Overwrite.RENAME;
-
- case 3:
- return Exporter.Overwrite.RENAME_ALL;
-
+ if (apply_all) {
+ return Exporter.Overwrite.RENAME_ALL;
+ }
+ else {
+ return Exporter.Overwrite.RENAME;
+ }
case 4:
- return Exporter.Overwrite.YES;
-
- case 5:
- return Exporter.Overwrite.REPLACE_ALL;
+ if (apply_all) {
+ return Exporter.Overwrite.REPLACE_ALL;
+ } else {
+ return Exporter.Overwrite.YES;
+ }
case 6:
return Exporter.Overwrite.CANCEL;
case 1:
+ if (apply_all) {
+ return Exporter.Overwrite.SKIP_ALL;
+ } else {
+ return Exporter.Overwrite.NO;
+ }
default:
return Exporter.Overwrite.NO;
- }
+ }
}
private bool on_export_failed(Exporter exporter, File file, int remaining, Error err) {