aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-01-11 21:55:04 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2009-01-11 21:55:04 +0800
commit2b820fc4e2d6404ca281e279761cd5f877fdbf54 (patch)
tree58ca39179f9e117dea79e67217e53303ea1f996b
parent577f9fdffbbb9e57b44b0290f1aea8088c6f0976 (diff)
downloadgsoc2013-evolution-2b820fc4e2d6404ca281e279761cd5f877fdbf54.tar.gz
gsoc2013-evolution-2b820fc4e2d6404ca281e279761cd5f877fdbf54.tar.zst
gsoc2013-evolution-2b820fc4e2d6404ca281e279761cd5f877fdbf54.zip
New convenience function calls gtk_show_uri() and displays an error dialog
2009-01-11 Matthew Barnes <mbarnes@redhat.com> * e-util/e-util.c (e_show_uri): New convenience function calls gtk_show_uri() and displays an error dialog if the URI cannot be shown. * addressbook/gui/widgets/eab-contact-display.c (eab_uri_popup_link_open), (on_link_clicked): * calendar/gui/e-cal-component-preview (on_link_clicked): * calendar/gui/e-cal-component-memo-preview (on_link_clicked): * calendar/gui/e-memo-table.c (open_url_cb): * calendar/gui/dialogs/comp-editor.c (open_attachment): * composer/e-msg-composer.c (msg_composer_link_clicked): * mail/em-folder-view.c (emfv_format_link_clicked): * mail/em-popup.c (emp_uri_popup_link_open): * plugins/mailing-list-actions/mailing-list-actions.c (emla_list_action_do): * shell/e-shell-window-commands.c (command_open_faq): * widgets/misc/e-attachment-bar.c (eab_icon_clicked_cb): * widgets/misc/e-url-entry.c (button_clicked_cb): Call e_show_uri() instead of gnome_url_show(). * e-util/e-error.c (ee_response): Call e_display_help() instead of gnome_url_show(). * mail/em-config.c: * mail/em-menu.c: Remove unneeded #include <libgnome/gnome-url.h> svn path=/trunk/; revision=37037
-rw-r--r--addressbook/ChangeLog6
-rw-r--r--addressbook/gui/widgets/eab-contact-display.c26
-rw-r--r--calendar/ChangeLog8
-rw-r--r--calendar/gui/dialogs/comp-editor.c9
-rw-r--r--calendar/gui/e-cal-component-memo-preview.c12
-rw-r--r--calendar/gui/e-cal-component-preview.c12
-rw-r--r--calendar/gui/e-calendar-table.c3
-rw-r--r--calendar/gui/e-memo-table.c4
-rw-r--r--composer/ChangeLog5
-rw-r--r--composer/e-msg-composer.c11
-rw-r--r--e-util/ChangeLog9
-rw-r--r--e-util/e-error.c10
-rw-r--r--e-util/e-util.c44
-rw-r--r--e-util/e-util.h2
-rw-r--r--mail/ChangeLog10
-rw-r--r--mail/em-config.c2
-rw-r--r--mail/em-folder-view.c12
-rw-r--r--mail/em-menu.c2
-rw-r--r--mail/em-popup.c10
-rw-r--r--plugins/mailing-list-actions/ChangeLog5
-rw-r--r--plugins/mailing-list-actions/mailing-list-actions.c10
-rw-r--r--shell/ChangeLog5
-rw-r--r--shell/e-shell-window-commands.c14
-rw-r--r--widgets/misc/ChangeLog6
-rw-r--r--widgets/misc/e-attachment-bar.c10
-rw-r--r--widgets/misc/e-url-entry.c8
26 files changed, 144 insertions, 111 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index f8b64c868e..2255936197 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,9 @@
+2009-01-11 Matthew Barnes <mbarnes@redhat.com>
+
+ * gui/widgets/eab-contact-display.c (eab_uri_popup_link_open),
+ (on_link_clicked):
+ Call e_show_uri() instead of gnome_url_show().
+
2009-01-10 Matthew Barnes <mbarnes@redhat.com>
* gui/contact-editor/e-contact-editor-fullname.c:
diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c
index f8a15a06fa..4e7418dc5c 100644
--- a/addressbook/gui/widgets/eab-contact-display.c
+++ b/addressbook/gui/widgets/eab-contact-display.c
@@ -28,12 +28,12 @@
#include "eab-popup.h"
#include "eab-gui-util.h"
+#include "e-util/e-util.h"
#include "e-util/e-html-utils.h"
#include "e-util/e-icon-factory.h"
#include <string.h>
#include <glib/gi18n.h>
-#include <libgnome/gnome-url.h>
#include <gtkhtml/gtkhtml.h>
#include <gtkhtml/gtkhtml-stream.h>
@@ -81,13 +81,9 @@ static void
eab_uri_popup_link_open(EPopup *ep, EPopupItem *item, void *data)
{
EABPopupTargetURI *t = (EABPopupTargetURI *)ep->target;
- GError *err = NULL;
- gnome_url_show(t->uri, &err);
- if (err) {
- g_warning("gnome_url_show: %s", err->message);
- g_error_free(err);
- }
+ /* FIXME Pass a parent window. */
+ e_show_uri (NULL, t->uri);
}
static void
@@ -258,13 +254,11 @@ on_url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle,
}
static void
-on_link_clicked (GtkHTML *html, const char *url, EABContactDisplay *display)
+on_link_clicked (GtkHTML *html, const char *uri, EABContactDisplay *display)
{
- GError *err = NULL;
-
#ifdef HANDLE_MAILTO_INTERNALLY
- if (!strncmp (url, "internal-mailto:", strlen ("internal-mailto:"))) {
- int mail_num = atoi (url + strlen ("internal-mailto:"));
+ if (!strncmp (uri, "internal-mailto:", strlen ("internal-mailto:"))) {
+ int mail_num = atoi (uri + strlen ("internal-mailto:"));
if (mail_num == -1)
return;
@@ -275,12 +269,8 @@ on_link_clicked (GtkHTML *html, const char *url, EABContactDisplay *display)
}
#endif
- gnome_url_show (url, &err);
-
- if (err) {
- g_warning ("gnome_url_show: %s", err->message);
- g_error_free (err);
- }
+ /* FIXME Pass a parent window. */
+ e_show_uri (NULL, uri);
}
#if 0
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index d1ec1d02f9..1771cc246a 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,11 @@
+2009-01-11 Matthew Barnes <mbarnes@redhat.com>
+
+ * gui/e-cal-component-preview (on_link_clicked):
+ * gui/e-cal-component-memo-preview (on_link_clicked):
+ * gui/e-memo-table.c (open_url_cb):
+ * gui/dialogs/comp-editor.c (open_attachment):
+ Call e_show_uri() instead of gnome_url_show().
+
2009-01-10 Matthew Barnes <mbarnes@redhat.com>
* gui/calendar-commands.c:
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index c7db81e8bb..c3e0e38fed 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -26,6 +26,7 @@
#include <config.h>
#endif
+#include <errno.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -34,7 +35,6 @@
#include <glib/gi18n-lib.h>
#include <glib/gstdio.h>
#include <gdk/gdkkeysyms.h>
-#include <libgnome/libgnome.h>
#include <e-util/e-util.h>
#include <e-util/e-dialog-utils.h>
#include <e-util/e-util-private.h>
@@ -1975,7 +1975,6 @@ open_attachment (EAttachmentBar *bar, CompEditor *editor)
GList *p;
int num;
char *attach_file_url;
- GError *error = NULL;
if (E_IS_ATTACHMENT_BAR (bar)) {
icon_list = GNOME_ICON_LIST (bar);
@@ -2000,11 +1999,7 @@ open_attachment (EAttachmentBar *bar, CompEditor *editor)
attach_file_url = g_build_path ("/", local_store, filename, NULL);
/* launch the url now */
- /* TODO should send GError and handle error conditions
- * here */
- gnome_url_show (attach_file_url, &error);
- if (error)
- g_message ("DEBUG: gnome_url_show(%s) failed\n", attach_file_url);
+ e_show_uri (GTK_WINDOW (editor), attach_file_url);
g_free (filename);
g_free (attach_file_url); }
diff --git a/calendar/gui/e-cal-component-memo-preview.c b/calendar/gui/e-cal-component-memo-preview.c
index 9c3ecd9a0b..3f2e68aba0 100644
--- a/calendar/gui/e-cal-component-memo-preview.c
+++ b/calendar/gui/e-cal-component-memo-preview.c
@@ -30,12 +30,12 @@
#include <string.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>
-#include <libgnome/gnome-url.h>
#include <libecal/e-cal-time-util.h>
#include <libedataserver/e-categories.h>
#include <gtkhtml/gtkhtml.h>
#include <gtkhtml/gtkhtml-stream.h>
#include <libedataserver/e-time-utils.h>
+#include <e-util/e-util.h>
#include <e-util/e-categories-config.h>
#include "calendar-config.h"
#include "e-cal-component-memo-preview.h"
@@ -54,14 +54,8 @@ G_DEFINE_TYPE (ECalComponentMemoPreview, e_cal_component_memo_preview, GTK_TYPE_
static void
on_link_clicked (GtkHTML *html, const char *url, gpointer data)
{
- GError *err = NULL;
-
- gnome_url_show (url, &err);
-
- if (err) {
- g_warning ("gnome_url_show: %s", err->message);
- g_error_free (err);
- }
+ /* FIXME Pass a parent window. */
+ e_show_uri (NULL, url);
}
static void
diff --git a/calendar/gui/e-cal-component-preview.c b/calendar/gui/e-cal-component-preview.c
index 853183bf53..dcc5504311 100644
--- a/calendar/gui/e-cal-component-preview.c
+++ b/calendar/gui/e-cal-component-preview.c
@@ -30,12 +30,12 @@
#include <gio/gio.h>
#include <gtk/gtk.h>
#include <glib/gi18n.h>
-#include <libgnome/gnome-url.h>
#include <libedataserver/e-categories.h>
#include <libecal/e-cal-time-util.h>
#include <gtkhtml/gtkhtml.h>
#include <gtkhtml/gtkhtml-stream.h>
#include <libedataserver/e-time-utils.h>
+#include <e-util/e-util.h>
#include <e-util/e-categories-config.h>
#include "calendar-config.h"
#include "e-cal-component-preview.h"
@@ -52,14 +52,8 @@ G_DEFINE_TYPE (ECalComponentPreview, e_cal_component_preview, GTK_TYPE_TABLE)
static void
on_link_clicked (GtkHTML *html, const char *url, gpointer data)
{
- GError *err = NULL;
-
- gnome_url_show (url, &err);
-
- if (err) {
- g_warning ("gnome_url_show: %s", err->message);
- g_error_free (err);
- }
+ /* FIXME Pass a parent window. */
+ e_show_uri (NULL, url);
}
static void
diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c
index 24e3675b19..450408d228 100644
--- a/calendar/gui/e-calendar-table.c
+++ b/calendar/gui/e-calendar-table.c
@@ -1554,7 +1554,8 @@ open_url_cb (EPopup *ep, EPopupItem *pitem, void *data)
if (!prop)
return;
- gnome_url_show (icalproperty_get_url (prop), NULL);
+ /* FIXME Pass a parent window. */
+ e_show_uri (NULL, icalproperty_get_url (prop));
}
/* Opens a new task editor */
diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c
index d41901b422..f7a0e52606 100644
--- a/calendar/gui/e-memo-table.c
+++ b/calendar/gui/e-memo-table.c
@@ -36,7 +36,6 @@
#include <glib/gi18n.h>
#include <glib/gstdio.h>
#include <gdk/gdkkeysyms.h>
-#include <libgnome/gnome-url.h>
#include <widgets/misc/e-gui-utils.h>
#include <table/e-cell-checkbox.h>
#include <table/e-cell-toggle.h>
@@ -907,7 +906,8 @@ open_url_cb (EPopup *ep, EPopupItem *pitem, void *data)
if (!prop)
return;
- gnome_url_show (icalproperty_get_url (prop), NULL);
+ /* FIXME Pass a parent window. */
+ e_show_uri (NULL, icalproperty_get_url (prop));
}
/* Callback for the "delete tasks" menu item */
diff --git a/composer/ChangeLog b/composer/ChangeLog
index cfafbca1bd..dab9cff1a7 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,8 @@
+2009-01-11 Matthew Barnes <mbarnes@redhat.com>
+
+ * e-msg-composer.c (msg_composer_link_clicked):
+ Call e_show_uri() instead of gnome_url_show().
+
2009-01-09 Takao Fujiwara <takao.fujiwara@sun.com>
Reviewed by Matthew Barnes <mbarnes@redhat.com>
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index b334e68e34..d13d799ab2 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -56,8 +56,6 @@
#include <gconf/gconf.h>
#include <gconf/gconf-client.h>
-#include <libgnome/gnome-url.h>
-
#include <glade/glade.h>
#include "e-util/e-dialog-utils.h"
@@ -2628,8 +2626,6 @@ static void
msg_composer_link_clicked (GtkhtmlEditor *editor,
const gchar *uri)
{
- GError *error = NULL;
-
if (uri == NULL || *uri == '\0')
return;
@@ -2642,12 +2638,7 @@ msg_composer_link_clicked (GtkhtmlEditor *editor,
if (g_ascii_strncasecmp (uri, "cid:", 4) == 0)
return;
- gnome_url_show (uri, &error);
-
- if (error) {
- g_warning ("%s", error->message);
- g_error_free (error);
- }
+ e_show_uri (GTK_WINDOW (editor), uri);
}
static void
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index a23eb07533..365589f575 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,12 @@
+2009-01-11 Matthew Barnes <mbarnes@redhat.com>
+
+ * e-error.c (ee_response):
+ Call e_display_help() instead of gnome_url_show().
+
+ * e-util.c (e_show_uri):
+ New convenience function calls gtk_show_uri() and displays an
+ error dialog if the URI cannot be shown.
+
2009-01-10 Matthew Barnes <mbarnes@redhat.com>
* e-dialog-utils.c:
diff --git a/e-util/e-error.c b/e-util/e-error.c
index 763a9ca540..da4d034606 100644
--- a/e-util/e-error.c
+++ b/e-util/e-error.c
@@ -30,10 +30,10 @@
#include <gtk/gtk.h>
#include <glib/gi18n.h>
-#include <libgnome/gnome-url.h>
#include <libedataserver/e-xml-utils.h>
+#include "e-util.h"
#include "e-util-private.h"
#include "e-error.h"
@@ -395,15 +395,9 @@ ee_build_label(GString *out, const char *fmt, GPtrArray *args,
static void
ee_response(GtkWidget *w, guint button, struct _e_error *e)
{
- GError *err = NULL;
-
if (button == GTK_RESPONSE_HELP) {
g_signal_stop_emission_by_name(w, "response");
- gnome_url_show(e->help_uri, &err);
- if (err) {
- g_warning("Unable to run help uri: %s", err->message);
- g_error_free(err);
- }
+ e_display_help (GTK_WINDOW (w), e->help_uri);
}
}
diff --git a/e-util/e-util.c b/e-util/e-util.c
index 0e43f092b2..d4bded2d6b 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -92,6 +92,50 @@ e_get_accels_filename (void)
}
/**
+ * e_show_uri:
+ * @parent: a parent #GtkWindow or %NULL
+ * @uri: the URI to show
+ *
+ * Launches the default application to show the given URI. The URI must
+ * be of a form understood by GIO. If the URI cannot be shown, it presents
+ * a dialog describing the error. The dialog is set as transient to @parent
+ * if @parent is non-%NULL.
+ **/
+void
+e_show_uri (GtkWindow *parent,
+ const gchar *uri)
+{
+ GtkWidget *dialog;
+ GdkScreen *screen = NULL;
+ GError *error = NULL;
+ guint32 timestamp;
+
+ g_return_if_fail (uri != NULL);
+
+ timestamp = gtk_get_current_event_time ();
+
+ if (parent != NULL)
+ screen = gtk_widget_get_screen (GTK_WIDGET (parent));
+
+ if (gtk_show_uri (screen, uri, timestamp, &error))
+ return;
+
+ dialog = gtk_message_dialog_new_with_markup (
+ parent, GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
+ "<big><b>%s</b></big>",
+ _("Could not open the link."));
+
+ gtk_message_dialog_format_secondary_text (
+ GTK_MESSAGE_DIALOG (dialog), "%s", error->message);
+
+ gtk_dialog_run (GTK_DIALOG (dialog));
+
+ gtk_widget_destroy (dialog);
+ g_error_free (error);
+}
+
+/**
* e_display_help:
* @parent: a parent #GtkWindow or %NULL
* @link_id: help section to present or %NULL
diff --git a/e-util/e-util.h b/e-util/e-util.h
index e2eafacd75..4f82df471b 100644
--- a/e-util/e-util.h
+++ b/e-util/e-util.h
@@ -42,6 +42,8 @@ typedef enum {
const gchar * e_get_user_data_dir (void);
const gchar * e_get_accels_filename (void);
+void e_show_uri (GtkWindow *parent,
+ const gchar *uri);
void e_display_help (GtkWindow *parent,
const gchar *link_id);
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 13eea3ba5b..915369221f 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,13 @@
+2009-01-11 Matthew Barnes <mbarnes@redhat.com>
+
+ * em-config.c:
+ * em-menu.c:
+ Remove unneeded #include <libgnome/gnome-url.h>
+
+ * em-folder-view.c (emfv_format_link_clicked):
+ * em-popup.c (emp_uri_popup_link_open):
+ Call e_show_uri() instead of gnome_url_show().
+
2009-10-10 Matthew Barnes <mbarnes@redhat.com>
* em-folder-view.c:
diff --git a/mail/em-config.c b/mail/em-config.c
index 9075fc3842..94df437519 100644
--- a/mail/em-config.c
+++ b/mail/em-config.c
@@ -29,8 +29,6 @@
#include <gtk/gtk.h>
-#include <libgnome/gnome-url.h>
-
#include "em-config.h"
#include "libedataserver/e-msgport.h"
#include "em-utils.h"
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c
index d341f4cec6..301f612193 100644
--- a/mail/em-folder-view.c
+++ b/mail/em-folder-view.c
@@ -38,8 +38,6 @@
#undef interface
#endif
-#include <libgnome/gnome-url.h>
-
#include <gconf/gconf-client.h>
#include <camel/camel-mime-message.h>
@@ -2731,14 +2729,8 @@ emfv_format_link_clicked(EMFormatHTMLDisplay *efhd, const char *uri, EMFolderVie
} else if (!g_ascii_strncasecmp (uri, "cid:", 4)) {
/* ignore */
} else {
- GError *err = NULL;
-
- gnome_url_show (uri, &err);
-
- if (err) {
- g_warning ("gnome_url_show: %s", err->message);
- g_error_free (err);
- }
+ /* FIXME Pass a parent window. */
+ e_show_uri (NULL, uri);
}
}
diff --git a/mail/em-menu.c b/mail/em-menu.c
index 9894054dc7..fc2e43d455 100644
--- a/mail/em-menu.c
+++ b/mail/em-menu.c
@@ -29,8 +29,6 @@
#include <gtk/gtk.h>
-#include <libgnome/gnome-url.h>
-
#include "em-menu.h"
#include "libedataserver/e-msgport.h"
#include "em-utils.h"
diff --git a/mail/em-popup.c b/mail/em-popup.c
index dfd09d2ad0..b6b7b23884 100644
--- a/mail/em-popup.c
+++ b/mail/em-popup.c
@@ -31,8 +31,6 @@
#include <gtk/gtk.h>
#include <glib/gi18n.h>
-#include <libgnome/gnome-url.h>
-
#include "em-popup.h"
#include "libedataserver/e-msgport.h"
#include "em-utils.h"
@@ -587,13 +585,9 @@ static void
emp_uri_popup_link_open(EPopup *ep, EPopupItem *item, void *data)
{
EMPopupTargetURI *t = (EMPopupTargetURI *)ep->target;
- GError *err = NULL;
- gnome_url_show(t->uri, &err);
- if (err) {
- g_warning("gnome_url_show: %s", err->message);
- g_error_free(err);
- }
+ /* FIXME Pass a parent window. */
+ e_show_uri (NULL, t->uri);
}
static void
diff --git a/plugins/mailing-list-actions/ChangeLog b/plugins/mailing-list-actions/ChangeLog
index f53e9e3961..4c665ed4b6 100644
--- a/plugins/mailing-list-actions/ChangeLog
+++ b/plugins/mailing-list-actions/ChangeLog
@@ -1,3 +1,8 @@
+2009-01-11 Matthew Barnes <mbarnes@redhat.com>
+
+ * mailing-list-actions.c (emla_list_action_do):
+ Call e_show_uri() instead of gnome_url_show().
+
2008-12-08 Jennifer Newman <jennifer.newman@tufts.edu>
** Fix for bug #549964
diff --git a/plugins/mailing-list-actions/mailing-list-actions.c b/plugins/mailing-list-actions/mailing-list-actions.c
index 9772fc22e4..9dd5c1c57e 100644
--- a/plugins/mailing-list-actions/mailing-list-actions.c
+++ b/plugins/mailing-list-actions/mailing-list-actions.c
@@ -29,7 +29,6 @@
#include <string.h>
#include <gtk/gtk.h>
#include <gconf/gconf-client.h>
-#include <libgnome/gnome-url.h>
#include "camel/camel-multipart.h"
#include "camel/camel-mime-part.h"
@@ -44,6 +43,7 @@
#include "mail/mail-ops.h"
#include "mail/mail-mt.h"
#include "mail/mail-config.h"
+#include "e-util/e-util.h"
#include "e-util/e-error.h"
typedef enum {
@@ -170,11 +170,9 @@ void emla_list_action_do (CamelFolder *folder, const char *uid, CamelMimeMessage
goto exit;
} else {
- GError *err = NULL;
- gnome_url_show (url, &err);
- if (!err)
- goto exit;
- g_error_free (err);
+ /* FIXME Pass a parent window. */
+ e_show_uri (NULL, url);
+ goto exit;
}
g_free (url);
url = NULL;
diff --git a/shell/ChangeLog b/shell/ChangeLog
index eed506e83f..ec2a0ca6aa 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,8 @@
+2009-01-11 Matthew Barnes <mbarnes@redhat.com>
+
+ * e-shell-window-commands.c (command_open_faq):
+ Call e_show_uri() instead of gnome_url_show().
+
2009-01-10 Matthew Barnes <mbarnes@redhat.com>
* e-shell.c:
diff --git a/shell/e-shell-window-commands.c b/shell/e-shell-window-commands.c
index 65273f8ad3..609e7c79b3 100644
--- a/shell/e-shell-window-commands.c
+++ b/shell/e-shell-window-commands.c
@@ -29,7 +29,6 @@
#include <libgnome/gnome-exec.h>
#include <glib/gi18n.h>
-#include <libgnome/gnome-url.h>
#include <gio/gio.h>
@@ -43,6 +42,7 @@
#include "e-util/e-error.h"
#include "e-util/e-icon-factory.h"
#include "e-util/e-print.h"
+#include "e-util/e-util.h"
#include "e-util/e-util-private.h"
#include "e-shell-window-commands.h"
@@ -963,15 +963,11 @@ command_open_faq (BonoboUIComponent *uih,
EShellWindow *window,
const char *path)
{
- GError *error = NULL;
+ const gchar *uri;
- gnome_url_show ("http://www.go-evolution.org/FAQ", &error);
- if (error != NULL) {
- e_notice (NULL, GTK_MESSAGE_ERROR,
- _("Error opening the FAQ webpage."));
- g_error_free (error);
- }
- }
+ uri = "http://www.go-evolution.org/FAQ";
+ e_show_uri (GTK_WINDOW (window), uri);
+}
static void
command_quick_reference (BonoboUIComponent *uih,
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index 9028c17408..e8c1a5023d 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -1,3 +1,9 @@
+2009-01-11 Matthew Barnes <mbarnes@redhat.com>
+
+ * e-attachment-bar.c (eab_icon_clicked_cb):
+ * e-url-entry.c (button_clicked_cb):
+ Call e_show_uri() instead of gnome_url_show().
+
2009-01-10 Matthew Barnes <mbarnes@redhat.com>
* test-dropdown-button.c:
diff --git a/widgets/misc/e-attachment-bar.c b/widgets/misc/e-attachment-bar.c
index bdb6852e13..2da9d3541c 100644
--- a/widgets/misc/e-attachment-bar.c
+++ b/widgets/misc/e-attachment-bar.c
@@ -993,7 +993,6 @@ static gboolean
eab_icon_clicked_cb (EAttachmentBar *bar, GdkEvent *event, gpointer *dummy)
{
EAttachment *attachment;
- GError *error = NULL;
gboolean ret = FALSE;
CamelURL *url;
char *path;
@@ -1015,13 +1014,8 @@ eab_icon_clicked_cb (EAttachmentBar *bar, GdkEvent *event, gpointer *dummy)
g_free (path);
}
- /* launch the url now */
- gnome_url_show (attachment->store_uri, &error);
- if (error) {
- g_message ("DEBUG: Launch failed: %s\n", error->message);
- g_error_free (error);
- error = NULL;
- }
+ /* FIXME Pass a parent window. */
+ e_show_uri (NULL, attachment->store_uri);
ret = TRUE;
}
diff --git a/widgets/misc/e-url-entry.c b/widgets/misc/e-url-entry.c
index 26d081fc85..32490f6590 100644
--- a/widgets/misc/e-url-entry.c
+++ b/widgets/misc/e-url-entry.c
@@ -25,9 +25,9 @@
#endif
#include <gtk/gtk.h>
-#include <libgnome/gnome-url.h>
#include <glib/gi18n.h>
#include "e-url-entry.h"
+#include "e-util/e-util.h"
struct _EUrlEntryPrivate {
GtkWidget *entry;
@@ -170,11 +170,15 @@ button_clicked_cb (GtkWidget *widget, gpointer data)
{
EUrlEntry *url_entry;
EUrlEntryPrivate *priv;
+ const gchar *uri;
url_entry = E_URL_ENTRY (data);
priv = url_entry->priv;
- gnome_url_show (gtk_entry_get_text (GTK_ENTRY (priv->entry)), NULL);
+ uri = gtk_entry_get_text (GTK_ENTRY (priv->entry));
+
+ /* FIXME Pass a parent window. */
+ e_show_uri (NULL, uri);
}
static void