[Xfce4-commits] <postler:master> Implement Archive button, shortcut and folder
Christian Dywan
noreply at xfce.org
Sat Jul 10 00:24:06 CEST 2010
Updating branch refs/heads/master
to 6488c0b9fe093541db6e375a66c84dfd4ac8be5a (commit)
from 8774205db315a60e9a064e163a2f7e6c7acbea6a (commit)
commit 6488c0b9fe093541db6e375a66c84dfd4ac8be5a
Author: Christian Dywan <christian at twotoasts.de>
Date: Sun Jun 27 22:31:44 2010 +0200
Implement Archive button, shortcut and folder
postler/postler-app.vala | 2 ++
postler/postler-bureau.vala | 10 ++++++++++
postler/postler-folders.vala | 3 ++-
3 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/postler/postler-app.vala b/postler/postler-app.vala
index 1234c7c..0fe17b0 100644
--- a/postler/postler-app.vala
+++ b/postler/postler-app.vala
@@ -11,6 +11,7 @@
namespace Postler {
const string STOCK_ADDRESSBOOK = "stock_addressbook";
+ const string STOCK_ARCHIVE = "gnome-mime-application-x-archive";
const string STOCK_EMBLEM_DRAFT = "emblem-draft";
const string STOCK_EMBLEM_IMPORTANT = "emblem-important";
const string STOCK_FACE_SMILE_BIG = "face-smile-big";
@@ -45,6 +46,7 @@ public class Postler.App : Unique.App {
const Gtk.StockItem[] stock_items = {
{ STOCK_ADDRESSBOOK, N_("_Addressbook") },
+ { STOCK_ARCHIVE, N_("Archi_ve") },
{ STOCK_EMBLEM_DRAFT },
{ STOCK_EMBLEM_IMPORTANT },
{ STOCK_FACE_SMILE_BIG },
diff --git a/postler/postler-bureau.vala b/postler/postler-bureau.vala
index 8a9134a..a422215 100644
--- a/postler/postler-bureau.vala
+++ b/postler/postler-bureau.vala
@@ -36,6 +36,7 @@ public class Postler.Bureau : Gtk.Window {
<menuitem action="MessageReplyAll"/>
<menuitem action="MessageForward"/>
<separator/>
+ <menuitem action="MessageArchive"/>
<menuitem action="MessageDelete"/>
<separator/>
<menuitem action="Quit"/>
@@ -62,6 +63,7 @@ public class Postler.Bureau : Gtk.Window {
<toolitem action="MessageReplyAll"/>
<toolitem action="MessageForward"/>
<separator/>
+ <toolitem action="MessageArchive"/>
<toolitem action="MessageDelete"/>
<separator/>
<toolitem action="View">
@@ -129,6 +131,10 @@ public class Postler.Bureau : Gtk.Window {
/* TODO */
}
+ void action_archive () {
+ messages.move_selected ("Archive");
+ }
+
void action_delete () {
messages.delete_selected ();
}
@@ -240,6 +246,8 @@ public class Postler.Bureau : Gtk.Window {
N_("Reply to all recipients"), action_message_reply_all },
{ "MessageForward", STOCK_MAIL_FORWARD, null, "<Ctrl>f",
N_("Forward message"), action_message_forward },
+ { "MessageArchive", STOCK_ARCHIVE, null, "<Ctrl>e",
+ N_("Archive message"), action_archive },
{ "MessageDelete", Gtk.STOCK_DELETE, null, "<Ctrl>d",
N_("Delete message"), action_delete },
{ "Quit", Gtk.STOCK_QUIT, null, "<Ctrl>q",
@@ -382,6 +390,8 @@ public class Postler.Bureau : Gtk.Window {
messages.notify["selected-location"].connect ((object, pspec) => {
Postler.Messages messages = object as Postler.Messages;
bool state = messages.selected_location != null;
+ actions.get_action ("MessageArchive").sensitive = state
+ && !folders.selected_location.has_suffix ("/Archive");
actions.get_action ("MessageDelete").sensitive = state;
});
scrolled = new Postler.ScrolledWindow (messages);
diff --git a/postler/postler-folders.vala b/postler/postler-folders.vala
index 535a5e6..1a46e1c 100644
--- a/postler/postler-folders.vala
+++ b/postler/postler-folders.vala
@@ -68,7 +68,8 @@ public class Postler.Folders : Gtk.TreeView {
{ "Sent", STOCK_SENT_MAIL, N_("Sent") },
{ "Drafts", null, N_("Drafts") },
{ "Queue", STOCK_OUTBOX, N_("Outbox") },
- { "Trash", STOCK_USER_TRASH, N_("Trash") }
+ { "Trash", STOCK_USER_TRASH, N_("Trash") },
+ { "Archive", STOCK_ARCHIVE, N_("Archive") }
};
void unread_monitor_changed (File msg_dir, string path, string account) {
More information about the Xfce4-commits
mailing list