[empathy] Create the account even when user chooses to not create other one after
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [empathy] Create the account even when user chooses to not create other one after
- Date: Tue, 9 Feb 2010 17:11:41 +0000 (UTC)
commit 2253498a5c1a8edaab0296b752c3327fc7b4e1f3
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Tue Feb 9 16:56:40 2010 +0000
Create the account even when user chooses to not create other one after
As the account is not created in impl_signal_apply() any more, we have to be
smarter in impl_signal_prepare and call account_assistant_apply_account_and_finish in more cases.
That also means that account_assistant_account_enabled_cb doesn't have to
terminate the assistant if the salut account has not been created yet.
Fixes bug #609220.
src/empathy-account-assistant.c | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/src/empathy-account-assistant.c b/src/empathy-account-assistant.c
index bbc2077..9e835ec 100644
--- a/src/empathy-account-assistant.c
+++ b/src/empathy-account-assistant.c
@@ -275,6 +275,8 @@ account_assistant_account_enabled_cb (GObject *source,
EmpathyAccountAssistantPriv *priv = GET_PRIV (self);
const gchar *protocol;
TpAccount *account = TP_ACCOUNT (source);
+ gint current_idx;
+ gboolean salut_created = FALSE;
tp_account_set_enabled_finish (account, result, &error);
@@ -292,8 +294,16 @@ account_assistant_account_enabled_cb (GObject *source,
empathy_conf_set_bool (empathy_conf_get (),
EMPATHY_PREFS_SALUT_ACCOUNT_CREATED,
TRUE);
+
+ salut_created = TRUE;
}
+ current_idx = gtk_assistant_get_current_page (GTK_ASSISTANT (self));
+ if (current_idx == PAGE_SALUT && !salut_created)
+ /* We are on the Salut page and aren't creating the salut account so don't
+ * terminate the assistant. */
+ return;
+
if (priv->create_enter_resp == RESPONSE_CREATE_STOP)
g_signal_emit_by_name (self, "close");
else
@@ -884,9 +894,9 @@ impl_signal_prepare (GtkAssistant *assistant,
current_idx = gtk_assistant_get_current_page (assistant);
- if (current_idx >= PAGE_ENTER_CREATE && current_idx != PAGE_SALUT)
+ if (current_idx >= PAGE_ENTER_CREATE)
{
- if (!priv->enter_create_forward)
+ if (!priv->enter_create_forward && current_idx != PAGE_SALUT)
{
account_assistant_finish_enter_or_create_page (self,
priv->first_resp == RESPONSE_ENTER_ACCOUNT ?
@@ -895,7 +905,14 @@ impl_signal_prepare (GtkAssistant *assistant,
else
{
priv->enter_create_forward = FALSE;
+ }
+
+ if (priv->settings != NULL &&
+ empathy_account_settings_is_valid (priv->settings))
+ {
account_assistant_apply_account_and_finish (self, priv->settings);
+ g_object_unref (priv->settings);
+ priv->settings = NULL;
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]