]> git.0d.be Git - empathy.git/commitdiff
Create the account even when user chooses to not create other one after
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 9 Feb 2010 16:56:40 +0000 (16:56 +0000)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 9 Feb 2010 16:56:40 +0000 (16:56 +0000)
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

index bbc207788a14e9e2f52e11d68c9439cbb973b6a0..9e835ec25cab0504360f425803104fe6685abe2d 100644 (file)
@@ -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;
         }
     }
 }