diff options
author | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-05-10 20:14:45 +0800 |
---|---|---|
committer | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-07-12 17:11:14 +0800 |
commit | fe7e98c6222fae967005ca81042963118953fd43 (patch) | |
tree | aee4fd1986731f1a630c6941582ff7c11f6e0d16 /src | |
parent | 622469eebd6cee91e1c0a27c3532ecb836fa14fb (diff) | |
download | gsoc2013-empathy-fe7e98c6222fae967005ca81042963118953fd43.tar gsoc2013-empathy-fe7e98c6222fae967005ca81042963118953fd43.tar.gz gsoc2013-empathy-fe7e98c6222fae967005ca81042963118953fd43.tar.bz2 gsoc2013-empathy-fe7e98c6222fae967005ca81042963118953fd43.tar.lz gsoc2013-empathy-fe7e98c6222fae967005ca81042963118953fd43.tar.xz gsoc2013-empathy-fe7e98c6222fae967005ca81042963118953fd43.tar.zst gsoc2013-empathy-fe7e98c6222fae967005ca81042963118953fd43.zip |
CallWindow: disable Video functionality if there's no camera
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-call-window.c | 13 |
1 files changed, 12 insertions, 1 deletions
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 <gst/farsight/fs-element-added-notifier.h> #include <gst/farsight/fs-utils.h> +#include <libempathy/empathy-camera-monitor.h> #include <libempathy/empathy-tp-contact-factory.h> #include <libempathy/empathy-utils.h> #include <libempathy-gtk/empathy-avatar-image.h> @@ -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); |