[Xfce4-commits] <postler:master> Synchronise save button sensitivity with send

Christian Dywan noreply at xfce.org
Thu Mar 10 04:24:04 CET 2011


Updating branch refs/heads/master
         to 71ef7c8514b3c53366d8f654fb0b1fe4bae97fc1 (commit)
       from 5b0342f3cd7e24e921ea73e924f77d4241744ce6 (commit)

commit 71ef7c8514b3c53366d8f654fb0b1fe4bae97fc1
Author: Christian Dywan <christian at twotoasts.de>
Date:   Wed Mar 9 22:16:41 2011 +0100

    Synchronise save button sensitivity with send
    
    Fixes: https://bugs.launchpad.net/postler/+bug/732248

 postler/postler-composer.vala |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/postler/postler-composer.vala b/postler/postler-composer.vala
index 03a1a3f..0fc31b6 100644
--- a/postler/postler-composer.vala
+++ b/postler/postler-composer.vala
@@ -28,6 +28,7 @@ public class Postler.Composer : Gtk.Window {
     Postler.RecipientEntry entry_blind_copy;
     Gtk.Entry entry_subject;
     Gtk.Button button_send;
+    Gtk.Button button_save;
     uint grace_period_timer = 0;
     uint progress_timer = 0;
     bool message_saved = false;
@@ -93,7 +94,7 @@ public class Postler.Composer : Gtk.Window {
 
         if (state) {
             button_send.label = STOCK_MAIL_SEND;
-            button_send.sensitive = true;
+            button_send.sensitive = button_save.sensitive = true;
             progressbar.hide ();
             grace_period_timer = progress_timer = 0;
         }
@@ -271,7 +272,7 @@ public class Postler.Composer : Gtk.Window {
     }
 
     bool save_draft () {
-        button_send.sensitive = false;
+        button_send.sensitive = button_save.sensitive = false;
 
         string? sender = combo_from.get_active_text ();
         if (sender == null) {
@@ -312,15 +313,15 @@ public class Postler.Composer : Gtk.Window {
             FileUtils.chmod (draft_filename, 0700);
         } catch (GLib.Error error) {
             GLib.critical (_("Failed to save message: %s"), error.message);
-            toggle_sensitivity (true);
         }
         message_saved = true;
+        toggle_sensitivity (true);
         return true;
     }
 
     void send_message () {
         progress_timer = GLib.Timeout.add_seconds (1, send_progress_timer);
-        button_send.sensitive = false;
+        button_send.sensitive = button_save.sensitive = false;
 
         string? sender = combo_from.get_active_text ();
         var info = selected_account_for_address (sender);
@@ -547,11 +548,11 @@ public class Postler.Composer : Gtk.Window {
 
         toolitem = new Gtk.ToolItem ();
         toolitem.set_border_width (4);
-        var button = new Gtk.Button.from_stock (Gtk.STOCK_SAVE);
-        button.name = "PostlerWideButton";
-        toolitem.add (button);
-        actions.get_action ("MessageSave").connect_proxy (button);
-        button.clicked.connect (action_mail_save);
+        button_save = new Gtk.Button.from_stock (Gtk.STOCK_SAVE);
+        button_save.name = "PostlerWideButton";
+        toolitem.add (button_save);
+        actions.get_action ("MessageSave").connect_proxy (button_save);
+        button_save.clicked.connect (action_mail_save);
         toolbar.insert (toolitem, -1);
         toolitem = new Gtk.ToolItem ();
         toolitem.set_border_width (4);
@@ -597,7 +598,7 @@ public class Postler.Composer : Gtk.Window {
         box.pack_start (label_and_arrow_vbox, false, false, 4);
         var label_and_arrow = new Gtk.HBox (false, 0);
         label_and_arrow_vbox.pack_start (label_and_arrow, false, false, 4);
-        button = new Gtk.Button ();
+        var button = new Gtk.Button ();
         var arrow = new Gtk.Arrow (Gtk.ArrowType.RIGHT, Gtk.ShadowType.NONE);
         button.add (arrow);
         button.set_relief (Gtk.ReliefStyle.NONE);



More information about the Xfce4-commits mailing list