aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-call-utils.c
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-02-23 02:15:07 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2011-02-24 01:12:57 +0800
commit2c751f8089462c379401b930242b0ee244eeaf14 (patch)
tree388b9c05d2a6d6fd6671cd6f2e5b516b002a661b /libempathy-gtk/empathy-call-utils.c
parent43351bae1eb2f338922577ffa6dcc7321e35a37b (diff)
downloadgsoc2013-empathy-2c751f8089462c379401b930242b0ee244eeaf14.tar
gsoc2013-empathy-2c751f8089462c379401b930242b0ee244eeaf14.tar.gz
gsoc2013-empathy-2c751f8089462c379401b930242b0ee244eeaf14.tar.bz2
gsoc2013-empathy-2c751f8089462c379401b930242b0ee244eeaf14.tar.lz
gsoc2013-empathy-2c751f8089462c379401b930242b0ee244eeaf14.tar.xz
gsoc2013-empathy-2c751f8089462c379401b930242b0ee244eeaf14.tar.zst
gsoc2013-empathy-2c751f8089462c379401b930242b0ee244eeaf14.zip
Show an error dialog if starting a call fails
Diffstat (limited to 'libempathy-gtk/empathy-call-utils.c')
-rw-r--r--libempathy-gtk/empathy-call-utils.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-call-utils.c b/libempathy-gtk/empathy-call-utils.c
index d9c35e2cf..3883dad16 100644
--- a/libempathy-gtk/empathy-call-utils.c
+++ b/libempathy-gtk/empathy-call-utils.c
@@ -20,6 +20,10 @@
#include "config.h"
+#include <glib/gi18n.h>
+
+#include <gtk/gtk.h>
+
#include <telepathy-glib/telepathy-glib.h>
#if HAVE_CALL
@@ -31,6 +35,22 @@
#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
#include <libempathy/empathy-debug.h>
+static void
+show_call_error (GError *error)
+{
+ GtkWidget *dialog;
+
+ dialog = gtk_message_dialog_new (NULL, 0,
+ GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
+ _("There was an error starting the call"));
+
+ g_signal_connect_swapped (dialog, "response",
+ G_CALLBACK (gtk_widget_destroy),
+ dialog);
+
+ gtk_widget_show (dialog);
+}
+
#if HAVE_CALL
GHashTable *
empathy_call_create_call_request (const gchar *contact,
@@ -84,6 +104,7 @@ create_streamed_media_channel_cb (GObject *source,
&error))
{
DEBUG ("Failed to create StreamedMedia channel: %s", error->message);
+ show_call_error (error);
g_error_free (error);
}
}
@@ -107,7 +128,10 @@ create_call_channel_cb (GObject *source,
DEBUG ("Failed to create Call channel: %s", error->message);
if (error->code != TP_ERROR_NOT_IMPLEMENTED)
- return;
+ {
+ show_call_error (error);
+ return;
+ }
DEBUG ("Let's try with an StreamedMedia channel");
g_error_free (error);