[Xfce4-commits] <postler:master> Add 'Mark message as Junk' button

Christian Dywan noreply at xfce.org
Sat Nov 20 21:00:01 CET 2010


Updating branch refs/heads/master
         to df4fda8b01f6b9ed78a66726e85dd9d4a54fb4b9 (commit)
       from a33724921ac22900f477cafef101059f5f94cb51 (commit)

commit df4fda8b01f6b9ed78a66726e85dd9d4a54fb4b9
Author: Christian Dywan <christian at twotoasts.de>
Date:   Sat Nov 20 20:20:03 2010 +0100

    Add 'Mark message as Junk' button

 postler/postler-app.vala    |    1 +
 postler/postler-bureau.vala |   12 ++++++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/postler/postler-app.vala b/postler/postler-app.vala
index d6d009a..204bc64 100644
--- a/postler/postler-app.vala
+++ b/postler/postler-app.vala
@@ -31,6 +31,7 @@ namespace Postler {
     const string STOCK_MAIL_SEND = "stock_mail-send";
     const string STOCK_MAIL_SEND_RECEIVE = "mail-send-receive";
     const string STOCK_MAIL_MARK_IMPORTANT = "mail-mark-important";
+    const string STOCK_MAIL_MARK_JUNK = "mail-mark-junk";
     const string STOCK_MAIL_MARK_UNREAD = "mail-mark-unread";
     const string STOCK_MAIL_MESSAGE_NEW = "mail-message-new";
     const string STOCK_MAIL_REPLIED = "mail-replied";
diff --git a/postler/postler-bureau.vala b/postler/postler-bureau.vala
index 538c8dd..31ee89f 100644
--- a/postler/postler-bureau.vala
+++ b/postler/postler-bureau.vala
@@ -41,6 +41,7 @@ public class Postler.Bureau : Gtk.Window {
                     <menuitem action="MessageUnread"/>
                     <menuitem action="MessageFlag"/>
                     <menuitem action="MessageArchive"/>
+                    <menuitem action="MessageJunk"/>
                     <menuitem action="MessageDelete"/>
                     <separator/>
                     <menuitem action="Quit"/>
@@ -67,6 +68,7 @@ public class Postler.Bureau : Gtk.Window {
                 <toolitem action="MessageForward"/>
                 <separator/>
                 <toolitem action="MessageArchive"/>
+                <toolitem action="MessageJunk"/>
                 <toolitem action="MessageDelete"/>
                 <separator expand="true"/>
             </toolbar>
@@ -187,6 +189,10 @@ public class Postler.Bureau : Gtk.Window {
         messages.move_selected ("Archive");
     }
 
+    void action_junk () {
+        messages.move_selected ("Junk");
+    }
+
     void action_delete () {
         messages.delete_selected ();
     }
@@ -359,6 +365,8 @@ public class Postler.Bureau : Gtk.Window {
           N_("Flag message"), action_flag },
         { "MessageArchive", STOCK_ARCHIVE, null, "<Ctrl>e",
           N_("Archive message"), action_archive },
+        { "MessageJunk", STOCK_MAIL_MARK_JUNK, null, "<Ctrl>j",
+          N_("Mark message as Junk"), action_junk },
         { "MessageDelete", Gtk.STOCK_DELETE, null, "<Ctrl>d",
           N_("Delete message"), action_delete },
         { "Quit", Gtk.STOCK_QUIT, null, "<Ctrl>q",
@@ -494,6 +502,7 @@ public class Postler.Bureau : Gtk.Window {
         messages.set_size_request (250, 250);
         actions.get_action ("MessageFlag").sensitive = false;
         actions.get_action ("MessageArchive").sensitive = false;
+        actions.get_action ("MessageJunk").sensitive = false;
         actions.get_action ("MessageDelete").sensitive = false;
         messages.notify["selected-location"].connect ((object, pspec) => {
             Postler.Messages messages = object as Postler.Messages;
@@ -501,6 +510,9 @@ public class Postler.Bureau : Gtk.Window {
             actions.get_action ("MessageFlag").sensitive = state;
             actions.get_action ("MessageArchive").sensitive = state
                 && !folders.selected_location.has_suffix ("/Archive");
+            actions.get_action ("MessageJunk").sensitive = state
+                && !folders.selected_location.has_suffix ("/Junk")
+                && true; /* FIXME: only show button if Junk exists */
             actions.get_action ("MessageDelete").sensitive = state;
         });
         scrolled = new Postler.ScrolledWindow (messages);



More information about the Xfce4-commits mailing list