[empathy] Also support file transfer in the Personas menu.



commit 90a91152a1d7db0c8f33eaf73ca766051efd7422
Author: Travis Reitter <treitter gmail com>
Date:   Thu Aug 12 15:54:21 2010 -0700

    Also support file transfer in the Personas menu.

 libempathy-gtk/empathy-individual-menu.c |   24 ++++++++++++++++++------
 libempathy-gtk/empathy-individual-menu.h |    3 ++-
 2 files changed, 20 insertions(+), 7 deletions(-)
---
diff --git a/libempathy-gtk/empathy-individual-menu.c b/libempathy-gtk/empathy-individual-menu.c
index 976c15c..994bdf1 100644
--- a/libempathy-gtk/empathy-individual-menu.c
+++ b/libempathy-gtk/empathy-individual-menu.c
@@ -230,7 +230,7 @@ empathy_individual_menu_new (FolksIndividual *individual,
   gtk_widget_show (item);
 
   /* File transfer */
-  item = empathy_individual_file_transfer_menu_item_new (individual);
+  item = empathy_individual_file_transfer_menu_item_new (individual, NULL);
   gtk_menu_shell_append (shell, item);
   gtk_widget_show (item);
 
@@ -624,12 +624,15 @@ empathy_individual_file_transfer_menu_item_activated (GtkMenuItem *item,
 }
 
 GtkWidget *
-empathy_individual_file_transfer_menu_item_new (FolksIndividual *individual)
+empathy_individual_file_transfer_menu_item_new (FolksIndividual *individual,
+    EmpathyContact *contact)
 {
   GtkWidget *item;
   GtkWidget *image;
 
-  g_return_val_if_fail (FOLKS_IS_INDIVIDUAL (individual), NULL);
+  g_return_val_if_fail (FOLKS_IS_INDIVIDUAL (individual) ||
+      EMPATHY_IS_CONTACT (contact),
+      NULL);
 
   item = gtk_image_menu_item_new_with_mnemonic (_("Send File"));
   image = gtk_image_new_from_icon_name (EMPATHY_IMAGE_DOCUMENT_SEND,
@@ -637,9 +640,18 @@ empathy_individual_file_transfer_menu_item_new (FolksIndividual *individual)
   gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
   gtk_widget_show (image);
 
-  menu_item_set_first_contact (item, individual,
-      G_CALLBACK (empathy_individual_file_transfer_menu_item_activated),
-      empathy_contact_can_send_files);
+  if (contact != NULL)
+    {
+      menu_item_set_contact (item, contact,
+          G_CALLBACK (empathy_individual_file_transfer_menu_item_activated),
+          empathy_contact_can_send_files);
+    }
+  else
+    {
+      menu_item_set_first_contact (item, individual,
+          G_CALLBACK (empathy_individual_file_transfer_menu_item_activated),
+          empathy_contact_can_send_files);
+    }
 
   return item;
 }
diff --git a/libempathy-gtk/empathy-individual-menu.h b/libempathy-gtk/empathy-individual-menu.h
index 8c89ab7..de7b021 100644
--- a/libempathy-gtk/empathy-individual-menu.h
+++ b/libempathy-gtk/empathy-individual-menu.h
@@ -57,7 +57,8 @@ GtkWidget * empathy_individual_link_menu_item_new (FolksIndividual *individual);
 GtkWidget * empathy_individual_invite_menu_item_new (
     FolksIndividual *individual);
 GtkWidget * empathy_individual_file_transfer_menu_item_new (
-    FolksIndividual *individual);
+    FolksIndividual *individual,
+    EmpathyContact *contact);
 GtkWidget * empathy_individual_share_my_desktop_menu_item_new (
     FolksIndividual *individual,
     EmpathyContact *contact);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]