[Xfce4-commits] <postler:master> Change Delete into Restore similar to Junk/ Non-Junk
Christian Dywan
noreply at xfce.org
Fri Jan 21 17:28:06 CET 2011
Updating branch refs/heads/master
to cd782645626678f40be384861d73e077f0e33871 (commit)
from d0cacc3aed4455de7f28ef0124c9939f8c81e0a2 (commit)
commit cd782645626678f40be384861d73e077f0e33871
Author: Christian Dywan <christian at twotoasts.de>
Date: Fri Jan 21 17:27:21 2011 +0100
Change Delete into Restore similar to Junk/ Non-Junk
postler/postler-bureau.vala | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/postler/postler-bureau.vala b/postler/postler-bureau.vala
index f802fb7..41f233e 100644
--- a/postler/postler-bureau.vala
+++ b/postler/postler-bureau.vala
@@ -193,7 +193,11 @@ public class Postler.Bureau : Gtk.Window {
}
void action_delete () {
- messages.delete_selected ();
+ string folder = Path.get_basename (folders.selected_location);
+ if (folder != messages.account_info.get_folder (FolderType.TRASH))
+ messages.move_selected (FolderType.TRASH);
+ else
+ messages.move_selected (FolderType.INBOX);
}
void action_search () {
@@ -608,7 +612,17 @@ public class Postler.Bureau : Gtk.Window {
action.stock_id = STOCK_MAIL_MARK_NOT_JUNK;
action.tooltip = _("Mark message as not junk");
}
- actions.get_action ("MessageDelete").sensitive = state;
+ action = actions.get_action ("MessageDelete");
+ action.sensitive = state
+ && messages.account_info.get_folder (FolderType.TRASH) != null;
+ if (state &&
+ folder != messages.account_info.get_folder (FolderType.TRASH)) {
+ action.stock_id = Gtk.STOCK_DELETE;
+ action.tooltip = _("Delete message");
+ } else if (state) {
+ action.stock_id = Gtk.STOCK_UNDELETE;
+ action.tooltip = _("Restore message");
+ }
});
scrolled = new Postler.ScrolledWindow (messages);
messages_box.pack_start (scrolled, true, true, 0);
More information about the Xfce4-commits
mailing list