aboutsummaryrefslogtreecommitdiffstats
path: root/src/cc-empathy-accounts-page.c
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2010-03-04 20:19:32 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2010-03-05 00:53:54 +0800
commitc15ddf6b53db97e61acd45da5fd8cc9f804d7625 (patch)
tree73b5b121b5e915caa9cd919fbd5a7f3602dd7400 /src/cc-empathy-accounts-page.c
parent878756780bc822f5626101d6abd2157b99e9e3c8 (diff)
downloadgsoc2013-empathy-c15ddf6b53db97e61acd45da5fd8cc9f804d7625.tar
gsoc2013-empathy-c15ddf6b53db97e61acd45da5fd8cc9f804d7625.tar.gz
gsoc2013-empathy-c15ddf6b53db97e61acd45da5fd8cc9f804d7625.tar.bz2
gsoc2013-empathy-c15ddf6b53db97e61acd45da5fd8cc9f804d7625.tar.lz
gsoc2013-empathy-c15ddf6b53db97e61acd45da5fd8cc9f804d7625.tar.xz
gsoc2013-empathy-c15ddf6b53db97e61acd45da5fd8cc9f804d7625.tar.zst
gsoc2013-empathy-c15ddf6b53db97e61acd45da5fd8cc9f804d7625.zip
Cancel creation in the accounts dialog if the wizard is running
If the account wizard is finished it should have created at least some accounts. Cancel any account creation that was going on in the accounts dialog so it nicely jumps showing the first real account :)
Diffstat (limited to 'src/cc-empathy-accounts-page.c')
-rw-r--r--src/cc-empathy-accounts-page.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/cc-empathy-accounts-page.c b/src/cc-empathy-accounts-page.c
index ef9b17557..383e20d41 100644
--- a/src/cc-empathy-accounts-page.c
+++ b/src/cc-empathy-accounts-page.c
@@ -28,6 +28,7 @@
#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>
@@ -75,6 +76,20 @@ page_pack_with_accounts_dialog (CcEmpathyAccountsPage *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,
gpointer user_data)
@@ -96,7 +111,14 @@ connection_managers_prepare (GObject *source,
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() */