[geary] Disable "save draft" button if it is not available yet. Bug 747627



commit c623a4e6214901e4687d54205610242d0a35a4c3
Author: Gautier Pelloux-Prayer <gautier+git damsy net>
Date:   Mon Nov 21 14:43:00 2016 +0100

    Disable "save draft" button if it is not available yet. Bug 747627

 src/client/composer/composer-widget.vala |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/client/composer/composer-widget.vala b/src/client/composer/composer-widget.vala
index 6a13215..e2760dc 100644
--- a/src/client/composer/composer-widget.vala
+++ b/src/client/composer/composer-widget.vala
@@ -718,9 +718,12 @@ public class ComposerWidget : Gtk.EventBox {
         Cancellable? cancellable = null)
     throws Error {
         this.draft_save_text = "";
+        SimpleAction close_and_save = get_action(ACTION_CLOSE_AND_SAVE);
+
+        close_and_save.set_enabled(false);
+
         yield close_draft_manager_async(cancellable);
 
-        SimpleAction close_and_save = get_action(ACTION_CLOSE_AND_SAVE);
         if (!this.account.information.save_drafts) {
             this.header.save_and_close_button.hide();
             return;
@@ -1202,7 +1205,7 @@ public class ComposerWidget : Gtk.EventBox {
         if (can_save())
             save_and_exit_async.begin();
         else
-            this.container.close_container();
+            on_close(action, param);
     }
 
     private void on_close_and_discard(SimpleAction action, Variant? param) {


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