diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2023-11-20 18:25:49 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2023-11-20 18:25:49 +0100 |
commit | 394326a81d1248bbc5b1a35a8ae623c65ef6a9ea (patch) | |
tree | 315f7cf2a7934b0ecf45ac2caa3c87949a90dfc4 /src/direct | |
parent | 918f560d56129ed03f19d843ea2efd7cb4b23821 (diff) | |
parent | 87ba373882f475f02a524a120b59ea9fcccf14e5 (diff) |
Update upstream source from tag 'upstream/0.32.3'
Update to upstream version '0.32.3'
with Debian dir e5e2a77e8650a79f6e85cccb15c070434b0fd667
Diffstat (limited to 'src/direct')
-rw-r--r-- | src/direct/DirectPhotoPage.vala | 11 | ||||
-rw-r--r-- | src/direct/DirectWindow.vala | 3 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/direct/DirectPhotoPage.vala b/src/direct/DirectPhotoPage.vala index cc7186c..50321e9 100644 --- a/src/direct/DirectPhotoPage.vala +++ b/src/direct/DirectPhotoPage.vala @@ -9,6 +9,7 @@ public class DirectPhotoPage : EditingHostPage { private DirectViewCollection? view_controller = null; private File current_save_dir; private bool drop_if_dirty = false; + private bool in_shutdown = false; public DirectPhotoPage(File file) { base (DirectPhoto.global, file.get_basename()); @@ -319,7 +320,10 @@ public class DirectPhotoPage : EditingHostPage { return true; } + // Check if we can write the target format bool is_writeable = get_photo().get_file_format().can_write(); + + // TODO: Check if we can actually write to the file string save_option = is_writeable ? _("_Save") : _("_Save a Copy"); Gtk.ResponseType response = AppWindow.negate_affirm_cancel_question( @@ -336,6 +340,7 @@ public class DirectPhotoPage : EditingHostPage { on_save_as(); } else if ((response == Gtk.ResponseType.CANCEL) || (response == Gtk.ResponseType.DELETE_EVENT) || (response == Gtk.ResponseType.CLOSE)) { + in_shutdown = false; return false; } @@ -343,6 +348,7 @@ public class DirectPhotoPage : EditingHostPage { } public bool check_quit() { + in_shutdown = true; return check_ok_to_close_photo(get_photo(), false); } @@ -352,8 +358,9 @@ public class DirectPhotoPage : EditingHostPage { private void save(File dest, int scale, ScaleConstraint constraint, Jpeg.Quality quality, PhotoFileFormat format, bool copy_unmodified = false, bool save_metadata = true) { + Scaling scaling = Scaling.for_constraint(constraint, scale, false); - + try { get_photo().export(dest, scaling, quality, format, copy_unmodified, save_metadata); } catch (Error err) { @@ -363,6 +370,8 @@ public class DirectPhotoPage : EditingHostPage { return; } + if (in_shutdown) return; + // Fetch the DirectPhoto and reimport. DirectPhoto photo; DirectPhoto.global.fetch(dest, out photo, true); diff --git a/src/direct/DirectWindow.vala b/src/direct/DirectWindow.vala index 9eec5b1..baf6124 100644 --- a/src/direct/DirectWindow.vala +++ b/src/direct/DirectWindow.vala @@ -66,9 +66,6 @@ public class DirectWindow : AppWindow { } protected override void on_quit() { - if (!get_direct_page().check_quit()) - return; - Config.Facade.get_instance().set_direct_window_state(maximized, dimensions); base.on_quit(); |