empathy r996 - in trunk: libempathy-gtk src
- From: xclaesse svn gnome org
- To: svn-commits-list gnome org
- Subject: empathy r996 - in trunk: libempathy-gtk src
- Date: Sun, 20 Apr 2008 00:01:06 +0100 (BST)
Author: xclaesse
Date: Sat Apr 19 23:01:05 2008
New Revision: 996
URL: http://svn.gnome.org/viewvc/empathy?rev=996&view=rev
Log:
Make possible to show "ghelp:" URIs and display a dialog in case of error in empathy_url_show. Use that to show empathy's doc.
Modified:
trunk/libempathy-gtk/empathy-ui-utils.c
trunk/src/empathy-chat-window.c
trunk/src/empathy-main-window.c
Modified: trunk/libempathy-gtk/empathy-ui-utils.c
==============================================================================
--- trunk/libempathy-gtk/empathy-ui-utils.c (original)
+++ trunk/libempathy-gtk/empathy-ui-utils.c Sat Apr 19 23:01:05 2008
@@ -1295,7 +1295,7 @@
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 @@
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);
}
Modified: trunk/src/empathy-chat-window.c
==============================================================================
--- trunk/src/empathy-chat-window.c (original)
+++ trunk/src/empathy-chat-window.c Sat Apr 19 23:01:05 2008
@@ -676,7 +676,7 @@
chat_window_help_contents_cb (GtkWidget *menuitem,
EmpathyChatWindow *window)
{
- //empathy_help_show ();
+ empathy_url_show ("ghelp:empathy?chat");
}
static void
Modified: trunk/src/empathy-main-window.c
==============================================================================
--- trunk/src/empathy-main-window.c (original)
+++ trunk/src/empathy-main-window.c Sat Apr 19 23:01:05 2008
@@ -706,7 +706,7 @@
main_window_help_contents_cb (GtkWidget *widget,
EmpathyMainWindow *window)
{
- //empathy_help_show ();
+ empathy_url_show ("ghelp:empathy");
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]