aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTravis Reitter <treitter@gmail.com>2010-03-03 01:06:12 +0800
committerTravis Reitter <treitter@gmail.com>2010-03-03 01:16:52 +0800
commit52d67df161e27a893bc24a13a50d86bf251f5ad9 (patch)
tree07dc9ce77de2b4a4f8e6528d4c8bd32dd1b36e10
parent0309966cb4998548e404c1d76bd6c94a5e0f4259 (diff)
downloadgsoc2013-empathy-52d67df161e27a893bc24a13a50d86bf251f5ad9.tar
gsoc2013-empathy-52d67df161e27a893bc24a13a50d86bf251f5ad9.tar.gz
gsoc2013-empathy-52d67df161e27a893bc24a13a50d86bf251f5ad9.tar.bz2
gsoc2013-empathy-52d67df161e27a893bc24a13a50d86bf251f5ad9.tar.lz
gsoc2013-empathy-52d67df161e27a893bc24a13a50d86bf251f5ad9.tar.xz
gsoc2013-empathy-52d67df161e27a893bc24a13a50d86bf251f5ad9.tar.zst
gsoc2013-empathy-52d67df161e27a893bc24a13a50d86bf251f5ad9.zip
Remove EmpathyAccountsPlugin's requirement that it be a singleton, so we can reset the embedded control panel to a sane state every time we open it.
-rw-r--r--src/cc-empathy-accounts-page.c26
-rw-r--r--src/empathy-accounts-dialog.c27
2 files changed, 15 insertions, 38 deletions
diff --git a/src/cc-empathy-accounts-page.c b/src/cc-empathy-accounts-page.c
index 15c7e5689..10c333ff3 100644
--- a/src/cc-empathy-accounts-page.c
+++ b/src/cc-empathy-accounts-page.c
@@ -54,20 +54,24 @@ page_pack_with_accounts_dialog (CcEmpathyAccountsPage *page)
GtkWidget *content;
GtkWidget *action_area;
- if (!page->priv->accounts_window)
+ if (page->priv->accounts_window != NULL)
{
- page->priv->accounts_window = empathy_accounts_dialog_show (NULL, NULL);
- gtk_widget_hide (page->priv->accounts_window);
+ gtk_widget_destroy (page->priv->accounts_window);
+ gtk_container_remove (GTK_CONTAINER (page),
+ gtk_bin_get_child (GTK_BIN (page)));
+ }
- content = gtk_dialog_get_content_area (
- GTK_DIALOG (page->priv->accounts_window));
- action_area = gtk_dialog_get_action_area (
- GTK_DIALOG (page->priv->accounts_window));
- gtk_widget_set_no_show_all (action_area, TRUE);
- gtk_widget_hide (action_area);
+ page->priv->accounts_window = empathy_accounts_dialog_show (NULL, NULL);
+ gtk_widget_hide (page->priv->accounts_window);
- gtk_widget_reparent (content, GTK_WIDGET (page));
- }
+ content = gtk_dialog_get_content_area (
+ GTK_DIALOG (page->priv->accounts_window));
+ action_area = gtk_dialog_get_action_area (
+ GTK_DIALOG (page->priv->accounts_window));
+ gtk_widget_set_no_show_all (action_area, TRUE);
+ gtk_widget_hide (action_area);
+
+ gtk_widget_reparent (content, GTK_WIDGET (page));
}
static void
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index a3a3b7e88..18f976b35 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -72,8 +72,6 @@
#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyAccountsDialog)
G_DEFINE_TYPE (EmpathyAccountsDialog, empathy_accounts_dialog, GTK_TYPE_DIALOG);
-static EmpathyAccountsDialog *dialog_singleton = NULL;
-
typedef struct {
GtkWidget *alignment_settings;
GtkWidget *alignment_infobar;
@@ -2147,30 +2145,6 @@ do_dispose (GObject *obj)
G_OBJECT_CLASS (empathy_accounts_dialog_parent_class)->dispose (obj);
}
-static GObject *
-do_constructor (GType type,
- guint n_props,
- GObjectConstructParam *props)
-{
- GObject *retval;
-
- if (dialog_singleton)
- {
- retval = G_OBJECT (dialog_singleton);
- }
- else
- {
- retval =
- G_OBJECT_CLASS (empathy_accounts_dialog_parent_class)->constructor
- (type, n_props, props);
-
- dialog_singleton = EMPATHY_ACCOUNTS_DIALOG (retval);
- g_object_add_weak_pointer (retval, (gpointer) &dialog_singleton);
- }
-
- return retval;
-}
-
static void
do_get_property (GObject *object,
guint property_id,
@@ -2256,7 +2230,6 @@ empathy_accounts_dialog_class_init (EmpathyAccountsDialogClass *klass)
GObjectClass *oclass = G_OBJECT_CLASS (klass);
GParamSpec *param_spec;
- oclass->constructor = do_constructor;
oclass->dispose = do_dispose;
oclass->constructed = do_constructed;
oclass->set_property = do_set_property;