]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-contact-dialogs.c
Remove the autogen.sh script and use gnome-autogen.sh instead.
[empathy.git] / libempathy-gtk / empathy-contact-dialogs.c
index 051876940f5fa8ca930717ba4a132e3435222a46..437e255fa80d0d01c236579216692082f6b0faae 100644 (file)
@@ -34,7 +34,7 @@
 
 #include "empathy-contact-dialogs.h"
 #include "empathy-contact-widget.h"
-#include "gossip-ui-utils.h"
+#include "empathy-ui-utils.h"
 
 static GList *subscription_dialogs = NULL;
 static GList *information_dialogs = NULL;
@@ -43,15 +43,15 @@ static GtkWidget *new_contact_dialog = NULL;
 
 static gint
 contact_dialogs_find (GtkDialog     *dialog,
-                     GossipContact *contact)
+                     EmpathyContact *contact)
 {
        GtkWidget     *contact_widget;
-       GossipContact *this_contact;
+       EmpathyContact *this_contact;
 
        contact_widget = g_object_get_data (G_OBJECT (dialog), "contact_widget");
        this_contact = empathy_contact_widget_get_contact (contact_widget);
 
-       return !gossip_contact_equal (contact, this_contact);
+       return !empathy_contact_equal (contact, this_contact);
 }
 
 /*
@@ -64,20 +64,18 @@ subscription_dialog_response_cb (GtkDialog *dialog,
                                 GtkWidget *contact_widget)
 {
        EmpathyContactManager *manager;
-       GossipContact         *contact;
+       EmpathyContact         *contact;
 
        manager = empathy_contact_manager_new ();
        contact = empathy_contact_widget_get_contact (contact_widget);
 
        if (response == GTK_RESPONSE_YES) {
-               empathy_contact_list_add (EMPATHY_CONTACT_LIST (manager),
-                                         contact,
-                                         _("I would like to add you to my contact list."));
+               empathy_contact_list_process_pending (EMPATHY_CONTACT_LIST (manager),
+                                                     contact, TRUE);
        }
        else if (response == GTK_RESPONSE_NO) {
-               empathy_contact_list_remove (EMPATHY_CONTACT_LIST (manager),
-                                            contact,
-                                            _("Sorry, I don't want you in my contact list."));
+               empathy_contact_list_process_pending (EMPATHY_CONTACT_LIST (manager),
+                                                     contact, FALSE);
        }
 
        subscription_dialogs = g_list_remove (subscription_dialogs, dialog);
@@ -86,7 +84,7 @@ subscription_dialog_response_cb (GtkDialog *dialog,
 }
 
 void
-empathy_subscription_dialog_show (GossipContact *contact,
+empathy_subscription_dialog_show (EmpathyContact *contact,
                                  GtkWindow     *parent)
 {
        GtkWidget *dialog;
@@ -94,7 +92,7 @@ empathy_subscription_dialog_show (GossipContact *contact,
        GtkWidget *contact_widget;
        GList     *l;
 
-       g_return_if_fail (GOSSIP_IS_CONTACT (contact));
+       g_return_if_fail (EMPATHY_IS_CONTACT (contact));
 
        l = g_list_find_custom (subscription_dialogs,
                                contact,
@@ -104,14 +102,15 @@ empathy_subscription_dialog_show (GossipContact *contact,
                return;
        }
 
-       gossip_glade_get_file_simple ("empathy-contact-dialogs.glade",
+       empathy_glade_get_file_simple ("empathy-contact-dialogs.glade",
                                      "subscription_request_dialog",
                                      NULL,
                                      "subscription_request_dialog", &dialog,
                                      "hbox_subscription", &hbox_subscription,
                                      NULL);
 
-       contact_widget = empathy_contact_widget_new (contact, TRUE);
+       contact_widget = empathy_contact_widget_new (contact,
+                                                    CONTACT_WIDGET_TYPE_SUBSCRIPTION);
        gtk_box_pack_end (GTK_BOX (hbox_subscription),
                          contact_widget,
                          TRUE, TRUE,
@@ -145,16 +144,17 @@ contact_information_response_cb (GtkDialog *dialog,
 }
 
 void
-empathy_contact_information_dialog_show (GossipContact *contact,
-                                        GtkWindow     *parent,
-                                        gboolean       edit)
+empathy_contact_information_dialog_show (EmpathyContact *contact,
+                                        GtkWindow      *parent,
+                                        gboolean        edit)
 {
-       GtkWidget *dialog;
-       GtkWidget *button;
-       GtkWidget *contact_widget;
-       GList     *l;
+       GtkWidget                *dialog;
+       GtkWidget                *button;
+       GtkWidget                *contact_widget;
+       GList                    *l;
+       EmpathyContactWidgetType  type;
 
-       g_return_if_fail (GOSSIP_IS_CONTACT (contact));
+       g_return_if_fail (EMPATHY_IS_CONTACT (contact));
 
        l = g_list_find_custom (information_dialogs,
                                contact,
@@ -164,10 +164,13 @@ empathy_contact_information_dialog_show (GossipContact *contact,
                return;
        }
 
+       type = edit ? CONTACT_WIDGET_TYPE_EDIT : CONTACT_WIDGET_TYPE_SHOW;
+
        /* Create dialog */
        dialog = gtk_dialog_new ();
        gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
        gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
+       gtk_window_set_title (GTK_WINDOW (dialog), _("Contact information"));
 
        /* Close button */
        button = gtk_button_new_with_label (GTK_STOCK_CLOSE);
@@ -177,8 +180,8 @@ empathy_contact_information_dialog_show (GossipContact *contact,
                                      GTK_RESPONSE_CLOSE);
        gtk_widget_show (button);
        
-       /* Contact infor widget */
-       contact_widget = empathy_contact_widget_new (contact, edit);
+       /* Contact info widget */
+       contact_widget = empathy_contact_widget_new (contact, type);
        gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
                            contact_widget,
                            TRUE, TRUE, 0);
@@ -207,7 +210,7 @@ new_contact_response_cb (GtkDialog *dialog,
                         GtkWidget *contact_widget)
 {
        EmpathyContactManager *manager;
-       GossipContact         *contact;
+       EmpathyContact         *contact;
 
        manager = empathy_contact_manager_new ();
        contact = empathy_contact_widget_get_contact (contact_widget);
@@ -239,6 +242,7 @@ empathy_new_contact_dialog_show (GtkWindow *parent)
        dialog = gtk_dialog_new ();
        gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
        gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
+       gtk_window_set_title (GTK_WINDOW (dialog), _("New contact"));
 
        /* Cancel button */
        button = gtk_button_new_with_label (GTK_STOCK_CANCEL);
@@ -256,8 +260,8 @@ empathy_new_contact_dialog_show (GtkWindow *parent)
                                      GTK_RESPONSE_OK);
        gtk_widget_show (button);
 
-       /* Contact infor widget */
-       contact_widget = empathy_contact_widget_new (NULL, TRUE);
+       /* Contact info widget */
+       contact_widget = empathy_contact_widget_new (NULL, CONTACT_WIDGET_TYPE_ADD);
        gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
                            contact_widget,
                            TRUE, TRUE, 0);