From 56f3b6e362203b337042146a20523b74f45add62 Mon Sep 17 00:00:00 2001 From: Jonny Lamb Date: Fri, 21 Nov 2008 16:13:59 +0000 Subject: Added "Send file" item to contact menu widget. (Jonny Lamb) Signed-off-by: Jonny Lamb svn path=/trunk/; revision=1741 --- libempathy-gtk/empathy-contact-menu.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'libempathy-gtk/empathy-contact-menu.c') diff --git a/libempathy-gtk/empathy-contact-menu.c b/libempathy-gtk/empathy-contact-menu.c index 609b5ba16..9609b627d 100644 --- a/libempathy-gtk/empathy-contact-menu.c +++ b/libempathy-gtk/empathy-contact-menu.c @@ -35,6 +35,7 @@ #include "empathy-images.h" #include "empathy-log-window.h" #include "empathy-contact-dialogs.h" +#include "empathy-ui-utils.h" GtkWidget * empathy_contact_menu_new (EmpathyContact *contact, @@ -79,6 +80,11 @@ empathy_contact_menu_new (EmpathyContact *contact, gtk_menu_shell_append (shell, item); gtk_widget_show (item); + /* File transfer */ + item = empathy_contact_file_transfer_menu_item_new (contact); + gtk_menu_shell_append (shell, item); + gtk_widget_show (item); + /* Separator */ if (features & (EMPATHY_CONTACT_FEATURE_EDIT | EMPATHY_CONTACT_FEATURE_INFO)) { @@ -186,6 +192,33 @@ empathy_contact_log_menu_item_new (EmpathyContact *contact) return item; } +static void +contact_file_transfer_menu_item_activate_cb (EmpathyContact *contact) +{ + empathy_send_file_with_file_chooser (contact, NULL, NULL); +} + +GtkWidget * +empathy_contact_file_transfer_menu_item_new (EmpathyContact *contact) +{ + GtkWidget *item; + GtkWidget *image; + + g_return_val_if_fail (EMPATHY_IS_CONTACT (contact), NULL); + + item = gtk_image_menu_item_new_with_mnemonic (_("Send file")); + image = gtk_image_new_from_icon_name (EMPATHY_IMAGE_LOG, + GTK_ICON_SIZE_MENU); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image); + gtk_widget_show (image); + + g_signal_connect_swapped (item, "activate", + G_CALLBACK (contact_file_transfer_menu_item_activate_cb), + contact); + + return item; +} + static void contact_info_menu_item_activate_cb (EmpathyContact *contact) { -- cgit v1.2.3