diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-01-21 22:33:00 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-01-25 22:13:39 +0800 |
commit | a24db41f217eea1cbf929cc3e623c50ca626db4b (patch) | |
tree | 040d3acff08bdb54b0e2b0bfe48999611ccce41c /src/empathy-account-assistant.c | |
parent | fcfdcc4011d7131d852d19474eb09eaa4a6e43d7 (diff) | |
download | gsoc2013-empathy-a24db41f217eea1cbf929cc3e623c50ca626db4b.tar gsoc2013-empathy-a24db41f217eea1cbf929cc3e623c50ca626db4b.tar.gz gsoc2013-empathy-a24db41f217eea1cbf929cc3e623c50ca626db4b.tar.bz2 gsoc2013-empathy-a24db41f217eea1cbf929cc3e623c50ca626db4b.tar.lz gsoc2013-empathy-a24db41f217eea1cbf929cc3e623c50ca626db4b.tar.xz gsoc2013-empathy-a24db41f217eea1cbf929cc3e623c50ca626db4b.tar.zst gsoc2013-empathy-a24db41f217eea1cbf929cc3e623c50ca626db4b.zip |
Pass a ready EmpathyConnectionManagers to empathy_account_assistant_show
This kinda suck but we have to construct the assistant in a sync way so can't
wait for the manager to become ready.
Diffstat (limited to 'src/empathy-account-assistant.c')
-rw-r--r-- | src/empathy-account-assistant.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/src/empathy-account-assistant.c b/src/empathy-account-assistant.c index 1e9fb32a9..519fc0701 100644 --- a/src/empathy-account-assistant.c +++ b/src/empathy-account-assistant.c @@ -65,7 +65,8 @@ enum { }; enum { - PROP_PARENT = 1 + PROP_PARENT = 1, + PROP_CONNECTION_MGRS, }; typedef struct { @@ -73,6 +74,7 @@ typedef struct { CreateEnterPageResponse create_enter_resp; gboolean enter_create_forward; TpAccountManager *account_mgr; + EmpathyConnectionManagers *connection_mgrs; /* enter or create page */ GtkWidget *enter_or_create_page; @@ -860,6 +862,9 @@ do_get_property (GObject *object, case PROP_PARENT: g_value_set_object (value, priv->parent_window); break; + case PROP_CONNECTION_MGRS: + g_value_set_object (value, priv->connection_mgrs); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } @@ -878,6 +883,9 @@ do_set_property (GObject *object, case PROP_PARENT: priv->parent_window = g_value_get_object (value); break; + case PROP_CONNECTION_MGRS: + priv->connection_mgrs = g_value_dup_object (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } @@ -895,6 +903,9 @@ do_constructed (GObject *object) /* set the dialog hint, so this will be centered over the parent window */ gtk_window_set_type_hint (GTK_WINDOW (object), GDK_WINDOW_TYPE_HINT_DIALOG); + + g_assert (priv->connection_mgrs != NULL); + g_assert (empathy_connection_managers_is_ready (priv->connection_mgrs)); } static void @@ -916,6 +927,9 @@ do_dispose (GObject *obj) g_object_unref (priv->account_mgr); priv->account_mgr = NULL; + g_object_unref (priv->connection_mgrs); + priv->connection_mgrs = NULL; + if (G_OBJECT_CLASS (empathy_account_assistant_parent_class)->dispose != NULL) G_OBJECT_CLASS (empathy_account_assistant_parent_class)->dispose (obj); } @@ -942,6 +956,12 @@ empathy_account_assistant_class_init (EmpathyAccountAssistantClass *klass) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY); g_object_class_install_property (oclass, PROP_PARENT, param_spec); + param_spec = g_param_spec_object ("connection-managers", + "connection-managers", "A EmpathyConnectionManagers", + EMPATHY_TYPE_CONNECTION_MANAGERS, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY); + g_object_class_install_property (oclass, PROP_CONNECTION_MGRS, param_spec); + g_type_class_add_private (klass, sizeof (EmpathyAccountAssistantPriv)); } @@ -1138,14 +1158,17 @@ empathy_account_assistant_init (EmpathyAccountAssistant *self) } GtkWidget * -empathy_account_assistant_show (GtkWindow *window) +empathy_account_assistant_show (GtkWindow *window, + EmpathyConnectionManagers *connection_mgrs) { static GtkWidget *dialog = NULL; if (dialog == NULL) { - dialog = g_object_new (EMPATHY_TYPE_ACCOUNT_ASSISTANT, "parent-window", - window, NULL); + dialog = g_object_new (EMPATHY_TYPE_ACCOUNT_ASSISTANT, + "parent-window", window, + "connection-managers", connection_mgrs, + NULL); g_object_add_weak_pointer (G_OBJECT (dialog), (gpointer *) &dialog); } |