diff options
author | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-05-10 20:13:12 +0800 |
---|---|---|
committer | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-05-13 15:15:40 +0800 |
commit | dd9215e12d48621835098ebe4aaea1c99e585b36 (patch) | |
tree | c91a3a9c39714c4e022dbe3f3cbdad87070934fb /libempathy-gtk | |
parent | 9dd08df562e724e84800cd06d3d471d7cdc16322 (diff) | |
download | gsoc2013-empathy-dd9215e12d48621835098ebe4aaea1c99e585b36.tar gsoc2013-empathy-dd9215e12d48621835098ebe4aaea1c99e585b36.tar.gz gsoc2013-empathy-dd9215e12d48621835098ebe4aaea1c99e585b36.tar.bz2 gsoc2013-empathy-dd9215e12d48621835098ebe4aaea1c99e585b36.tar.lz gsoc2013-empathy-dd9215e12d48621835098ebe4aaea1c99e585b36.tar.xz gsoc2013-empathy-dd9215e12d48621835098ebe4aaea1c99e585b36.tar.zst gsoc2013-empathy-dd9215e12d48621835098ebe4aaea1c99e585b36.zip |
NewCallDialog: make 'Enable video' unsensitive when there's no camera
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-new-call-dialog.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-new-call-dialog.c b/libempathy-gtk/empathy-new-call-dialog.c index 0c609eefc..288802295 100644 --- a/libempathy-gtk/empathy-new-call-dialog.c +++ b/libempathy-gtk/empathy-new-call-dialog.c @@ -31,6 +31,7 @@ #include <telepathy-yell/telepathy-yell.h> #include <libempathy/empathy-tp-contact-factory.h> +#include <libempathy/empathy-camera-monitor.h> #include <libempathy/empathy-contact-manager.h> #include <libempathy/empathy-utils.h> @@ -58,6 +59,8 @@ typedef struct { struct _EmpathyNewCallDialogPriv { GtkWidget *check_video; + + EmpathyCameraMonitor *monitor; }; #define GET_PRIV(o) \ @@ -177,6 +180,16 @@ empathy_new_call_dialog_account_filter (EmpathyContactSelectorDialog *dialog, tp_proxy_prepare_async (connection, features, conn_prepared_cb, cb_data); } +static void +empathy_new_call_dialog_dispose (GObject *object) +{ + EmpathyNewCallDialogPriv *priv = GET_PRIV (object); + + tp_clear_object (&priv->monitor); + + G_OBJECT_CLASS (empathy_new_call_dialog_parent_class)->dispose (object); +} + static GObject * empathy_new_call_dialog_constructor (GType type, guint n_props, @@ -210,8 +223,13 @@ empathy_new_call_dialog_init (EmpathyNewCallDialog *dialog) EmpathyNewCallDialogPriv *priv = GET_PRIV (dialog); GtkWidget *image; + priv->monitor = empathy_camera_monitor_dup_singleton (); + /* add video toggle */ priv->check_video = gtk_check_button_new_with_mnemonic (_("Send _Video")); + g_object_bind_property (priv->monitor, "available", + priv->check_video, "sensitive", + G_BINDING_SYNC_CREATE); gtk_box_pack_end (GTK_BOX (parent->vbox), priv->check_video, FALSE, TRUE, 0); @@ -247,6 +265,7 @@ empathy_new_call_dialog_class_init ( g_type_class_add_private (class, sizeof (EmpathyNewCallDialogPriv)); object_class->constructor = empathy_new_call_dialog_constructor; + object_class->dispose = empathy_new_call_dialog_dispose; dialog_class->response = empathy_new_call_dialog_response; |