From fe7e98c6222fae967005ca81042963118953fd43 Mon Sep 17 00:00:00 2001 From: Emilio Pozuelo Monfort Date: Tue, 10 May 2011 13:14:45 +0100 Subject: CallWindow: disable Video functionality if there's no camera --- src/empathy-call-window.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/empathy-call-window.c') diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c index 8fd10dea0..85a2f4c51 100644 --- a/src/empathy-call-window.c +++ b/src/empathy-call-window.c @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -107,6 +108,8 @@ struct _EmpathyCallWindowPriv EmpathyContact *contact; + EmpathyCameraMonitor *camera_monitor; + guint call_state; gboolean outgoing; @@ -1057,6 +1060,12 @@ empathy_call_window_init (EmpathyCallWindow *self) gtk_action_set_sensitive (priv->menu_fullscreen, FALSE); + priv->camera_monitor = empathy_camera_monitor_dup_singleton (); + + g_object_bind_property (priv->camera_monitor, "available", + priv->camera_button, "sensitive", + G_BINDING_SYNC_CREATE); + priv->lock = g_mutex_new (); gtk_container_add (GTK_CONTAINER (self), top_vbox); @@ -1644,6 +1653,7 @@ empathy_call_window_dispose (GObject *object) tp_clear_object (&priv->video_tee); tp_clear_object (&priv->ui_manager); tp_clear_object (&priv->fullscreen); + tp_clear_object (&priv->camera_monitor); g_list_free_full (priv->notifiers, g_object_unref); @@ -2315,7 +2325,8 @@ empathy_call_window_state_changed_cb (EmpathyCallHandler *handler, empathy_sound_manager_stop (priv->sound_mgr, EMPATHY_SOUND_PHONE_OUTGOING); can_send_video = priv->video_input != NULL && - empathy_contact_can_voip_video (priv->contact); + empathy_contact_can_voip_video (priv->contact) && + empathy_camera_monitor_get_available (priv->camera_monitor); g_object_get (priv->handler, "call-channel", &call, NULL); -- cgit v1.2.3