diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2023-12-17 19:58:25 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2023-12-17 19:58:25 +0100 |
commit | 4cb46f4de4b881e5b1f65af017dca6f3917e55e5 (patch) | |
tree | fb359e210d2d9c30f5ad36a447ea29b62ae9bb56 /src/Exporter.vala | |
parent | 841f952294b349b2b8e2afb5305ce34a3b59bb4b (diff) | |
parent | f5a0cee8ccecc7b6c6c2d8e9fb6f6eecd53531fe (diff) |
Update upstream source from tag 'upstream/0.32.4'
Update to upstream version '0.32.4'
with Debian dir 51798a6af1c9b7e48f979c020d72f3c5ddd964a6
Diffstat (limited to 'src/Exporter.vala')
-rw-r--r-- | src/Exporter.vala | 42 |
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) { |