#include <stdlib.h>
#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-#include <unique/unique.h>
+#include <glib/gi18n-lib.h>
#include <telepathy-glib/account-manager.h>
#include <telepathy-glib/util.h>
#include "empathy-accounts-common.h"
#include "empathy-accounts-dialog.h"
#include "empathy-account-assistant.h"
-#include "empathy-import-mc4-accounts.h"
#include "empathy-auto-salut-account-helper.h"
#define DEBUG_FLAG EMPATHY_DEBUG_ACCOUNT
return ret;
}
-/* Try to import accounts from MC4 and returns TRUE if we should display the
- * accounts assistant. */
gboolean
-empathy_accounts_import (TpAccountManager *account_mgr,
- EmpathyConnectionManagers *cm_mgr)
+empathy_accounts_has_accounts (TpAccountManager *manager)
{
- g_return_val_if_fail (tp_account_manager_is_prepared (account_mgr,
- TP_ACCOUNT_MANAGER_FEATURE_CORE), FALSE);
- g_return_val_if_fail (empathy_connection_managers_is_ready (cm_mgr), FALSE);
+ GList *accounts;
+ gboolean has_accounts;
- if (empathy_import_mc4_has_imported ())
- return FALSE;
-
- if (empathy_import_mc4_accounts (cm_mgr))
- return FALSE;
-
- if (empathy_accounts_has_non_salut_accounts (account_mgr))
- return FALSE;
-
- if (!should_create_salut_account (account_mgr))
- return FALSE;
+ accounts = tp_account_manager_get_valid_accounts (manager);
+ has_accounts = (accounts != NULL);
+ g_list_free (accounts);
- return TRUE;
+ return has_accounts;
}
static void
TpAccount *account,
GCallback window_destroyed_cb)
{
- GtkWidget *accounts_window;
+ static GtkWidget *accounts_window = NULL;
- accounts_window = empathy_accounts_dialog_show (NULL, account);
+ if (accounts_window == NULL)
+ accounts_window = empathy_accounts_dialog_show (NULL, account);
if (window_destroyed_cb)
g_signal_connect (accounts_window, "destroy", window_destroyed_cb, NULL);
goto out;
show_account_assistant (cm_mgr, assistant_destroy_cb);
- g_debug ("would show the account assistant");
+ DEBUG ("would show the account assistant");
out:
g_object_unref (cm_mgr);