[Xfce4-commits] <postler:master> Only show Junk action if one account can use it

Christian Dywan noreply at xfce.org
Mon Feb 28 03:02:01 CET 2011


Updating branch refs/heads/master
         to 878d998effa0022013759fb35a08148a2ff65e55 (commit)
       from f04e6d8aa809bbff0ed53df01aced1157be8aa46 (commit)

commit 878d998effa0022013759fb35a08148a2ff65e55
Author: Christian Dywan <christian at twotoasts.de>
Date:   Mon Feb 28 03:01:15 2011 +0100

    Only show Junk action if one account can use it

 postler/postler-bureau.vala |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/postler/postler-bureau.vala b/postler/postler-bureau.vala
index 9dd0e3f..f953183 100644
--- a/postler/postler-bureau.vala
+++ b/postler/postler-bureau.vala
@@ -458,11 +458,13 @@ public class Postler.Bureau : Gtk.Window {
     void account_check (AccountInfo? account_info) {
         actions.get_action ("MailReceive").sensitive = false;
         actions.get_action ("MessageNew").sensitive = false;
+        actions.get_action ("MessageJunk").visible = false;
         foreach (var info in accounts.get_infos ())
             if (info.type == AccountType.IMAP) {
                 actions.get_action ("MailReceive").sensitive = true;
                 actions.get_action ("MessageNew").sensitive = true;
-                break;
+                if (info.get_folder (FolderType.JUNK) != null)
+                    actions.get_action ("MessageJunk").visible = true;
             }
     }
 
@@ -593,10 +595,6 @@ public class Postler.Bureau : Gtk.Window {
         }
         ui.insert_action_group (folder_actions, 0);
 
-        accounts.add_info.connect_after (account_check);
-        accounts.remove_info.connect_after (account_check);
-        account_check (null);
-
         shelf = new Gtk.VBox (false, 0);
         add (shelf);
         var menubar = ui.get_widget ("/menubar");
@@ -870,6 +868,10 @@ public class Postler.Bureau : Gtk.Window {
         folders.messages = messages;
         messages.content = content;
 
+        accounts.add_info.connect_after (account_check);
+        accounts.remove_info.connect_after (account_check);
+        account_check (null);
+
         /* Never focus hidden widgets: assertion `WIDGET_REALIZED_FOR_EVENT */
         if (folders.visible)
             folders.grab_focus ();



More information about the Xfce4-commits mailing list