aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-12-16 03:32:38 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-12-17 18:38:50 +0800
commit5631f4f5e4a4d446d5e4d81acd94b69567f9dcfa (patch)
treed4b6b9e573a3fced6ddb38e74c2a12897ce682e4 /libempathy-gtk
parent43e69eaeb5ea47d0e4a8a75a95ed537696a2639b (diff)
downloadgsoc2013-empathy-5631f4f5e4a4d446d5e4d81acd94b69567f9dcfa.tar
gsoc2013-empathy-5631f4f5e4a4d446d5e4d81acd94b69567f9dcfa.tar.gz
gsoc2013-empathy-5631f4f5e4a4d446d5e4d81acd94b69567f9dcfa.tar.bz2
gsoc2013-empathy-5631f4f5e4a4d446d5e4d81acd94b69567f9dcfa.tar.lz
gsoc2013-empathy-5631f4f5e4a4d446d5e4d81acd94b69567f9dcfa.tar.xz
gsoc2013-empathy-5631f4f5e4a4d446d5e4d81acd94b69567f9dcfa.tar.zst
gsoc2013-empathy-5631f4f5e4a4d446d5e4d81acd94b69567f9dcfa.zip
new-call-dialog: add 'Send Video' check button
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-new-call-dialog.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/libempathy-gtk/empathy-new-call-dialog.c b/libempathy-gtk/empathy-new-call-dialog.c
index 135fda95d..2118c6710 100644
--- a/libempathy-gtk/empathy-new-call-dialog.c
+++ b/libempathy-gtk/empathy-new-call-dialog.c
@@ -46,6 +46,16 @@ static EmpathyNewCallDialog *dialog_singleton = NULL;
G_DEFINE_TYPE(EmpathyNewCallDialog, empathy_new_call_dialog,
EMPATHY_TYPE_CONTACT_SELECTOR_DIALOG)
+typedef struct _EmpathyNewCallDialogPriv EmpathyNewCallDialogPriv;
+
+struct _EmpathyNewCallDialogPriv {
+ GtkWidget *check_video;
+};
+
+#define GET_PRIV(o) \
+ (G_TYPE_INSTANCE_GET_PRIVATE ((o), EMPATHY_TYPE_NEW_CALL_DIALOG, \
+ EmpathyNewCallDialogPriv))
+
/**
* SECTION:empathy-new-call-dialog
* @title: EmpathyNewCallDialog
@@ -64,6 +74,7 @@ got_contact_cb (EmpathyTpContactFactory *factory,
GObject *object)
{
EmpathyCallFactory *call_factory;
+ gboolean video = GPOINTER_TO_UINT (user_data);
if (error != NULL)
{
@@ -72,7 +83,8 @@ got_contact_cb (EmpathyTpContactFactory *factory,
}
call_factory = empathy_call_factory_get ();
- empathy_call_factory_new_call (call_factory, contact);
+ empathy_call_factory_new_call_with_streams (call_factory, contact, TRUE,
+ video);
}
static void
@@ -80,11 +92,17 @@ empathy_new_call_dialog_got_response (EmpathyContactSelectorDialog *dialog,
TpConnection *connection,
const gchar *contact_id)
{
+ EmpathyNewCallDialogPriv *priv = GET_PRIV (dialog);
EmpathyTpContactFactory *factory;
+ gboolean video;
+
+ /* check if video is enabled now because the dialog will be destroyed once
+ * we return from this function. */
+ video = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->check_video));
factory = empathy_tp_contact_factory_dup_singleton (connection);
empathy_tp_contact_factory_get_from_id (factory, contact_id,
- got_contact_cb, NULL, NULL, NULL);
+ got_contact_cb, GUINT_TO_POINTER (video), NULL, NULL);
g_object_unref (factory);
}
@@ -119,8 +137,17 @@ empathy_new_call_dialog_init (EmpathyNewCallDialog *dialog)
{
EmpathyContactSelectorDialog *parent = EMPATHY_CONTACT_SELECTOR_DIALOG (
dialog);
+ EmpathyNewCallDialogPriv *priv = GET_PRIV (dialog);
GtkWidget *image;
+ /* add video toggle */
+ priv->check_video = gtk_check_button_new_with_mnemonic (_("Send _Video"));
+
+ gtk_table_attach_defaults (GTK_TABLE (parent->table_contact),
+ priv->check_video, 1, 2, 2, 3);
+
+ gtk_widget_show (priv->check_video);
+
/* add chat button */
parent->button_action = gtk_button_new_with_mnemonic (_("_Call"));
image = gtk_image_new_from_icon_name (EMPATHY_IMAGE_VOIP,
@@ -146,6 +173,8 @@ empathy_new_call_dialog_class_init (
EmpathyContactSelectorDialogClass *dialog_class = \
EMPATHY_CONTACT_SELECTOR_DIALOG_CLASS (class);
+ g_type_class_add_private (class, sizeof (EmpathyNewCallDialogPriv));
+
object_class->constructor = empathy_new_call_dialog_constructor;
dialog_class->got_response = empathy_new_call_dialog_got_response;