From 4e13ee5ecdbeb71559b76ee2080c9e58385c3ad8 Mon Sep 17 00:00:00 2001 From: Davyd Madeley Date: Tue, 24 Feb 2009 14:56:26 +0900 Subject: Hook up the callback to throw up the standard Add Contact dialog --- libempathy-gtk/empathy-contact-dialogs.c | 9 ++++++++- libempathy-gtk/empathy-contact-dialogs.h | 7 ++++++- libempathy-gtk/empathy-contact-menu.c | 17 ++++++++++++++--- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/libempathy-gtk/empathy-contact-dialogs.c b/libempathy-gtk/empathy-contact-dialogs.c index 0155f610e..5636714b0 100644 --- a/libempathy-gtk/empathy-contact-dialogs.c +++ b/libempathy-gtk/empathy-contact-dialogs.c @@ -369,6 +369,13 @@ new_contact_response_cb (GtkDialog *dialog, void empathy_new_contact_dialog_show (GtkWindow *parent) +{ + empathy_new_contact_dialog_show_with_contact (parent, NULL); +} + +void +empathy_new_contact_dialog_show_with_contact (GtkWindow *parent, + EmpathyContact *contact) { GtkWidget *dialog; GtkWidget *button; @@ -402,7 +409,7 @@ empathy_new_contact_dialog_show (GtkWindow *parent) gtk_widget_show (button); /* Contact info widget */ - contact_widget = empathy_contact_widget_new (NULL, + contact_widget = empathy_contact_widget_new (contact, EMPATHY_CONTACT_WIDGET_EDIT_ALIAS | EMPATHY_CONTACT_WIDGET_EDIT_ACCOUNT | EMPATHY_CONTACT_WIDGET_EDIT_ID | diff --git a/libempathy-gtk/empathy-contact-dialogs.h b/libempathy-gtk/empathy-contact-dialogs.h index c714c6b96..5e881ab73 100644 --- a/libempathy-gtk/empathy-contact-dialogs.h +++ b/libempathy-gtk/empathy-contact-dialogs.h @@ -35,7 +35,12 @@ void empathy_contact_information_dialog_show (EmpathyContact *contact, void empathy_contact_edit_dialog_show (EmpathyContact *contact, GtkWindow *parent); void empathy_contact_personal_dialog_show (GtkWindow *parent); -void empathy_new_contact_dialog_show (GtkWindow *parent); + GtkWindow *parent, + gboolean edit, + gboolean is_user); +void empathy_new_contact_dialog_show (GtkWindow *parent); +void empathy_new_contact_dialog_show_with_contact (GtkWindow *parent, + EmpathyContact *contact); G_END_DECLS diff --git a/libempathy-gtk/empathy-contact-menu.c b/libempathy-gtk/empathy-contact-menu.c index 9969f3def..44b00165e 100644 --- a/libempathy-gtk/empathy-contact-menu.c +++ b/libempathy-gtk/empathy-contact-menu.c @@ -126,10 +126,12 @@ empathy_contact_menu_new (EmpathyContact *contact, } static void -empathy_contact_chat_menu_item_activated (GtkMenuItem *item, +empathy_contact_add_menu_item_activated (GtkMenuItem *item, EmpathyContact *contact) { - empathy_dispatcher_chat_with_contact (contact, NULL, NULL); + /* FIXME - attempt to get parent */ + /* FIXME - the contact dialog doesn't set the source account right */ + empathy_new_contact_dialog_show_with_contact (NULL, contact); } GtkWidget * @@ -163,11 +165,20 @@ empathy_contact_add_menu_item_new (EmpathyContact *contact) GTK_ICON_SIZE_MENU); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image); - /* FIXME - callback */ + g_signal_connect (item, "activate", + G_CALLBACK (empathy_contact_add_menu_item_activated), + contact); return item; } +static void +empathy_contact_chat_menu_item_activated (GtkMenuItem *item, + EmpathyContact *contact) +{ + empathy_dispatcher_chat_with_contact (contact, NULL, NULL); +} + GtkWidget * empathy_contact_chat_menu_item_new (EmpathyContact *contact) { -- cgit v1.2.3