[empathy] Bind 'Video call' menu items to available cameras



commit 622469eebd6cee91e1c0a27c3532ecb836fa14fb
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date:   Thu May 12 15:19:39 2011 +0100

    Bind 'Video call' menu items to available cameras

 libempathy-gtk/empathy-individual-menu.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-individual-menu.c b/libempathy-gtk/empathy-individual-menu.c
index a92e5bc..4ae727c 100644
--- a/libempathy-gtk/empathy-individual-menu.c
+++ b/libempathy-gtk/empathy-individual-menu.c
@@ -31,6 +31,7 @@
 #include <folks/folks.h>
 #include <folks/folks-telepathy.h>
 
+#include <libempathy/empathy-camera-monitor.h>
 #include <libempathy/empathy-request-util.h>
 #include <libempathy/empathy-individual-manager.h>
 #include <libempathy/empathy-chatroom-manager.h>
@@ -674,6 +675,7 @@ empathy_individual_video_call_menu_item_new (FolksIndividual *individual,
 {
   GtkWidget *item;
   GtkWidget *image;
+  EmpathyCameraMonitor *monitor;
 
   g_return_val_if_fail (FOLKS_IS_INDIVIDUAL (individual) ||
       EMPATHY_IS_CONTACT (contact),
@@ -698,6 +700,11 @@ empathy_individual_video_call_menu_item_new (FolksIndividual *individual,
           EMPATHY_ACTION_VIDEO_CALL);
     }
 
+  monitor = empathy_camera_monitor_dup_singleton ();
+  g_object_set_data_full (G_OBJECT (item), "monitor", monitor, g_object_unref);
+  g_object_bind_property (monitor, "available", item, "sensitive",
+      G_BINDING_SYNC_CREATE);
+
   return item;
 }
 



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