]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-contact-dialogs.c
empathy-tube-handler: wait that tube is ready before announcing it
[empathy.git] / libempathy-gtk / empathy-contact-dialogs.c
index 49746bafc62ddc19812da2ee4afe2b967e415c1b..72b5b28b38be9eb4d4611d0e582c7504e8d12031 100644 (file)
@@ -25,8 +25,7 @@
 #include <stdlib.h>
 
 #include <gtk/gtk.h>
-#include <glade/glade.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
 
 #include <libmissioncontrol/mission-control.h>
 
@@ -68,7 +67,7 @@ subscription_dialog_response_cb (GtkDialog *dialog,
        EmpathyContactManager *manager;
        EmpathyContact        *contact;
 
-       manager = empathy_contact_manager_new ();
+       manager = empathy_contact_manager_dup_singleton ();
        contact = empathy_contact_widget_get_contact (contact_widget);
 
        if (response == GTK_RESPONSE_YES) {
@@ -89,6 +88,7 @@ void
 empathy_subscription_dialog_show (EmpathyContact *contact,
                                  GtkWindow     *parent)
 {
+       GtkBuilder *gui;
        GtkWidget *dialog;
        GtkWidget *hbox_subscription;
        GtkWidget *contact_widget;
@@ -105,15 +105,14 @@ empathy_subscription_dialog_show (EmpathyContact *contact,
                return;
        }
 
-       filename = empathy_file_lookup ("empathy-contact-dialogs.glade",
+       filename = empathy_file_lookup ("empathy-contact-dialogs.ui",
                                        "libempathy-gtk");
-       empathy_glade_get_file_simple (filename,
-                                     "subscription_request_dialog",
-                                     NULL,
+       gui = empathy_builder_get_file (filename,
                                      "subscription_request_dialog", &dialog,
                                      "hbox_subscription", &hbox_subscription,
                                      NULL);
        g_free (filename);
+       g_object_unref (gui);
 
        contact_widget = empathy_contact_widget_new (contact,
                                                     EMPATHY_CONTACT_WIDGET_EDIT_ALIAS |
@@ -122,6 +121,8 @@ empathy_subscription_dialog_show (EmpathyContact *contact,
                          contact_widget,
                          TRUE, TRUE,
                          0);
+       gtk_widget_show (contact_widget);
+
 
        g_object_set_data (G_OBJECT (dialog), "contact_widget", contact_widget);
        subscription_dialogs = g_list_prepend (subscription_dialogs, dialog);
@@ -208,6 +209,7 @@ empathy_contact_information_dialog_show (EmpathyContact *contact,
                flags |= EMPATHY_CONTACT_WIDGET_EDIT_GROUPS;
        }
        contact_widget = empathy_contact_widget_new (contact, flags);
+       gtk_container_set_border_width (GTK_CONTAINER (contact_widget), 8);
        gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
                            contact_widget,
                            TRUE, TRUE, 0);
@@ -216,6 +218,7 @@ empathy_contact_information_dialog_show (EmpathyContact *contact,
                                                           empathy_account_chooser_filter_is_connected,
                                                           NULL);
        }
+       gtk_widget_show (contact_widget);
 
        g_object_set_data (G_OBJECT (dialog), "contact_widget", contact_widget);
        information_dialogs = g_list_prepend (information_dialogs, dialog);
@@ -239,14 +242,14 @@ static gboolean
 can_add_contact_to_account (McAccount *account,
                            gpointer   user_data)
 {
-  EmpathyContactManager *mgr;
-  gboolean result;
+       EmpathyContactManager *mgr;
+       gboolean               result;
 
-  mgr = empathy_contact_manager_new ();
-  result = empathy_contact_manager_can_add (mgr, account);
-  g_object_unref (mgr);
+       mgr = empathy_contact_manager_dup_singleton ();
+       result = empathy_contact_manager_can_add (mgr, account);
+       g_object_unref (mgr);
 
-  return result;
+       return result;
 }
 
 static void
@@ -257,7 +260,7 @@ new_contact_response_cb (GtkDialog *dialog,
        EmpathyContactManager *manager;
        EmpathyContact         *contact;
 
-       manager = empathy_contact_manager_new ();
+       manager = empathy_contact_manager_dup_singleton ();
        contact = empathy_contact_widget_get_contact (contact_widget);
 
        if (contact && response == GTK_RESPONSE_OK) {
@@ -317,6 +320,7 @@ empathy_new_contact_dialog_show (GtkWindow *parent)
        empathy_contact_widget_set_account_filter (contact_widget,
                                                   can_add_contact_to_account,
                                                   NULL);
+       gtk_widget_show (contact_widget);
 
        new_contact_dialog = dialog;