diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2009-05-18 21:53:01 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2009-05-18 23:17:28 +0800 |
commit | 84e2c127de4b21c0bbd53fa46ab00bf7d497969b (patch) | |
tree | abaea19455bbf5408d2f26b44c4bd41809706d38 /libempathy-gtk/empathy-contact-menu.c | |
parent | 74d04392b3aadeee49fc7012d2647f631ed69ac6 (diff) | |
download | gsoc2013-empathy-84e2c127de4b21c0bbd53fa46ab00bf7d497969b.tar gsoc2013-empathy-84e2c127de4b21c0bbd53fa46ab00bf7d497969b.tar.gz gsoc2013-empathy-84e2c127de4b21c0bbd53fa46ab00bf7d497969b.tar.bz2 gsoc2013-empathy-84e2c127de4b21c0bbd53fa46ab00bf7d497969b.tar.lz gsoc2013-empathy-84e2c127de4b21c0bbd53fa46ab00bf7d497969b.tar.xz gsoc2013-empathy-84e2c127de4b21c0bbd53fa46ab00bf7d497969b.tar.zst gsoc2013-empathy-84e2c127de4b21c0bbd53fa46ab00bf7d497969b.zip |
add 'Video Call' entry to the Contact menu
Diffstat (limited to 'libempathy-gtk/empathy-contact-menu.c')
-rw-r--r-- | libempathy-gtk/empathy-contact-menu.c | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/libempathy-gtk/empathy-contact-menu.c b/libempathy-gtk/empathy-contact-menu.c index 740e3827c..fdd9c34a1 100644 --- a/libempathy-gtk/empathy-contact-menu.c +++ b/libempathy-gtk/empathy-contact-menu.c @@ -62,11 +62,16 @@ empathy_contact_menu_new (EmpathyContact *contact, gtk_widget_show (item); } - /* Call */ if (features & EMPATHY_CONTACT_FEATURE_CALL) { + /* Audio Call */ item = empathy_contact_audio_call_menu_item_new (contact); gtk_menu_shell_append (shell, item); gtk_widget_show (item); + + /* Video Call */ + item = empathy_contact_video_call_menu_item_new (contact); + gtk_menu_shell_append (shell, item); + gtk_widget_show (item); } /* Log */ @@ -173,6 +178,38 @@ empathy_contact_audio_call_menu_item_new (EmpathyContact *contact) } static void +empathy_contact_video_call_menu_item_activated (GtkMenuItem *item, + EmpathyContact *contact) +{ + EmpathyCallFactory *factory; + + factory = empathy_call_factory_get (); + empathy_call_factory_new_call_with_streams (factory, contact, TRUE, TRUE); +} + +GtkWidget * +empathy_contact_video_call_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 (C_("menu item", "_Video Call")); + image = gtk_image_new_from_icon_name (EMPATHY_IMAGE_VIDEO_CALL, + GTK_ICON_SIZE_MENU); + gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image); + gtk_widget_set_sensitive (item, empathy_contact_can_voip (contact)); + gtk_widget_show (image); + + g_signal_connect (item, "activate", + G_CALLBACK (empathy_contact_video_call_menu_item_activated), + contact); + + return item; +} + +static void contact_log_menu_item_activate_cb (EmpathyContact *contact) { empathy_log_window_show (empathy_contact_get_account (contact), @@ -301,7 +338,6 @@ room_sub_menu_data_new (EmpathyContact *contact, data = g_slice_new (RoomSubMenuData); data->contact = g_object_ref (contact); data->chatroom = g_object_ref (chatroom); - return data; } |