aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libempathy-gtk/empathy-ui-utils.c29
-rw-r--r--src/empathy-chat-window.c2
-rw-r--r--src/empathy-main-window.c2
3 files changed, 22 insertions, 11 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index 6aa800bb0..e1a0188dd 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -1295,7 +1295,7 @@ empathy_get_toplevel_window (GtkWidget *widget)
static gchar *
fixup_url (const gchar *url)
{
- if (!g_str_has_prefix (url, "http://") &&
+ if (!g_str_has_prefix (url, "ghelp:") &&
!strstr (url, ":/") &&
!strstr (url, "@")) {
return g_strdup_printf ("http://%s", url);
@@ -1307,21 +1307,32 @@ fixup_url (const gchar *url)
void
empathy_url_show (const char *url)
{
- gchar *real_url;
- gboolean res;
- GError *error = NULL;
+ gchar *real_url;
+ GError *error = NULL;
real_url = fixup_url (url);
if (real_url) {
url = real_url;
}
+
/* FIXME: this does not work for multihead, we should use
- * GdkAppLaunchContext for that, when we can depend on GTK+ trunk
+ * GdkAppLaunchContext or gtk_show_url, see bug #514396.
*/
- res = g_app_info_launch_default_for_uri (url, NULL, &error);
- if (!res) {
- empathy_debug (DEBUG_DOMAIN, "Couldn't show URL %s: %s",
- url, error->message);
+ g_app_info_launch_default_for_uri (url, NULL, &error);
+ if (error) {
+ GtkWidget *dialog;
+
+ dialog = gtk_message_dialog_new (NULL, 0,
+ GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
+ _("Unable to open uri"));
+ gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+ error->message);
+
+ g_signal_connect (dialog, "response",
+ G_CALLBACK (gtk_widget_destroy),
+ NULL);
+ gtk_window_present (GTK_WINDOW (dialog));
+
g_clear_error (&error);
}
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index dc7f2f102..09a0e4589 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -676,7 +676,7 @@ static void
chat_window_help_contents_cb (GtkWidget *menuitem,
EmpathyChatWindow *window)
{
- //empathy_help_show ();
+ empathy_url_show ("ghelp:empathy?chat");
}
static void
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index 065c6fcc8..7b616f4ab 100644
--- a/src/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -706,7 +706,7 @@ static void
main_window_help_contents_cb (GtkWidget *widget,
EmpathyMainWindow *window)
{
- //empathy_help_show ();
+ empathy_url_show ("ghelp:empathy");
}
static gboolean