From 77c57d35a578027d6f5ffea14483ba8762ad995a Mon Sep 17 00:00:00 2001 From: Danielle Madeley Date: Wed, 10 Mar 2010 15:54:51 +1100 Subject: empathy-accounts: make CcPage insensitive when assistant is being shown Also destroy assistant when CcPanel becomes inactive. --- src/cc-empathy-accounts-panel.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'src/cc-empathy-accounts-panel.c') diff --git a/src/cc-empathy-accounts-panel.c b/src/cc-empathy-accounts-panel.c index 63500e66c..d69325b7b 100644 --- a/src/cc-empathy-accounts-panel.c +++ b/src/cc-empathy-accounts-panel.c @@ -28,6 +28,9 @@ #include +#define DEBUG_FLAG EMPATHY_DEBUG_ACCOUNT +#include + #include "cc-empathy-accounts-panel.h" #include "cc-empathy-accounts-page.h" @@ -55,6 +58,24 @@ setup_panel (CcEmpathyAccountsPanel *panel) NULL); } +static void +cc_empathy_accounts_panel_active_changed (CcPanel *self, + gboolean is_active) +{ + DEBUG ("%s: active = %i", G_STRLOC, is_active); + + if (!is_active) + { + /* why doesn't control-center call active-changed on the Page? */ + cc_empathy_accounts_page_destroy_dialogs ( + CC_EMPATHY_ACCOUNTS_PAGE ( + CC_EMPATHY_ACCOUNTS_PANEL (self)->priv->empathy_accounts_page)); + } + + CC_PANEL_CLASS (cc_empathy_accounts_panel_parent_class)->active_changed ( + self, is_active); +} + static GObject * cc_empathy_accounts_panel_constructor (GType type, guint n_construct_properties, @@ -96,7 +117,10 @@ cc_empathy_accounts_panel_finalize (GObject *object) static void cc_empathy_accounts_panel_class_init (CcEmpathyAccountsPanelClass *klass) { - GObjectClass *object_class = G_OBJECT_CLASS (klass); + CcPanelClass *panel_class = CC_PANEL_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + panel_class->active_changed = cc_empathy_accounts_panel_active_changed; object_class->constructor = cc_empathy_accounts_panel_constructor; object_class->finalize = cc_empathy_accounts_panel_finalize; -- cgit