]> git.0d.be Git - empathy.git/commitdiff
accounts-dialog: use the new account dialog
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 21 Dec 2011 15:24:56 +0000 (16:24 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 22 Dec 2011 09:46:20 +0000 (10:46 +0100)
src/empathy-accounts-dialog.c

index 139f03db927780806e600fbf6711c806444820ef..de15cae830abcf07ffdd8e1fcc985084e26fe944 100644 (file)
@@ -51,6 +51,7 @@
 #include <libempathy-gtk/empathy-cell-renderer-activatable.h>
 #include <libempathy-gtk/empathy-contact-widget.h>
 #include <libempathy-gtk/empathy-images.h>
+#include <libempathy-gtk/empathy-new-account-dialog.h>
 
 #include "empathy-accounts-dialog.h"
 #include "empathy-import-dialog.h"
@@ -1018,10 +1019,28 @@ get_dialog_primary_text (TpAccount *account)
 
 static void
 accounts_dialog_button_add_clicked_cb (GtkWidget *button,
-    EmpathyAccountsDialog *dialog)
+    EmpathyAccountsDialog *self)
 {
-  accounts_dialog_setup_ui_to_add_account (dialog);
-  account_dialog_create_edit_params_dialog (dialog);
+  GtkWidget *dialog;
+  gint response;
+
+  dialog = empathy_new_account_dialog_new (GTK_WINDOW (self));
+  gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
+
+  response = gtk_dialog_run (GTK_DIALOG (dialog));
+
+  if (response == GTK_RESPONSE_OK)
+    {
+      EmpathyAccountSettings *settings;
+
+      settings = empathy_new_account_dialog_get_settings (
+          EMPATHY_NEW_ACCOUNT_DIALOG (dialog));
+
+      accounts_dialog_add (self, settings);
+      accounts_dialog_model_set_selected (self, settings);
+    }
+
+  gtk_widget_destroy (dialog);
 }
 
 static void