From 2b820fc4e2d6404ca281e279761cd5f877fdbf54 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 11 Jan 2009 13:55:04 +0000 Subject: New convenience function calls gtk_show_uri() and displays an error dialog 2009-01-11 Matthew Barnes * 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 svn path=/trunk/; revision=37037 --- addressbook/gui/widgets/eab-contact-display.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'addressbook/gui/widgets') 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 #include -#include #include #include @@ -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 -- cgit