aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-subscription-dialog.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-06-07 02:21:00 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-06-07 02:21:00 +0800
commit51f7f13d735f8db9ead25711641f2974c18b2737 (patch)
tree1ead7bbe3e4321ed9a48b03962a6345ef9a434ef /libempathy-gtk/empathy-subscription-dialog.c
parenta79ee78e13ce6c890925e8fab0cc70c30c80cc8a (diff)
downloadgsoc2013-empathy-51f7f13d735f8db9ead25711641f2974c18b2737.tar
gsoc2013-empathy-51f7f13d735f8db9ead25711641f2974c18b2737.tar.gz
gsoc2013-empathy-51f7f13d735f8db9ead25711641f2974c18b2737.tar.bz2
gsoc2013-empathy-51f7f13d735f8db9ead25711641f2974c18b2737.tar.lz
gsoc2013-empathy-51f7f13d735f8db9ead25711641f2974c18b2737.tar.xz
gsoc2013-empathy-51f7f13d735f8db9ead25711641f2974c18b2737.tar.zst
gsoc2013-empathy-51f7f13d735f8db9ead25711641f2974c18b2737.zip
EmpatchContactWidget has 2 modes: editable or not.
2007-06-06 Xavier Claessens <xclaesse@gmail.com> * libempathy-gtk/empathy-contact-widget.glade: * libempathy-gtk/empathy-contact-widget.c: * libempathy-gtk/empathy-contact-widget.h: * libempathy-gtk/empathy-subscription-dialog.c: EmpatchContactWidget has 2 modes: editable or not. svn path=/trunk/; revision=127
Diffstat (limited to 'libempathy-gtk/empathy-subscription-dialog.c')
-rw-r--r--libempathy-gtk/empathy-subscription-dialog.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/libempathy-gtk/empathy-subscription-dialog.c b/libempathy-gtk/empathy-subscription-dialog.c
index cd0508080..578118581 100644
--- a/libempathy-gtk/empathy-subscription-dialog.c
+++ b/libempathy-gtk/empathy-subscription-dialog.c
@@ -39,13 +39,16 @@
static GHashTable *dialogs = NULL;
static void
-subscription_dialog_response_cb (GtkDialog *dialog,
- gint response,
- GossipContact *contact)
+subscription_dialog_response_cb (GtkDialog *dialog,
+ gint response,
+ GtkWidget *contact_widget)
{
EmpathyContactManager *manager;
+ GossipContact *contact;
manager = empathy_contact_manager_new ();
+ contact = empathy_contact_widget_get_contact (contact_widget);
+ empathy_contact_widget_save (contact_widget);
if (response == GTK_RESPONSE_YES) {
empathy_contact_list_add (EMPATHY_CONTACT_LIST (manager),
@@ -68,6 +71,7 @@ empathy_subscription_dialog_show (GossipContact *contact,
{
GtkWidget *dialog;
GtkWidget *hbox_subscription;
+ GtkWidget *contact_widget;
g_return_if_fail (GOSSIP_IS_CONTACT (contact));
@@ -91,17 +95,18 @@ empathy_subscription_dialog_show (GossipContact *contact,
"hbox_subscription", &hbox_subscription,
NULL);
- g_signal_connect (dialog, "response",
- G_CALLBACK (subscription_dialog_response_cb),
- contact);
-
g_hash_table_insert (dialogs, g_object_ref (contact), dialog);
+ contact_widget = empathy_contact_widget_new (contact, TRUE);
gtk_box_pack_end (GTK_BOX (hbox_subscription),
- empathy_contact_widget_new (contact),
+ contact_widget,
TRUE, TRUE,
0);
+ g_signal_connect (dialog, "response",
+ G_CALLBACK (subscription_dialog_response_cb),
+ contact_widget);
+
if (parent) {
gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
}