aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-02-10 00:56:40 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-02-10 00:56:40 +0800
commit2253498a5c1a8edaab0296b752c3327fc7b4e1f3 (patch)
treee899e1b9f26bcf95233bc311550b27c0b2b82aa4
parenta36df4571d37a9046e22e99d88e1a3642f612b8a (diff)
downloadgsoc2013-empathy-2253498a5c1a8edaab0296b752c3327fc7b4e1f3.tar
gsoc2013-empathy-2253498a5c1a8edaab0296b752c3327fc7b4e1f3.tar.gz
gsoc2013-empathy-2253498a5c1a8edaab0296b752c3327fc7b4e1f3.tar.bz2
gsoc2013-empathy-2253498a5c1a8edaab0296b752c3327fc7b4e1f3.tar.lz
gsoc2013-empathy-2253498a5c1a8edaab0296b752c3327fc7b4e1f3.tar.xz
gsoc2013-empathy-2253498a5c1a8edaab0296b752c3327fc7b4e1f3.tar.zst
gsoc2013-empathy-2253498a5c1a8edaab0296b752c3327fc7b4e1f3.zip
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.
-rw-r--r--src/empathy-account-assistant.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/empathy-account-assistant.c b/src/empathy-account-assistant.c
index bbc207788..9e835ec25 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;
}
}
}