diff options
author | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-02-28 20:29:40 +0800 |
---|---|---|
committer | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-06-09 17:20:05 +0800 |
commit | a826ef6e4581c57834e1286b48afdc87ec8244c2 (patch) | |
tree | 40bb812f62784d3a957a5e071162e6f32c8f925c | |
parent | 1cacc0945f81e0513013b83ca7488589dd6c61f7 (diff) | |
download | gsoc2013-empathy-a826ef6e4581c57834e1286b48afdc87ec8244c2.tar gsoc2013-empathy-a826ef6e4581c57834e1286b48afdc87ec8244c2.tar.gz gsoc2013-empathy-a826ef6e4581c57834e1286b48afdc87ec8244c2.tar.bz2 gsoc2013-empathy-a826ef6e4581c57834e1286b48afdc87ec8244c2.tar.lz gsoc2013-empathy-a826ef6e4581c57834e1286b48afdc87ec8244c2.tar.xz gsoc2013-empathy-a826ef6e4581c57834e1286b48afdc87ec8244c2.tar.zst gsoc2013-empathy-a826ef6e4581c57834e1286b48afdc87ec8244c2.zip |
Return meaningful errors when starting a call fails
-rw-r--r-- | libempathy-gtk/empathy-call-utils.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-call-utils.c b/libempathy-gtk/empathy-call-utils.c index 677d28fa5..2c7d6d18b 100644 --- a/libempathy-gtk/empathy-call-utils.c +++ b/libempathy-gtk/empathy-call-utils.c @@ -35,6 +35,27 @@ #define DEBUG_FLAG EMPATHY_DEBUG_OTHER #include <libempathy/empathy-debug.h> +static const gchar * +get_error_display_message (GError *error) +{ + if (error->domain != TP_ERROR) + return _("There was an error starting the call"); + + switch (error->code) + { + case TP_ERROR_NETWORK_ERROR: + return _("Network error"); + case TP_ERROR_NOT_CAPABLE: + return _("The specified contact doesn't support calls"); + case TP_ERROR_OFFLINE: + return _("The specified contact is offline"); + case TP_ERROR_INVALID_HANDLE: + return _("The specified contact is not valid"); + } + + return _("There was an error starting the call"); +} + static void show_call_error (GError *error) { @@ -42,7 +63,7 @@ show_call_error (GError *error) dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, - _("There was an error starting the call")); + get_error_display_message (error)); g_signal_connect_swapped (dialog, "response", G_CALLBACK (gtk_widget_destroy), |