diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2008-11-22 00:13:59 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-11-22 00:13:59 +0800 |
commit | 56f3b6e362203b337042146a20523b74f45add62 (patch) | |
tree | c76d8178534ce210007247d1c738fb7680d5bd0c /libempathy-gtk | |
parent | 9bbd1b9e2bc66b12a318517c18b89b1f7a7f17f5 (diff) | |
download | gsoc2013-empathy-56f3b6e362203b337042146a20523b74f45add62.tar gsoc2013-empathy-56f3b6e362203b337042146a20523b74f45add62.tar.gz gsoc2013-empathy-56f3b6e362203b337042146a20523b74f45add62.tar.bz2 gsoc2013-empathy-56f3b6e362203b337042146a20523b74f45add62.tar.lz gsoc2013-empathy-56f3b6e362203b337042146a20523b74f45add62.tar.xz gsoc2013-empathy-56f3b6e362203b337042146a20523b74f45add62.tar.zst gsoc2013-empathy-56f3b6e362203b337042146a20523b74f45add62.zip |
Added "Send file" item to contact menu widget. (Jonny Lamb)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
svn path=/trunk/; revision=1741
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-contact-menu.c | 33 | ||||
-rw-r--r-- | libempathy-gtk/empathy-contact-menu.h | 1 |
2 files changed, 34 insertions, 0 deletions
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)) { @@ -187,6 +193,33 @@ empathy_contact_log_menu_item_new (EmpathyContact *contact) } 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) { empathy_contact_information_dialog_show (contact, NULL, FALSE, FALSE); diff --git a/libempathy-gtk/empathy-contact-menu.h b/libempathy-gtk/empathy-contact-menu.h index 16324979c..fddc40c49 100644 --- a/libempathy-gtk/empathy-contact-menu.h +++ b/libempathy-gtk/empathy-contact-menu.h @@ -46,6 +46,7 @@ GtkWidget * empathy_contact_log_menu_item_new (EmpathyContact *cont GtkWidget * empathy_contact_info_menu_item_new (EmpathyContact *contact); GtkWidget * empathy_contact_edit_menu_item_new (EmpathyContact *contact); GtkWidget * empathy_contact_invite_menu_item_new (EmpathyContact *contact); +GtkWidget * empathy_contact_file_transfer_menu_item_new (EmpathyContact *contact); G_END_DECLS |