diff options
author | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-02-23 02:15:07 +0800 |
---|---|---|
committer | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-06-09 17:20:05 +0800 |
commit | a5e92745d265b5623c045b6cc90164af89b25ded (patch) | |
tree | f45d46f38261c677cae32651a2da4671af6c00a1 | |
parent | 5e797f1df68283302038c9723604c87f476a0656 (diff) | |
download | gsoc2013-empathy-a5e92745d265b5623c045b6cc90164af89b25ded.tar gsoc2013-empathy-a5e92745d265b5623c045b6cc90164af89b25ded.tar.gz gsoc2013-empathy-a5e92745d265b5623c045b6cc90164af89b25ded.tar.bz2 gsoc2013-empathy-a5e92745d265b5623c045b6cc90164af89b25ded.tar.lz gsoc2013-empathy-a5e92745d265b5623c045b6cc90164af89b25ded.tar.xz gsoc2013-empathy-a5e92745d265b5623c045b6cc90164af89b25ded.tar.zst gsoc2013-empathy-a5e92745d265b5623c045b6cc90164af89b25ded.zip |
Show an error dialog if starting a call fails
-rw-r--r-- | libempathy-gtk/empathy-call-utils.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-call-utils.c b/libempathy-gtk/empathy-call-utils.c index 2a4158539..5f821dd19 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 @@ -33,6 +37,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, @@ -86,6 +106,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); } } @@ -109,7 +130,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); |