aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2011-03-23 00:40:33 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-06-09 17:20:07 +0800
commit6b6213702cba10ca28494e44990f750569856217 (patch)
tree084a5f2c0b55b8444db0f83fd5d10a1b3c81189e /src
parentf7a474ccd13b1dd5da8c7000b9dd7e347ec5171e (diff)
downloadgsoc2013-empathy-6b6213702cba10ca28494e44990f750569856217.tar
gsoc2013-empathy-6b6213702cba10ca28494e44990f750569856217.tar.gz
gsoc2013-empathy-6b6213702cba10ca28494e44990f750569856217.tar.bz2
gsoc2013-empathy-6b6213702cba10ca28494e44990f750569856217.tar.lz
gsoc2013-empathy-6b6213702cba10ca28494e44990f750569856217.tar.xz
gsoc2013-empathy-6b6213702cba10ca28494e44990f750569856217.tar.zst
gsoc2013-empathy-6b6213702cba10ca28494e44990f750569856217.zip
Add Answer with video to the default dialogs
We should be able to answer calls with or without video. This patch only implements that for Call type channels, but for clarity have ``Answer with video'' as the only button on SM channels for video calls to be sure it's clear to the user what to expect
Diffstat (limited to 'src')
-rw-r--r--src/empathy-event-manager.c38
1 files changed, 29 insertions, 9 deletions
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index 6d58a4ae9..5c17d7e7a 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -58,6 +58,8 @@
#define NOTIFICATION_TIMEOUT 2 /* seconds */
+#define ACCEPT_WITHOUT_VIDEO 1
+
/* The time interval in milliseconds between 2 incoming rings */
#define MS_BETWEEN_RING 500
@@ -484,14 +486,20 @@ event_manager_call_window_confirmation_dialog_response_cb (GtkDialog *dialog,
gtk_widget_destroy (approval->dialog);
approval->dialog = NULL;
- if (response != GTK_RESPONSE_ACCEPT)
+ if (response == GTK_RESPONSE_ACCEPT)
{
- reject_approval (approval);
+ event_manager_approval_approve (approval);
}
- else
+ else if (response == ACCEPT_WITHOUT_VIDEO)
{
+ tpy_call_channel_send_video (TPY_CALL_CHANNEL (approval->main_channel),
+ FALSE);
event_manager_approval_approve (approval);
}
+ else
+ {
+ reject_approval (approval);
+ }
}
static void
@@ -502,6 +510,7 @@ event_channel_process_voip_func (EventPriv *event)
GtkWidget *image;
gboolean video;
gchar *title;
+ EmpathyEventType etype = event->public.type;
if (event->approval->dialog != NULL)
{
@@ -509,13 +518,13 @@ event_channel_process_voip_func (EventPriv *event)
return;
}
- if (event->public.type == EMPATHY_EVENT_TYPE_VOIP)
+ if (etype == EMPATHY_EVENT_TYPE_VOIP)
{
EmpathyTpStreamedMedia *call;
call = EMPATHY_TP_STREAMED_MEDIA (event->approval->handler_instance);
video = empathy_tp_streamed_media_has_initial_video (call);
}
- else if (event->public.type == EMPATHY_EVENT_TYPE_CALL)
+ else if (etype == EMPATHY_EVENT_TYPE_CALL)
{
TpyCallChannel *call;
call = TPY_CALL_CHANNEL (event->approval->handler_instance);
@@ -567,15 +576,26 @@ event_channel_process_voip_func (EventPriv *event)
GTK_ICON_SIZE_BUTTON);
gtk_button_set_image (GTK_BUTTON (button), image);
+ if (video && etype == EMPATHY_EVENT_TYPE_CALL)
+ {
+ button = gtk_dialog_add_button (GTK_DIALOG (dialog),
+ _("_Answer"), ACCEPT_WITHOUT_VIDEO);
+
+ image = gtk_image_new_from_icon_name ("call-start",
+ GTK_ICON_SIZE_BUTTON);
+ gtk_button_set_image (GTK_BUTTON (button), image);
+ }
+
button = gtk_dialog_add_button (GTK_DIALOG (dialog),
- _("_Answer"), GTK_RESPONSE_ACCEPT);
+ video ? _("_Answer with video") : _("_Answer"), GTK_RESPONSE_ACCEPT);
- image = gtk_image_new_from_icon_name ("call-start", GTK_ICON_SIZE_BUTTON);
+ image = gtk_image_new_from_icon_name ("call-start",
+ GTK_ICON_SIZE_BUTTON);
gtk_button_set_image (GTK_BUTTON (button), image);
g_signal_connect (dialog, "response",
- G_CALLBACK (event_manager_call_window_confirmation_dialog_response_cb),
- event->approval);
+ G_CALLBACK (event_manager_call_window_confirmation_dialog_response_cb),
+ event->approval);
gtk_widget_show (dialog);