]> git.0d.be Git - empathy.git/blobdiff - src/empathy-account-assistant.c
Merge branch 'sasl'
[empathy.git] / src / empathy-account-assistant.c
index 5859169032f8460f3f97decea558412247d36894..26032d7e8bc04a0b0468fd29e1a46fa0b9013b05 100644 (file)
@@ -381,57 +381,19 @@ static void
 account_assistant_protocol_changed_cb (GtkComboBox *chooser,
     EmpathyAccountAssistant *self)
 {
-  TpConnectionManager *cm;
-  TpConnectionManagerProtocol *proto;
   EmpathyAccountSettings *settings;
   EmpathyAccountAssistantPriv *priv;
-  char *str;
   GtkWidget *account_widget;
   EmpathyAccountWidget *widget_object = NULL;
-  gboolean is_gtalk, is_facebook;
-  const gchar *name;
 
   priv = GET_PRIV (self);
 
-  cm = empathy_protocol_chooser_dup_selected (
-      EMPATHY_PROTOCOL_CHOOSER (chooser), &proto, &is_gtalk, &is_facebook);
+  settings = empathy_protocol_chooser_create_account_settings (
+      EMPATHY_PROTOCOL_CHOOSER (chooser));
 
-  if (cm == NULL || proto == NULL)
-    /* we are not ready yet */
+  if (settings == NULL)
     return;
 
-  /* Create account */
-  if (is_gtalk)
-    name = "gtalk";
-  else if (is_facebook)
-    name = "facebook";
-  else
-    name = proto->name;
-
-  /* To translator: %s is the protocol name */
-  str = g_strdup_printf (_("New %s account"),
-      empathy_protocol_name_to_display_name (name));
-
-  settings = empathy_account_settings_new (cm->name, proto->name, str);
-
-  if (is_gtalk)
-    {
-      empathy_account_settings_set_icon_name_async (settings, "im-google-talk",
-        NULL, NULL);
-      /* We should not have to set the server but that may cause issue with
-       * buggy router. */
-      empathy_account_settings_set_string (settings, "server",
-          "talk.google.com");
-    }
-  else if (is_facebook)
-    {
-      empathy_account_settings_set_icon_name_async (settings, "im-facebook",
-        NULL, NULL);
-
-      empathy_account_settings_set_string (settings, "server",
-          "chat.facebook.com");
-    }
-
   if (priv->first_resp == RESPONSE_CREATE_ACCOUNT)
     empathy_account_settings_set_boolean (settings, "register", TRUE);
 
@@ -465,20 +427,16 @@ account_assistant_protocol_changed_cb (GtkComboBox *chooser,
   gtk_box_pack_start (GTK_BOX (priv->enter_or_create_page), account_widget,
       FALSE, FALSE, 0);
   gtk_widget_show (account_widget);
-
-  g_free (str);
 }
 
 static gboolean
 account_assistant_chooser_enter_details_filter_func (
     TpConnectionManager *cm,
     TpConnectionManagerProtocol *protocol,
-    gboolean is_gtalk,
-    gboolean is_facebook,
+    const gchar *service,
     gpointer user_data)
 {
-  if (!tp_strdiff (protocol->name, "local-xmpp") ||
-      !tp_strdiff (protocol->name, "irc"))
+  if (!tp_strdiff (protocol->name, "local-xmpp"))
     return FALSE;
 
   return TRUE;
@@ -488,11 +446,10 @@ static gboolean
 account_assistant_chooser_create_account_filter_func (
     TpConnectionManager *cm,
     TpConnectionManagerProtocol *protocol,
-    gboolean is_gtalk,
-    gboolean is_facebook,
+    const gchar *service,
     gpointer user_data)
 {
-  if (is_gtalk || is_facebook)
+  if (service != NULL)
     return FALSE;
 
   return tp_connection_manager_protocol_can_register (protocol);
@@ -698,8 +655,8 @@ account_assistant_build_introduction_page (EmpathyAccountAssistant *self)
           GINT_TO_POINTER (RESPONSE_IMPORT));
       gtk_widget_show (radio);
 
-      w = gtk_combo_box_new_text ();
-      gtk_combo_box_append_text (GTK_COMBO_BOX (w), "Pidgin");
+      w = gtk_combo_box_text_new ();
+      gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (w), "Pidgin");
       gtk_box_pack_start (GTK_BOX (hbox_1), w, TRUE, TRUE, 0);
       gtk_combo_box_set_active (GTK_COMBO_BOX (w), 0);
       gtk_widget_show (w);
@@ -1120,7 +1077,7 @@ account_assistant_build_salut_page (EmpathyAccountAssistant *self)
   gtk_box_pack_start (GTK_BOX (main_vbox), hbox_1, TRUE, TRUE, 0);
   gtk_widget_show (hbox_1);
 
-  w = gtk_label_new ("");
+  w = gtk_label_new (NULL);
   markup = g_strdup_printf ("%s (<span style=\"italic\">%s</span>).",
       _("Empathy can automatically discover and chat with the people "
         "connected on the same network as you. "