diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy.c | 67 |
1 files changed, 37 insertions, 30 deletions
diff --git a/src/empathy.c b/src/empathy.c index a80d39684..38fd56c54 100644 --- a/src/empathy.c +++ b/src/empathy.c @@ -323,39 +323,41 @@ create_salut_account_if_needed (EmpathyConnectionManagers *managers) } static void -connection_managers_ready_cb (EmpathyConnectionManagers *managers, - GParamSpec *spec, - gpointer user_data) +maybe_show_account_assistant (void) { - if (empathy_connection_managers_is_ready (managers)) + EmpathyAccountManager *manager; + manager = empathy_account_manager_dup_singleton (); + + if (empathy_account_manager_get_count (manager) == 0) { - empathy_import_mc4_accounts (); - create_salut_account_if_needed (managers); - g_object_unref (managers); - managers = NULL; + GtkWidget * assistant = empathy_account_assistant_new ( + GTK_WINDOW (empathy_main_window_get ())); + gtk_window_present (GTK_WINDOW (assistant)); } } -static void -create_salut_account (void) +static gboolean +check_connection_managers_ready (EmpathyConnectionManagers *managers) { - EmpathyConnectionManagers *managers; - - if (!should_create_salut_account ()) - return; - - managers = empathy_connection_managers_dup_singleton (); - if (empathy_connection_managers_is_ready (managers)) { + if (!empathy_import_mc4_accounts (managers)) + maybe_show_account_assistant (); + create_salut_account_if_needed (managers); g_object_unref (managers); + managers = NULL; + return TRUE; } - else - { - g_signal_connect (managers, "notify::ready", - G_CALLBACK (connection_managers_ready_cb), NULL); - } + return FALSE; +} + +static void +connection_managers_ready_cb (EmpathyConnectionManagers *managers, + GParamSpec *spec, + gpointer user_data) +{ + check_connection_managers_ready (managers); } static void @@ -536,19 +538,24 @@ account_manager_ready_cb (EmpathyAccountManager *manager, GParamSpec *spec, gpointer user_data) { - GtkWidget *assistant; - if (!empathy_account_manager_is_ready (manager)) return; - if (empathy_account_manager_get_count (manager) == 0) + if (should_create_salut_account () || !empathy_import_mc4_has_imported ()) { - assistant = empathy_account_assistant_new ( - GTK_WINDOW (empathy_main_window_get ())); - gtk_window_present (GTK_WINDOW (assistant)); - } + EmpathyConnectionManagers *managers; + managers = empathy_connection_managers_dup_singleton (); - create_salut_account (); + if (!check_connection_managers_ready (managers)) + { + g_signal_connect (managers, "notify::ready", + G_CALLBACK (connection_managers_ready_cb), NULL); + } + } + else + { + maybe_show_account_assistant (); + } } int |