diff options
author | Arnaud Maillet <arnaud.maillet@collabora.co.uk> | 2009-07-20 22:41:15 +0800 |
---|---|---|
committer | Arnaud Maillet <arnaud.maillet@collabora.co.uk> | 2009-07-20 22:41:15 +0800 |
commit | 16f43e0a4d7bd7597694bca7f9f48ef2a20da5a5 (patch) | |
tree | c5c0aadfdd0191efdc6b9daf3e462dde8fb6391a /libempathy-gtk/empathy-contact-menu.c | |
parent | 4c748f51e9ce75c711ec15ef54a473b735d32e89 (diff) | |
download | gsoc2013-empathy-16f43e0a4d7bd7597694bca7f9f48ef2a20da5a5.tar gsoc2013-empathy-16f43e0a4d7bd7597694bca7f9f48ef2a20da5a5.tar.gz gsoc2013-empathy-16f43e0a4d7bd7597694bca7f9f48ef2a20da5a5.tar.bz2 gsoc2013-empathy-16f43e0a4d7bd7597694bca7f9f48ef2a20da5a5.tar.lz gsoc2013-empathy-16f43e0a4d7bd7597694bca7f9f48ef2a20da5a5.tar.xz gsoc2013-empathy-16f43e0a4d7bd7597694bca7f9f48ef2a20da5a5.tar.zst gsoc2013-empathy-16f43e0a4d7bd7597694bca7f9f48ef2a20da5a5.zip |
Instantiate ShareMyDesktop feature in the contact menu of Empathy
Diffstat (limited to 'libempathy-gtk/empathy-contact-menu.c')
-rw-r--r-- | libempathy-gtk/empathy-contact-menu.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-contact-menu.c b/libempathy-gtk/empathy-contact-menu.c index 0de7c1ca6..070d91267 100644 --- a/libempathy-gtk/empathy-contact-menu.c +++ b/libempathy-gtk/empathy-contact-menu.c @@ -39,6 +39,7 @@ #include "empathy-log-window.h" #include "empathy-contact-dialogs.h" #include "empathy-ui-utils.h" +#include "empathy-share-my-desktop.h" GtkWidget * empathy_contact_menu_new (EmpathyContact *contact, @@ -100,6 +101,13 @@ empathy_contact_menu_new (EmpathyContact *contact, gtk_menu_shell_append (shell, item); gtk_widget_show (item); + /* Share my desktop */ + /* FIXME we should add the "Share my desktop" menu item if Vino is + a registered handler in MC5 */ + item = empathy_contact_share_my_desktop_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)) { @@ -349,6 +357,29 @@ empathy_contact_file_transfer_menu_item_new (EmpathyContact *contact) return item; } +/* FIXME we should check if the contact supports vnc stream tube */ +GtkWidget * +empathy_contact_share_my_desktop_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 (_("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_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 (empathy_share_my_desktop_share_with_contact), + contact); + + return item; +} + static void contact_info_menu_item_activate_cb (EmpathyContact *contact) { |