empathy r1741 - trunk/libempathy-gtk
- From: xclaesse svn gnome org
- To: svn-commits-list gnome org
- Subject: empathy r1741 - trunk/libempathy-gtk
- Date: Fri, 21 Nov 2008 16:14:00 +0000 (UTC)
Author: xclaesse
Date: Fri Nov 21 16:13:59 2008
New Revision: 1741
URL: http://svn.gnome.org/viewvc/empathy?rev=1741&view=rev
Log:
Added "Send file" item to contact menu widget. (Jonny Lamb)
Signed-off-by: Jonny Lamb <jonny lamb collabora co uk>
Modified:
trunk/libempathy-gtk/empathy-contact-menu.c
trunk/libempathy-gtk/empathy-contact-menu.h
Modified: trunk/libempathy-gtk/empathy-contact-menu.c
==============================================================================
--- trunk/libempathy-gtk/empathy-contact-menu.c (original)
+++ trunk/libempathy-gtk/empathy-contact-menu.c Fri Nov 21 16:13:59 2008
@@ -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 @@
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 @@
}
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);
Modified: trunk/libempathy-gtk/empathy-contact-menu.h
==============================================================================
--- trunk/libempathy-gtk/empathy-contact-menu.h (original)
+++ trunk/libempathy-gtk/empathy-contact-menu.h Fri Nov 21 16:13:59 2008
@@ -46,6 +46,7 @@
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]