diff options
-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; |