]> git.0d.be Git - empathy.git/commitdiff
Instantiate ShareMyDesktop feature in the contact menu of Empathy
authorArnaud Maillet <arnaud.maillet@collabora.co.uk>
Mon, 20 Jul 2009 14:41:15 +0000 (16:41 +0200)
committerArnaud Maillet <arnaud.maillet@collabora.co.uk>
Mon, 20 Jul 2009 14:41:15 +0000 (16:41 +0200)
libempathy-gtk/empathy-contact-menu.c
libempathy-gtk/empathy-contact-menu.h

index 0de7c1ca6afdd78c4ab7847db97c4aa6d7db8c23..070d91267219e79c1c19143de8b9e35c89bc342d 100644 (file)
@@ -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)
 {
index 1c40d0e28c0e05c7c34373b742e51f600f140179..2c623e6baf1f7ba5dea0ec7e3ee764cdf34e542a 100644 (file)
@@ -49,6 +49,7 @@ GtkWidget * empathy_contact_info_menu_item_new (EmpathyContact             *cont
 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);
+GtkWidget * empathy_contact_share_my_desktop_menu_item_new (EmpathyContact *contact);
 
 G_END_DECLS