From: Guillaume Desmottes Date: Wed, 15 Feb 2012 14:28:18 +0000 (+0100) Subject: accounts-dialog: display the import dialog if there is no account X-Git-Url: https://git.0d.be/?p=empathy.git;a=commitdiff_plain;h=692672af8d6a30c6550571a424b4546a0dea98f7 accounts-dialog: display the import dialog if there is no account This is the first step of merging the accounts-dialog and assistant. https://bugzilla.gnome.org/show_bug.cgi?id=652669 --- diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c index 6c452b6b..934e4986 100644 --- a/src/empathy-accounts-dialog.c +++ b/src/empathy-accounts-dialog.c @@ -53,6 +53,7 @@ #include #include +#include "empathy-accounts-common.h" #include "empathy-accounts-dialog.h" #include "empathy-import-dialog.h" #include "empathy-import-utils.h" @@ -2052,6 +2053,20 @@ accounts_dialog_set_selected_account (EmpathyAccountsDialog *dialog, select_and_scroll_to_iter (dialog, &iter); } +static void +maybe_show_import_dialog (EmpathyAccountsDialog *self) +{ + EmpathyAccountsDialogPriv *priv = GET_PRIV (self); + + if (empathy_accounts_has_non_salut_accounts (priv->account_manager)) + return; + + if (!empathy_import_accounts_to_import ()) + return; + + display_import_dialog (self); +} + static void finished_loading (EmpathyAccountsDialog *self) { @@ -2073,6 +2088,8 @@ finished_loading (EmpathyAccountsDialog *self) gtk_spinner_stop (GTK_SPINNER (priv->spinner)); gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook_account), NOTEBOOK_PAGE_ACCOUNT); + + maybe_show_import_dialog (self); } static void