aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-11-13 06:45:32 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-11-13 06:45:32 +0800
commit4bfec872a7462d9fb8f53912194e0ce067461ffc (patch)
tree7ec7b08cc526d08433d9513469339500d4314948
parent6461ecea2713e395db0999734481a6fd98ef510a (diff)
downloadgsoc2013-evolution-4bfec872a7462d9fb8f53912194e0ce067461ffc.tar
gsoc2013-evolution-4bfec872a7462d9fb8f53912194e0ce067461ffc.tar.gz
gsoc2013-evolution-4bfec872a7462d9fb8f53912194e0ce067461ffc.tar.bz2
gsoc2013-evolution-4bfec872a7462d9fb8f53912194e0ce067461ffc.tar.lz
gsoc2013-evolution-4bfec872a7462d9fb8f53912194e0ce067461ffc.tar.xz
gsoc2013-evolution-4bfec872a7462d9fb8f53912194e0ce067461ffc.tar.zst
gsoc2013-evolution-4bfec872a7462d9fb8f53912194e0ce067461ffc.zip
Bug 663372 - Actions not updated after disabling account
-rw-r--r--modules/mail/e-mail-shell-view-actions.c2
-rw-r--r--shell/e-shell-view.c26
2 files changed, 27 insertions, 1 deletions
diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c
index f752506306..82204ec85b 100644
--- a/modules/mail/e-mail-shell-view-actions.c
+++ b/modules/mail/e-mail-shell-view-actions.c
@@ -123,6 +123,8 @@ action_mail_account_disable_cb (GtkAction *action,
e_account_list_remove (account_list, account);
e_account_list_save (account_list);
+
+ e_shell_view_update_actions (shell_view);
}
static void
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index 370aa90403..a2fc00e3b5 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -73,6 +73,9 @@ struct _EShellViewPrivate {
guint update_actions_blocked;
gboolean update_actions_called;
+
+ GtkWidget *preferences_window;
+ gulong preferences_hide_id;
};
enum {
@@ -547,6 +550,15 @@ shell_view_dispose (GObject *object)
priv->search_rule = NULL;
}
+ if (priv->preferences_window != NULL) {
+ g_signal_handler_disconnect (
+ priv->preferences_window,
+ priv->preferences_hide_id);
+ g_object_unref (priv->preferences_window);
+ priv->preferences_window = NULL;
+ priv->preferences_hide_id = 0;
+ }
+
/* Chain up to parent's dispose() method. */
G_OBJECT_CLASS (parent_class)->dispose (object);
}
@@ -570,13 +582,18 @@ shell_view_finalize (GObject *object)
static void
shell_view_constructed (GObject *object)
{
- EShellViewClass *shell_view_class;
+ EShell *shell;
EShellView *shell_view;
+ EShellBackend *shell_backend;
+ EShellViewClass *shell_view_class;
GtkWidget *widget;
shell_view = E_SHELL_VIEW (object);
shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view);
+ shell_backend = e_shell_view_get_shell_backend (shell_view);
+ shell = e_shell_backend_get_shell (shell_backend);
+
shell_view_load_state (shell_view);
/* Invoke factory methods. */
@@ -604,6 +621,13 @@ shell_view_constructed (GObject *object)
g_object_unref (shell_view->priv->size_group);
shell_view->priv->size_group = NULL;
+ /* Update actions whenever the Preferences window is closed. */
+ widget = e_shell_get_preferences_window (shell);
+ shell_view->priv->preferences_window = g_object_ref (widget);
+ shell_view->priv->preferences_hide_id = g_signal_connect_swapped (
+ shell_view->priv->preferences_window, "hide",
+ G_CALLBACK (e_shell_view_update_actions), shell_view);
+
e_extensible_load_extensions (E_EXTENSIBLE (object));
/* Chain up to parent's constructed() method. */