diff options
author | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2009-10-14 07:22:40 +0800 |
---|---|---|
committer | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2009-10-15 01:26:03 +0800 |
commit | e288bb38a4f04cf4ce00e77b5b81937eda2f0a12 (patch) | |
tree | f3d9ea94a03f443e657d0961e8284b84bf7add4c /src/empathy.c | |
parent | dd33e47cf95d374d9dfb9d0346cf2977c9393a21 (diff) | |
download | gsoc2013-empathy-e288bb38a4f04cf4ce00e77b5b81937eda2f0a12.tar.gz gsoc2013-empathy-e288bb38a4f04cf4ce00e77b5b81937eda2f0a12.tar.zst gsoc2013-empathy-e288bb38a4f04cf4ce00e77b5b81937eda2f0a12.zip |
Show the assistant if there are no non-salut accounts
Diffstat (limited to 'src/empathy.c')
-rw-r--r-- | src/empathy.c | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/src/empathy.c b/src/empathy.c index 1226b55dd..9152b643d 100644 --- a/src/empathy.c +++ b/src/empathy.c @@ -313,18 +313,37 @@ create_salut_account_if_needed (EmpathyConnectionManagers *managers) g_object_unref (book); } +static gboolean +has_non_salut_accounts (EmpathyAccountManager *manager) +{ + gboolean ret = FALSE; + GList *accounts, *l; + + accounts = empathy_account_manager_dup_accounts (manager); + + for (l = accounts ; l != NULL; l = g_list_next (l)) + { + EmpathyAccount *account = EMPATHY_ACCOUNT (l->data); + + if (tp_strdiff (empathy_account_get_protocol (l->data), "local-xmpp")) + ret = TRUE; + + g_object_unref (account); + } + + g_list_free (accounts); + + return ret; +} + static void maybe_show_account_assistant (void) { EmpathyAccountManager *manager; manager = empathy_account_manager_dup_singleton (); - if (empathy_account_manager_get_count (manager) == 0) - { - GtkWidget * assistant = empathy_account_assistant_new ( - GTK_WINDOW (empathy_main_window_get ())); - gtk_window_present (GTK_WINDOW (assistant)); - } + if (!has_non_salut_accounts (manager)) + empathy_account_assistant_show (GTK_WINDOW (empathy_main_window_get ())); } static gboolean |