#include <glib/gi18n-lib.h>
#include <telepathy-glib/account-manager.h>
+#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-connection-managers.h>
#include <libempathy-gtk/empathy-ui-utils.h>
gtk_widget_reparent (content, GTK_WIDGET (page));
}
+static void
+account_assistant_closed_cb (GtkWidget *widget,
+ gpointer user_data)
+{
+ CcEmpathyAccountsPage *page = CC_EMPATHY_ACCOUNTS_PAGE (user_data);
+
+ if (empathy_accounts_dialog_is_creating (
+ EMPATHY_ACCOUNTS_DIALOG (page->priv->accounts_window)))
+ {
+ empathy_account_dialog_cancel (
+ EMPATHY_ACCOUNTS_DIALOG (page->priv->accounts_window));
+ }
+}
+
static void
connection_managers_prepare (GObject *source,
GAsyncResult *result,
empathy_accounts_import (account_mgr, cm_mgr);
if (!empathy_accounts_has_non_salut_accounts (account_mgr))
- empathy_account_assistant_show (NULL, cm_mgr);
+ {
+ GtkWidget *w;
+ w = empathy_account_assistant_show (NULL, cm_mgr);
+
+ empathy_signal_connect_weak (w, "hide",
+ G_CALLBACK (account_assistant_closed_cb),
+ G_OBJECT (page));
+ }
out:
/* remove ref from active_changed() */
g_free (message_markup);
}
-static void
-empathy_account_dialog_widget_cancelled_cb (
- EmpathyAccountWidget *widget_object,
- EmpathyAccountsDialog *dialog)
+void
+empathy_account_dialog_cancel (EmpathyAccountsDialog *dialog)
{
GtkTreeView *view;
GtkTreeModel *model;
g_object_unref (settings);
}
+static void
+empathy_account_dialog_widget_cancelled_cb (
+ EmpathyAccountWidget *widget_object,
+ EmpathyAccountsDialog *dialog)
+{
+ empathy_account_dialog_cancel (dialog);
+}
+
static void
empathy_account_dialog_account_created_cb (EmpathyAccountWidget *widget_object,
TpAccount *account,
g_free (account_option);
g_free (path);
}
+
+gboolean
+empathy_account_dialog_is_creating (EmpathyAccountsDialog *dialog)
+{
+ EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog);
+ gboolean result = FALSE;
+
+ if (priv->setting_widget_object == NULL)
+ goto out;
+
+ g_object_get (priv->setting_widget_object,
+ "creating-account", &result, NULL);
+
+out:
+ return result;
+}
GType empathy_accounts_dialog_get_type (void);
GtkWidget *empathy_accounts_dialog_show (GtkWindow *parent,
TpAccount *selected_account);
+
+void empathy_account_dialog_cancel (EmpathyAccountsDialog *dialog);
+gboolean empathy_account_dialog_is_creating (EmpathyAccountsDialog *dialog);
+
void empathy_accounts_dialog_show_application (GdkScreen *screen,
GChildWatchFunc application_exit_cb,
gpointer user_data,