diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2008-08-12 01:04:32 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2008-08-12 01:04:32 +0800 |
commit | 434bc25ed6b3f458f3bf119e76bd8b2bcffe5178 (patch) | |
tree | b84c336fba38760d8fe438eb9c32a117c1998752 /widgets | |
parent | bf8758569da2efb6c4e237741325e8d2056dba45 (diff) | |
download | gsoc2013-evolution-434bc25ed6b3f458f3bf119e76bd8b2bcffe5178.tar.gz gsoc2013-evolution-434bc25ed6b3f458f3bf119e76bd8b2bcffe5178.tar.zst gsoc2013-evolution-434bc25ed6b3f458f3bf119e76bd8b2bcffe5178.zip |
** Fixes bug #546892
2008-08-11 Matthew Barnes <mbarnes@redhat.com>
** 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
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/misc/ChangeLog | 15 | ||||
-rw-r--r-- | widgets/misc/e-activity-handler.c | 22 | ||||
-rw-r--r-- | widgets/misc/e-activity-handler.h | 2 | ||||
-rw-r--r-- | widgets/misc/e-combo-button.c | 7 | ||||
-rw-r--r-- | widgets/misc/e-info-label.c | 6 | ||||
-rw-r--r-- | widgets/misc/e-search-bar.c | 1 | ||||
-rw-r--r-- | widgets/misc/e-task-widget.c | 73 | ||||
-rw-r--r-- | widgets/misc/e-task-widget.h | 49 | ||||
-rw-r--r-- | widgets/misc/e-url-entry.c | 3 | ||||
-rw-r--r-- | widgets/misc/test-info-label.c | 3 |
10 files changed, 75 insertions, 106 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog index 6833cf44d6..5f7fd73f51 100644 --- a/widgets/misc/ChangeLog +++ b/widgets/misc/ChangeLog @@ -1,3 +1,18 @@ +2008-08-11 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes part of bug #546892 + + * e-combo-button.c: + * e-info-label.c: + * e-url-entry.c: + * e-task-widget.c: + Prefer gtk_image_new_from_stock() over e_icon_factory_get_image(). + + * e-activity-handler.c: + * e-task-widget.c: + Purge the GdkPixbuf arguments from the API. We've been ignoring + them since the spinner icon was added. + 2008-07-23 Milan Crha <mcrha@redhat.com> ** Part of fix for bug #543943 diff --git a/widgets/misc/e-activity-handler.c b/widgets/misc/e-activity-handler.c index 04861b1b8f..d7972ac336 100644 --- a/widgets/misc/e-activity-handler.c +++ b/widgets/misc/e-activity-handler.c @@ -39,7 +39,6 @@ struct _ActivityInfo { char *component_id; - GdkPixbuf *icon_pixbuf; int error_type; guint id; char *information; @@ -131,7 +130,6 @@ task_widget_button_press_event_callback (GtkWidget *widget, static ActivityInfo * activity_info_new (const char *component_id, guint id, - GdkPixbuf *icon, const char *information, gboolean cancellable) { @@ -140,7 +138,6 @@ activity_info_new (const char *component_id, info = g_new (ActivityInfo, 1); info->component_id = g_strdup (component_id); info->id = id; - info->icon_pixbuf = icon ? g_object_ref (icon): NULL; info->information = g_strdup (information); info->cancellable = cancellable; info->progress = -1.0; /* (Unknown) */ @@ -155,9 +152,6 @@ static void activity_info_free (ActivityInfo *info) { g_free (info->component_id); - - if (info->icon_pixbuf) - g_object_unref (info->icon_pixbuf); g_free (info->information); if (info->menu != NULL) @@ -172,9 +166,11 @@ task_widget_new_from_activity_info (ActivityInfo *activity_info) GtkWidget *widget; ETaskWidget *etw; - widget = e_task_widget_new_with_cancel (activity_info->icon_pixbuf, - activity_info->component_id, - activity_info->information, activity_info->cancel_func, activity_info->data); + widget = e_task_widget_new_with_cancel ( + activity_info->component_id, + activity_info->information, + activity_info->cancel_func, + activity_info->data); etw = (ETaskWidget *) widget; etw->id = activity_info->id; gtk_widget_show (widget); @@ -411,7 +407,6 @@ cancel_wrapper (gpointer pdata) /* CORBA methods. */ guint e_activity_handler_cancelable_operation_started (EActivityHandler *activity_handler, const char *component_id, - GdkPixbuf *icon_pixbuf, const char *information, gboolean cancellable, void (*cancel_func)(gpointer), @@ -426,7 +421,7 @@ guint e_activity_handler_cancelable_operation_started (EActivityHandler *activ priv = activity_handler->priv; activity_id = get_new_activity_id (activity_handler); - activity_info = activity_info_new (component_id, activity_id, icon_pixbuf, information, cancellable); + activity_info = activity_info_new (component_id, activity_id, information, cancellable); data = g_new(struct _cancel_wdata, 1); data->handler = activity_handler; @@ -457,7 +452,6 @@ guint e_activity_handler_cancelable_operation_started (EActivityHandler *activ guint e_activity_handler_operation_started (EActivityHandler *activity_handler, const char *component_id, - GdkPixbuf *icon_pixbuf, const char *information, gboolean cancellable) { @@ -470,7 +464,7 @@ e_activity_handler_operation_started (EActivityHandler *activity_handler, activity_id = get_new_activity_id (activity_handler); - activity_info = activity_info_new (component_id, activity_id, icon_pixbuf, information, cancellable); + activity_info = activity_info_new (component_id, activity_id, information, cancellable); for (p = priv->task_bars; p != NULL; p = p->next) { ETaskWidget *tw = task_widget_new_from_activity_info (activity_info); @@ -558,7 +552,7 @@ e_activity_handler_make_error (EActivityHandler *activity_handler, priv = activity_handler->priv; activity_id = get_new_activity_id (activity_handler); - activity_info = activity_info_new (component_id, activity_id, NULL, information, TRUE); + activity_info = activity_info_new (component_id, activity_id, information, TRUE); activity_info->error = error; activity_info->error_time = time (NULL); activity_info->error_type = error_type; diff --git a/widgets/misc/e-activity-handler.h b/widgets/misc/e-activity-handler.h index 49f7742026..8b6a857569 100644 --- a/widgets/misc/e-activity-handler.h +++ b/widgets/misc/e-activity-handler.h @@ -71,12 +71,10 @@ void e_activity_handler_unset_message (EActivityHandler *activity_handler); guint e_activity_handler_operation_started (EActivityHandler *activity_handler, const char *component_id, - GdkPixbuf *icon_pixbuf, const char *information, gboolean cancellable); guint e_activity_handler_cancelable_operation_started (EActivityHandler *activity_handler, const char *component_id, - GdkPixbuf *icon_pixbuf, const char *information, gboolean cancellable, void (*cancel_func)(gpointer), diff --git a/widgets/misc/e-combo-button.c b/widgets/misc/e-combo-button.c index 65014900c6..6fc0fec57e 100644 --- a/widgets/misc/e-combo-button.c +++ b/widgets/misc/e-combo-button.c @@ -26,7 +26,6 @@ #include "e-combo-button.h" #include "ea-widgets.h" -#include <e-util/e-icon-factory.h> struct _EComboButtonPrivate { GdkPixbuf *icon; @@ -461,7 +460,8 @@ e_combo_button_pack_hbox (EComboButton *combo_button) gtk_container_add (GTK_CONTAINER (combo_button), priv->hbox); gtk_widget_show (priv->hbox); - priv->icon_image = e_icon_factory_get_image (NULL, E_ICON_SIZE_MENU); + priv->icon_image = gtk_image_new_from_stock ( + GTK_STOCK_MISSING_IMAGE, GTK_ICON_SIZE_MENU); gtk_box_pack_start (GTK_BOX (priv->hbox), priv->icon_image, TRUE, TRUE, 0); gtk_widget_show (priv->icon_image); @@ -498,7 +498,8 @@ e_combo_button_pack_vbox (EComboButton *combo_button) priv->vbox = gtk_vbox_new (FALSE, 0); gtk_widget_show (priv->vbox); - priv->icon_image = e_icon_factory_get_image (NULL, E_ICON_SIZE_MENU); + priv->icon_image = gtk_image_new_from_stock ( + GTK_STOCK_MISSING_IMAGE, GTK_ICON_SIZE_MENU); gtk_box_pack_start (GTK_BOX (priv->vbox), priv->icon_image, TRUE, TRUE, 0); gtk_widget_show (priv->icon_image); diff --git a/widgets/misc/e-info-label.c b/widgets/misc/e-info-label.c index 3e8691972d..4c3c04069f 100644 --- a/widgets/misc/e-info-label.c +++ b/widgets/misc/e-info-label.c @@ -27,8 +27,6 @@ #include "e-info-label.h" -#include <e-util/e-icon-factory.h> - static GtkHBoxClass *el_parent; static void @@ -184,10 +182,8 @@ e_info_label_new(const char *icon) { EInfoLabel *el = g_object_new(e_info_label_get_type(), NULL); GtkWidget *image; - char *name = e_icon_factory_get_icon_filename (icon, E_ICON_SIZE_MENU); - image = gtk_image_new_from_file(name); - g_free(name); + image = gtk_image_new_from_icon_name (icon, GTK_ICON_SIZE_MENU); gtk_misc_set_padding((GtkMisc *)image, 6, 6); gtk_box_pack_start((GtkBox *)el, image, FALSE, TRUE, 0); gtk_widget_show(image); diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c index ffef719f17..bd8ba20072 100644 --- a/widgets/misc/e-search-bar.c +++ b/widgets/misc/e-search-bar.c @@ -45,7 +45,6 @@ #include "e-search-bar.h" #include "e-util/e-util.h" #include "e-util/e-util-marshal.h" -#include "e-util/e-icon-factory.h" enum { diff --git a/widgets/misc/e-task-widget.c b/widgets/misc/e-task-widget.c index 74b0ba6891..bb2ec2747e 100644 --- a/widgets/misc/e-task-widget.c +++ b/widgets/misc/e-task-widget.c @@ -26,7 +26,6 @@ #include "e-task-widget.h" #include "e-spinner.h" -#include <e-util/e-icon-factory.h> #include <glib/gi18n.h> @@ -36,7 +35,6 @@ struct _ETaskWidgetPrivate { char *component_id; - GdkPixbuf *icon_pixbuf; GtkWidget *label; GtkWidget *box; GtkWidget *image; @@ -50,24 +48,6 @@ G_DEFINE_TYPE (ETaskWidget, e_task_widget, GTK_TYPE_EVENT_BOX) /* GObject methods. */ static void -impl_dispose (GObject *object) -{ - ETaskWidget *task_widget; - ETaskWidgetPrivate *priv; - - task_widget = E_TASK_WIDGET (object); - - priv = task_widget->priv; - - if (priv->icon_pixbuf != NULL) { - g_object_unref (priv->icon_pixbuf); - priv->icon_pixbuf = NULL; - } - - (* G_OBJECT_CLASS (e_task_widget_parent_class)->dispose) (object); -} - -static void impl_finalize (GObject *object) { ETaskWidget *task_widget; @@ -88,7 +68,6 @@ e_task_widget_class_init (ETaskWidgetClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - object_class->dispose = impl_dispose; object_class->finalize = impl_finalize; } @@ -100,7 +79,6 @@ e_task_widget_init (ETaskWidget *task_widget) priv = g_new (ETaskWidgetPrivate, 1); priv->component_id = NULL; - priv->icon_pixbuf = NULL; priv->label = NULL; priv->image = NULL; priv->box = NULL; @@ -137,15 +115,12 @@ prepare_popup (ETaskWidget *widget, GdkEventButton *event) void e_task_widget_construct (ETaskWidget *task_widget, - GdkPixbuf *icon_pixbuf, const char *component_id, const char *information, void (*cancel_func) (gpointer data), gpointer data) { ETaskWidgetPrivate *priv; - /*GdkPixmap *pixmap; - GdkBitmap *mask;*/ GtkWidget *box; GtkWidget *frame; @@ -169,15 +144,10 @@ e_task_widget_construct (ETaskWidget *task_widget, gtk_widget_set_size_request (box, 1, -1); - /* FIXME: Experimenting Spinner widget instead of an image. REWORK THIS */ - /* priv->icon_pixbuf = g_object_ref (icon_pixbuf); */ - - /* gdk_pixbuf_render_pixmap_and_mask (icon_pixbuf, &pixmap, &mask, 128); */ priv->box = gtk_hbox_new (FALSE, 0); priv->image = e_spinner_new (); e_spinner_set_size (E_SPINNER (priv->image), GTK_ICON_SIZE_SMALL_TOOLBAR); e_spinner_start (E_SPINNER (priv->image)); - /* gtk_image_new_from_pixmap (pixmap, mask); */ gtk_widget_show (priv->image); gtk_widget_show (priv->box); gtk_box_pack_start (GTK_BOX (priv->box), priv->image, FALSE, TRUE, 0); @@ -187,9 +157,16 @@ e_task_widget_construct (ETaskWidget *task_widget, gtk_widget_show (priv->label); gtk_box_pack_start (GTK_BOX (box), priv->label, TRUE, TRUE, 0); if (cancel_func) { - GtkWidget *image = e_icon_factory_get_image ("gtk-stop", E_ICON_SIZE_MENU); + GdkPixbuf *pixbuf; + GtkWidget *image; GtkWidget *tool; + pixbuf = gtk_icon_theme_load_icon ( + gtk_icon_theme_get_default (), + "gtk-stop", 16, 0, NULL); + image = gtk_image_new_from_pixbuf (pixbuf); + g_object_unref (pixbuf); + tool = (GtkWidget *) gtk_tool_button_new (image, NULL); gtk_box_pack_end (GTK_BOX (box), tool, FALSE, TRUE, 0); gtk_widget_show_all (tool); @@ -198,9 +175,6 @@ e_task_widget_construct (ETaskWidget *task_widget, priv->cancel_func = cancel_func; priv->data = data; g_signal_connect (tool, "clicked", G_CALLBACK (button_press_event_cb), task_widget); - /* g_object_unref (pixmap); - if (mask) - g_object_unref (mask); */ g_signal_connect (task_widget, "button-press-event", G_CALLBACK (prepare_popup), task_widget); } @@ -209,34 +183,31 @@ e_task_widget_construct (ETaskWidget *task_widget, } GtkWidget * -e_task_widget_new_with_cancel (GdkPixbuf *icon_pixbuf, - const char *component_id, - const char *information, - void (*cancel_func) (gpointer data), - gpointer data) +e_task_widget_new_with_cancel (const char *component_id, + const char *information, + void (*cancel_func) (gpointer data), + gpointer data) { ETaskWidget *task_widget; g_return_val_if_fail (information != NULL, NULL); task_widget = g_object_new (e_task_widget_get_type (), NULL); - e_task_widget_construct (task_widget, icon_pixbuf, component_id, information, cancel_func, data); + e_task_widget_construct (task_widget, component_id, information, cancel_func, data); return GTK_WIDGET (task_widget); } GtkWidget * -e_task_widget_new (GdkPixbuf *icon_pixbuf, - const char *component_id, +e_task_widget_new (const char *component_id, const char *information) { ETaskWidget *task_widget; - g_return_val_if_fail (icon_pixbuf != NULL, NULL); g_return_val_if_fail (information != NULL, NULL); task_widget = g_object_new (e_task_widget_get_type (), NULL); - e_task_widget_construct (task_widget, icon_pixbuf, component_id, information, NULL, NULL); + e_task_widget_construct (task_widget, component_id, information, NULL, NULL); return GTK_WIDGET (task_widget); } @@ -245,14 +216,20 @@ GtkWidget * e_task_widget_update_image (ETaskWidget *task_widget, const char *stock, const char *text) { - GtkWidget *img, *tool; + GtkWidget *image, *tool; + GdkPixbuf *pixbuf; + + pixbuf = gtk_icon_theme_load_icon ( + gtk_icon_theme_get_default (), + stock, 16, 0, NULL); + image = gtk_image_new_from_pixbuf (pixbuf); + g_object_unref (pixbuf); - img = e_icon_factory_get_image (stock, E_ICON_SIZE_MENU); - tool = (GtkWidget *) gtk_tool_button_new (img, NULL); + tool = (GtkWidget *) gtk_tool_button_new (image, NULL); gtk_box_pack_start (GTK_BOX(task_widget->priv->box), tool, FALSE, TRUE, 0); gtk_widget_show_all (task_widget->priv->box); gtk_widget_hide (task_widget->priv->image); - task_widget->priv->image = img; + task_widget->priv->image = image; gtk_label_set_text (GTK_LABEL (task_widget->priv->label), text); return tool; diff --git a/widgets/misc/e-task-widget.h b/widgets/misc/e-task-widget.h index d82d053b8a..cb63b27379 100644 --- a/widgets/misc/e-task-widget.h +++ b/widgets/misc/e-task-widget.h @@ -53,34 +53,27 @@ struct _ETaskWidgetClass { }; -GType e_task_widget_get_type (void); -void e_task_widget_construct (ETaskWidget *task_widget, - GdkPixbuf *icon_pixbuf, - const char *component_id, - const char *information, - void (*cancel_func) (gpointer data), - gpointer data); -GtkWidget *e_task_widget_new (GdkPixbuf *icon_pixbuf, - const char *component_id, - const char *information); -GtkWidget * -e_task_widget_new_with_cancel (GdkPixbuf *icon_pixbuf, - const char *component_id, - const char *information, - void (*cancel_func) (gpointer data), - gpointer data); - -void e_task_widget_update (ETaskWidget *task_widget, - const char *information, - double completion); -GtkWidget * -e_task_widget_update_image (ETaskWidget *task_widget, - const char *stock, const char *text); - -void e_task_wiget_alert (ETaskWidget *task_widget); -void e_task_wiget_unalert (ETaskWidget *task_widget); - -const char *e_task_widget_get_component_id (ETaskWidget *task_widget); +GType e_task_widget_get_type (void); +void e_task_widget_construct (ETaskWidget *task_widget, + const char *component_id, + const char *information, + void (*cancel_func) (gpointer data), + gpointer data); +GtkWidget * e_task_widget_new (const char *component_id, + const char *information); +GtkWidget * e_task_widget_new_with_cancel (const char *component_id, + const char *information, + void (*cancel_func) (gpointer data), + gpointer data); +void e_task_widget_update (ETaskWidget *task_widget, + const char *information, + double completion); +GtkWidget * e_task_widget_update_image (ETaskWidget *task_widget, + const char *stock, + const char *text); +void e_task_wiget_alert (ETaskWidget *task_widget); +void e_task_wiget_unalert (ETaskWidget *task_widget); +const char * e_task_widget_get_component_id (ETaskWidget *task_widget); #ifdef __cplusplus } diff --git a/widgets/misc/e-url-entry.c b/widgets/misc/e-url-entry.c index f0ae7c5c4a..9db87b3ecd 100644 --- a/widgets/misc/e-url-entry.c +++ b/widgets/misc/e-url-entry.c @@ -29,7 +29,6 @@ #include <libgnome/gnome-url.h> #include <glib/gi18n.h> #include "e-url-entry.h" -#include <e-util/e-icon-factory.h> struct _EUrlEntryPrivate { GtkWidget *entry; @@ -105,7 +104,7 @@ init (EUrlEntry *url_entry) gtk_widget_set_sensitive (priv->button, FALSE); gtk_box_pack_start (GTK_BOX (url_entry), priv->button, FALSE, FALSE, 0); atk_object_set_name (gtk_widget_get_accessible (priv->button), _("Click here to go to URL")); - pixmap = e_icon_factory_get_image ("go-jump", E_ICON_SIZE_BUTTON); + pixmap = gtk_image_new_from_icon_name ("go-jump", GTK_ICON_SIZE_BUTTON); gtk_container_add (GTK_CONTAINER (priv->button), pixmap); gtk_widget_show (pixmap); diff --git a/widgets/misc/test-info-label.c b/widgets/misc/test-info-label.c index 70b47f9488..890dfc2082 100644 --- a/widgets/misc/test-info-label.c +++ b/widgets/misc/test-info-label.c @@ -27,7 +27,6 @@ #include <gtk/gtk.h> #include <libgnomeui/gnome-app.h> #include <libgnomeui/gnome-ui-init.h> -#include <e-util/e-icon-factory.h> #include "e-info-label.h" static void @@ -36,7 +35,6 @@ delete_event_cb (GtkWidget *widget, gpointer data) { gtk_main_quit (); - e_icon_factory_shutdown (); } int @@ -50,7 +48,6 @@ main (int argc, char **argv) gnome_program_init ( "test-title-bar", "0.0", LIBGNOMEUI_MODULE, argc, argv, GNOME_PARAM_NONE); - e_icon_factory_init (); app = gnome_app_new ("Test", "Test"); gtk_window_set_default_size (GTK_WINDOW (app), 400, 400); |