From 434bc25ed6b3f458f3bf119e76bd8b2bcffe5178 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 11 Aug 2008 17:04:32 +0000 Subject: ** Fixes bug #546892 2008-08-11 Matthew Barnes ** Fixes bug #546892 * e-util/e-icon-factory.c (e_icon_factory_get_image): Kill this function. Use gtk_image_new_from_icon_name(). * e-util/e-icon-factory.c (e_icon_factory_get_icon_list): Kill this function. Use gtk_window_set_icon_name(). * widgets/misc/e-activity-handler.c: * widgets/misc/e-task-widget.c: Purge the GdkPixbuf arguments from the API. We've been ignoring them since the spinner icon was added. * addressbook/gui/contact-editor/e-contact-editor-fullname.c: * addressbook/gui/contact-editor/e-contact-editor-im.c: * addressbook/gui/contact-editor/e-contact-editor-address.c: * calendar/gui/alarm-notify/alarm-notify-dialog.c: * calendar/gui/dialogs/alarm-dialog.c: * calendar/gui/dialogs/alarm-list-dialog.c: * calendar/gui/dialogs/cal-attachment-select-file.c: * calendar/gui/dialogs/changed-comp.c: * calendar/gui/dialogs/delete-error.c: * calendar/gui/dialogs/select-source-dialog.c: * mail/mail-send-recv.c: * mail/message-tag-followup.c: * widgets/misc/e-combo-button.c: * widgets/misc/e-info-label.c: * widgets/misc/e-url-entry.c: * widgets/misc/e-task-widget.c: Prefer gtk_window_set_icon_name() over gtk_window_set_icon_list(). * addressbook/gui/contact-editor/e-contact-editor-im.c: * calendar/gui/dialogs/event-page.c: * calendar/gui/e-timezone-entry.c: * e-util/e-gui-utils.c: * e-util/e-popup.c: * plugins/import-ics-attachments/icsimporter.c: * plugins/itip-formatter/itip-view.c: * mail/em-folder-browser.c: * mail/em-format-html-display.c: * mail/mail-send-recv.c: * mail/message-tag-followup.c: Prefer gtk_image_new_from_icon_name() over e_icon_factory_get_image(). * calendar/gui/alarm-notify/alarm-queue.c: * plugins/mail-notification/mail-notification.c: Prefer gtk_status_icon_set_from_icon_name() over gtk_status_icon_set_from_pixbuf(). * addressbook/gui/component/addressbook-view.c: * calendar/gui/e-calendar-table.c: * calendar/gui/e-calendar-view.c: * calendar/gui/e-memo-table.c: * mail/mail-mt.c: e_activity_handler_operation_started() no longer takes a GdkPixbuf. It was ignoring the pixbuf anyway ever since we added a spinner icon. svn path=/trunk/; revision=35958 --- e-util/ChangeLog | 14 +++++++++++++ e-util/e-config.c | 2 -- e-util/e-event.c | 2 -- e-util/e-gui-utils.c | 4 ++-- e-util/e-icon-factory.c | 56 ------------------------------------------------- e-util/e-icon-factory.h | 4 ---- e-util/e-import.c | 2 -- e-util/e-popup.c | 10 ++------- 8 files changed, 18 insertions(+), 76 deletions(-) (limited to 'e-util') diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 785383c11b..bd5c7e3e76 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,17 @@ +2008-08-11 Matthew Barnes + + ** Fixes part of bug #546892 + + * e-gui-utils.c: + * e-popup.c: + Prefer gtk_image_new_from_icon_name() over e_icon_factory_get_image(). + + * e-icon-factory.c (e_icon_factory_get_image): + Kill this function. Use gtk_image_new_from_icon_name(). + + * e-icon-factory.c (e_icon_factory_get_icon_list): + Kill this function. Use gtk_window_set_icon_name(). + 2008-07-31 Matthew Barnes ** Fixes part of bug #545568 diff --git a/e-util/e-config.c b/e-util/e-config.c index 939ade0380..b10a11fd20 100644 --- a/e-util/e-config.c +++ b/e-util/e-config.c @@ -35,8 +35,6 @@ #include "e-config.h" -#include - #include #define d(x) diff --git a/e-util/e-event.c b/e-util/e-event.c index e105bc1aa7..f8d634feec 100644 --- a/e-util/e-event.c +++ b/e-util/e-event.c @@ -31,8 +31,6 @@ #include "e-event.h" -#include - #include #include diff --git a/e-util/e-gui-utils.c b/e-util/e-gui-utils.c index c354597153..c4fef1ba16 100644 --- a/e-util/e-gui-utils.c +++ b/e-util/e-gui-utils.c @@ -18,7 +18,6 @@ #include #include "e-gui-utils.h" -#include #include #include @@ -62,7 +61,8 @@ GtkWidget *e_create_image_widget(gchar *name, GtkWidget *w; if (string1) { - w = e_icon_factory_get_image (string1, E_ICON_SIZE_DIALOG); + w = gtk_image_new_from_icon_name ( + string1, GTK_ICON_SIZE_DIALOG); gtk_misc_set_alignment (GTK_MISC (w), 0.5, 0.5); diff --git a/e-util/e-icon-factory.c b/e-util/e-icon-factory.c index 457735f90b..2ca724c5f2 100644 --- a/e-util/e-icon-factory.c +++ b/e-util/e-icon-factory.c @@ -353,62 +353,6 @@ e_icon_factory_get_icon (const char *icon_name, int icon_size) return pixbuf; } -GtkWidget * -e_icon_factory_get_image (const char *icon_name, int icon_size) -{ - GdkPixbuf *pixbuf; - GtkWidget *image; - - pixbuf = e_icon_factory_get_icon (icon_name, icon_size); - image = gtk_image_new_from_pixbuf (pixbuf); - g_object_unref (pixbuf); - - return image; -} - -/** - * e_icon_factory_get_icon_list: - * @icon_name: name of the icon - * - * Returns a list of GdkPixbufs of the requested name suitable for - * gtk_window_set_icon_list(). - **/ -GList * -e_icon_factory_get_icon_list (const char *icon_name) -{ - static int icon_list_sizes[] = { 128, 64, 48, 32, 16 }; - GList *list = NULL; - char *icon_key; - Icon *icon; - int size, i; - - if (!icon_name || !strcmp (icon_name, "")) - return NULL; - - g_static_mutex_lock (&mutex); - - icon_key = g_alloca (strlen (icon_name) + 9); - - for (i = 0; i < G_N_ELEMENTS (icon_list_sizes); i++) { - size = icon_list_sizes[i]; - sprintf (icon_key, "%dx%d/%s", size, size, icon_name); - - if (!(icon = g_hash_table_lookup (name_to_icon, icon_key))) { - if ((icon = load_icon (icon_key, icon_name, size, FALSE))) - g_hash_table_insert (name_to_icon, icon->name, icon); - } - - if (icon && icon->pixbuf) { - list = g_list_prepend (list, icon->pixbuf); - g_object_ref (icon->pixbuf); - } - } - - g_static_mutex_unlock (&mutex); - - return list; -} - /** * e_icon_factory_pixbuf_scale * Scales pixbuf to desired size. diff --git a/e-util/e-icon-factory.h b/e-util/e-icon-factory.h index 1a0954966e..9cecbbd116 100644 --- a/e-util/e-icon-factory.h +++ b/e-util/e-icon-factory.h @@ -50,10 +50,6 @@ char *e_icon_factory_get_icon_filename (const char *icon_name, int icon_siz GdkPixbuf *e_icon_factory_get_icon (const char *icon_name, int icon_size); -GtkWidget *e_icon_factory_get_image (const char *icon_name, int icon_size); - -GList *e_icon_factory_get_icon_list (const char *icon_name); - GdkPixbuf *e_icon_factory_pixbuf_scale (GdkPixbuf *pixbuf, int width, int height); #endif /* _E_ICON_FACTORY_H_ */ diff --git a/e-util/e-import.c b/e-util/e-import.c index 88a75ac422..da4fffb346 100644 --- a/e-util/e-import.c +++ b/e-util/e-import.c @@ -35,8 +35,6 @@ #include "e-import.h" -#include - #include #define d(x) diff --git a/e-util/e-popup.c b/e-util/e-popup.c index f411c2d249..1d2e808bc3 100644 --- a/e-util/e-popup.c +++ b/e-util/e-popup.c @@ -31,8 +31,6 @@ #include "e-popup.h" -#include - #include #define d(x) @@ -357,12 +355,8 @@ ep_build_tree(struct _item_node *inode, guint32 mask) if (item->image) { GtkWidget *image; - /* work-around e-icon-factory not doing GTK_STOCK stuff */ - if (strncmp((char *)item->image, "gtk-", 4) == 0) - image = gtk_image_new_from_stock((char *)item->image, GTK_ICON_SIZE_MENU); - else - image = e_icon_factory_get_image((char *)item->image, E_ICON_SIZE_MENU); - + image = gtk_image_new_from_icon_name ( + (gchar *) item->image, GTK_ICON_SIZE_MENU); gtk_widget_show(image); menuitem = (GtkMenuItem *)gtk_image_menu_item_new(); gtk_image_menu_item_set_image((GtkImageMenuItem *)menuitem, image); -- cgit v1.2.3