Commit 2253498a authored by Guillaume Desmottes's avatar Guillaume Desmottes

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.
parent a36df457
......@@ -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;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment