[simple-scan] Save button should be disabled while file is saving.



commit 49730d5daa8d909ed6b398177f933d643cbd84d6
Author: Victor Mireyev <victor mireyev gmail com>
Date:   Mon Feb 18 14:41:07 2019 +0000

    Save button should be disabled while file is saving.

 src/app-window.vala | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/app-window.vala b/src/app-window.vala
index ab3e14d..6e46970 100644
--- a/src/app-window.vala
+++ b/src/app-window.vala
@@ -507,6 +507,7 @@ public class AppWindow : Gtk.ApplicationWindow
         var progress_bar =  new CancellableProgressBar (_("Saving"), cancellable);
         action_bar.pack_end (progress_bar);
         progress_bar.visible = true;
+        save_button.sensitive = false;
         try
         {
             yield book.save_async (format, settings.get_int ("jpeg-quality"), file, (fraction) =>
@@ -516,6 +517,7 @@ public class AppWindow : Gtk.ApplicationWindow
         }
         catch (Error e)
         {
+            save_button.sensitive = true;
             progress_bar.destroy ();
             warning ("Error saving file: %s", e.message);
             show_error_dialog (/* Title of error dialog when save failed */
@@ -523,6 +525,7 @@ public class AppWindow : Gtk.ApplicationWindow
                                e.message);
             return false;
         }
+        save_button.sensitive = true;
         progress_bar.destroy_with_delay (500);
 
         book_needs_saving = false;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]