[Xfce4-commits] <postler:master> Don't update folder-specific actions if there's no folder
Christian Dywan
noreply at xfce.org
Fri Mar 11 20:52:01 CET 2011
Updating branch refs/heads/master
to 162f22dca3e3fc2451b4499d69c8ef57bf34100b (commit)
from e901c814c9cc78a3ab5a15be486af2e3feb9855a (commit)
commit 162f22dca3e3fc2451b4499d69c8ef57bf34100b
Author: Christian Dywan <christian at twotoasts.de>
Date: Fri Mar 11 20:38:31 2011 +0100
Don't update folder-specific actions if there's no folder
postler/postler-bureau.vala | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/postler/postler-bureau.vala b/postler/postler-bureau.vala
index b169e2e..2aa10d3 100644
--- a/postler/postler-bureau.vala
+++ b/postler/postler-bureau.vala
@@ -653,6 +653,16 @@ public class Postler.Bureau : Gtk.Window {
folders.set_size_request (100, 100);
search.sensitive = false;
folders.notify["selected-location"].connect ((object, pspec) => {
+ search.sensitive = folders.selected_location != null;
+ if (search_options.visible)
+ GLib.Idle.add (() => {
+ search.activate ();
+ return false;
+ });
+
+ if (folders.get_selected_account () == null)
+ return;
+
string folder = Path.get_basename (folders.selected_location ?? "");
var action = actions.get_action ("MessageJunk");
if (folder == folders.get_selected_account ().get_folder (FolderType.JUNK)) {
@@ -670,12 +680,6 @@ public class Postler.Bureau : Gtk.Window {
action.stock_id = Gtk.STOCK_DELETE;
action.tooltip = _("Delete message");
}
- search.sensitive = folders.selected_location != null;
- if (search_options.visible)
- GLib.Idle.add (() => {
- search.activate ();
- return false;
- });
});
var folderbox = new Gtk.HBox (false, 4);
var scrolled = new Postler.ScrolledWindow (folders);
More information about the Xfce4-commits
mailing list