aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorTravis Reitter <treitter@gmail.com>2010-08-13 04:05:00 +0800
committerTravis Reitter <treitter@gmail.com>2010-08-16 23:59:01 +0800
commita626735369a638e882e95b5bc4291cc9eed03465 (patch)
treebf0cb400cf69dcc7eed4866e541e1c50952de753 /libempathy-gtk
parent8cb990ba2b68d4c3eb30f3fcdc536b3f2503f80d (diff)
downloadgsoc2013-empathy-a626735369a638e882e95b5bc4291cc9eed03465.tar
gsoc2013-empathy-a626735369a638e882e95b5bc4291cc9eed03465.tar.gz
gsoc2013-empathy-a626735369a638e882e95b5bc4291cc9eed03465.tar.bz2
gsoc2013-empathy-a626735369a638e882e95b5bc4291cc9eed03465.tar.lz
gsoc2013-empathy-a626735369a638e882e95b5bc4291cc9eed03465.tar.xz
gsoc2013-empathy-a626735369a638e882e95b5bc4291cc9eed03465.tar.zst
gsoc2013-empathy-a626735369a638e882e95b5bc4291cc9eed03465.zip
Make the Share my Desktop item map to the first capable contact.
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-individual-menu.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/libempathy-gtk/empathy-individual-menu.c b/libempathy-gtk/empathy-individual-menu.c
index a2a5c3f1e..0031c8af9 100644
--- a/libempathy-gtk/empathy-individual-menu.c
+++ b/libempathy-gtk/empathy-individual-menu.c
@@ -488,17 +488,12 @@ empathy_individual_file_transfer_menu_item_new (FolksIndividual *individual)
}
static void
-individual_share_my_desktop_menu_item_activate_cb (FolksIndividual *individual)
+empathy_individual_share_my_desktop_menu_item_activated (GtkMenuItem *item,
+ EmpathyContact *contact)
{
- EmpathyContact *contact;
-
- contact = empathy_contact_dup_from_folks_individual (individual);
-
g_return_if_fail (EMPATHY_IS_CONTACT (contact));
empathy_share_my_desktop_share_with_contact (contact);
-
- g_object_unref (contact);
}
GtkWidget *
@@ -506,26 +501,17 @@ empathy_individual_share_my_desktop_menu_item_new (FolksIndividual *individual)
{
GtkWidget *item;
GtkWidget *image;
- EmpathyContact *contact;
g_return_val_if_fail (FOLKS_IS_INDIVIDUAL (individual), NULL);
- contact = empathy_contact_dup_from_folks_individual (individual);
-
- g_return_val_if_fail (EMPATHY_IS_CONTACT (contact), NULL);
-
item = gtk_image_menu_item_new_with_mnemonic (_("Share My Desktop"));
image = gtk_image_new_from_icon_name (GTK_STOCK_NETWORK, GTK_ICON_SIZE_MENU);
- gtk_widget_set_sensitive (item,
- empathy_contact_can_use_rfb_stream_tube (contact));
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
gtk_widget_show (image);
- g_signal_connect_swapped (item, "activate",
- G_CALLBACK (individual_share_my_desktop_menu_item_activate_cb),
- individual);
-
- g_object_unref (contact);
+ menu_item_set_first_contact (item, individual,
+ G_CALLBACK (empathy_individual_share_my_desktop_menu_item_activated),
+ empathy_contact_can_use_rfb_stream_tube);
return item;
}