diff options
author | Dan Vrátil <dvratil@redhat.com> | 2012-04-23 14:40:20 +0800 |
---|---|---|
committer | Dan Vrátil <dvratil@redhat.com> | 2012-04-23 14:40:20 +0800 |
commit | d571c56260d30a00a03112b8bdfff463d4a24b81 (patch) | |
tree | 28905f8b19ac50d999ff3ed9cb6ea7f547628a7d /addressbook | |
parent | 95746c8e3a9c341fac7beae7bc279d6379beb7e4 (diff) | |
download | gsoc2013-evolution-d571c56260d30a00a03112b8bdfff463d4a24b81.tar gsoc2013-evolution-d571c56260d30a00a03112b8bdfff463d4a24b81.tar.gz gsoc2013-evolution-d571c56260d30a00a03112b8bdfff463d4a24b81.tar.bz2 gsoc2013-evolution-d571c56260d30a00a03112b8bdfff463d4a24b81.tar.lz gsoc2013-evolution-d571c56260d30a00a03112b8bdfff463d4a24b81.tar.xz gsoc2013-evolution-d571c56260d30a00a03112b8bdfff463d4a24b81.tar.zst gsoc2013-evolution-d571c56260d30a00a03112b8bdfff463d4a24b81.zip |
Bug #674272 - Contacts preview differs with mailer running and not
This splits the giant EMailRequest to individual EFileRequest, EStockRequest, EHTTPRequest and EMailRequest,
making the first two available globally from e-utils, the othe two are loaded only with mailer,
since no other component uses them.
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/gui/widgets/eab-contact-display.c | 5 | ||||
-rw-r--r-- | addressbook/gui/widgets/eab-contact-formatter.c | 35 |
2 files changed, 7 insertions, 33 deletions
diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c index 6d83966844..151fee3483 100644 --- a/addressbook/gui/widgets/eab-contact-display.c +++ b/addressbook/gui/widgets/eab-contact-display.c @@ -33,6 +33,8 @@ #include "e-util/e-html-utils.h" #include "e-util/e-icon-factory.h" #include "e-util/e-plugin-ui.h" +#include "e-util/e-file-request.h" +#include "e-util/e-stock-request.h" #ifdef WITH_CONTACT_MAPS #include "widgets/misc/e-contact-map.h" @@ -512,6 +514,9 @@ eab_contact_display_init (EABContactDisplay *display) G_CALLBACK (contact_display_object_requested), display); #endif + e_web_view_install_request_handler (E_WEB_VIEW (display), E_TYPE_FILE_REQUEST); + e_web_view_install_request_handler (E_WEB_VIEW (display), E_TYPE_STOCK_REQUEST); + action_group = gtk_action_group_new ("internal-mailto"); gtk_action_group_set_translation_domain (action_group, domain); gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); diff --git a/addressbook/gui/widgets/eab-contact-formatter.c b/addressbook/gui/widgets/eab-contact-formatter.c index 0531087295..b87944c224 100644 --- a/addressbook/gui/widgets/eab-contact-formatter.c +++ b/addressbook/gui/widgets/eab-contact-formatter.c @@ -110,33 +110,6 @@ common_location[] = "</script>\n" \ "</head>\n" -static gchar * -get_icon_uri (const gchar *icon_name) -{ - GtkIconTheme *icon_theme; - GtkIconInfo *icon_info; - const gchar *filename; - gchar *icon_uri; - GError *error = NULL; - - icon_theme = gtk_icon_theme_get_default (); - icon_info = gtk_icon_theme_lookup_icon ( - icon_theme, icon_name, GTK_ICON_SIZE_MENU, 0); - g_return_val_if_fail (icon_info != NULL, NULL); - - filename = gtk_icon_info_get_filename (icon_info); - icon_uri = g_filename_to_uri (filename, NULL, &error); - - if (error != NULL) { - g_warning ("%s", error->message); - g_error_free (error); - } - - gtk_icon_info_free (icon_info); - - return icon_uri; -} - static void render_address_link (GString *buffer, EContact *contact, @@ -292,9 +265,7 @@ render_table_row (GString *buffer, value = (gchar *) str; if (icon) { - gchar *icon_uri = get_icon_uri (icon); - icon_html = g_strdup_printf ("<img src=\"%s\" width=\"16\" height=\"16\" />", icon_uri); - g_free (icon_uri); + icon_html = g_strdup_printf ("<img src=\"gtk-stock://%s\" width=\"16\" height=\"16\" />", icon); } else { icon_html = ""; } @@ -441,9 +412,7 @@ render_title_block (EABContactFormatter *formatter, e_contact_photo_free (photo); if (e_contact_get (contact, E_CONTACT_IS_LIST)) { - gchar *icon = get_icon_uri (CONTACT_LIST_ICON); - g_string_append_printf (buffer, "<img src=\"%s\">", icon); - g_free (icon); + g_string_append_printf (buffer, "<img src=\"gtk-stock://%s\">", CONTACT_LIST_ICON); } g_string_append_printf ( |