aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-08-15 04:19:12 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-08-15 04:19:12 +0800
commit7ade227e6409c98a4010992450e111cf7bb10520 (patch)
treebdd716d894ae2f3b1affaa6bb68950a89441db13 /widgets/misc
parentcca29c3424aede2bb3c9ec5a6d255ce490d3511b (diff)
downloadgsoc2013-evolution-7ade227e6409c98a4010992450e111cf7bb10520.tar
gsoc2013-evolution-7ade227e6409c98a4010992450e111cf7bb10520.tar.gz
gsoc2013-evolution-7ade227e6409c98a4010992450e111cf7bb10520.tar.bz2
gsoc2013-evolution-7ade227e6409c98a4010992450e111cf7bb10520.tar.lz
gsoc2013-evolution-7ade227e6409c98a4010992450e111cf7bb10520.tar.xz
gsoc2013-evolution-7ade227e6409c98a4010992450e111cf7bb10520.tar.zst
gsoc2013-evolution-7ade227e6409c98a4010992450e111cf7bb10520.zip
Merge revisions 35951:35992 from trunk.
svn path=/branches/kill-bonobo/; revision=35994
Diffstat (limited to 'widgets/misc')
-rw-r--r--widgets/misc/ChangeLog21
-rw-r--r--widgets/misc/e-activity-handler.c22
-rw-r--r--widgets/misc/e-activity-handler.h2
-rw-r--r--widgets/misc/e-combo-button.c7
-rw-r--r--widgets/misc/e-info-label.c6
-rw-r--r--widgets/misc/e-search-bar.c1
-rw-r--r--widgets/misc/e-send-options.c12
-rw-r--r--widgets/misc/e-task-widget.c73
-rw-r--r--widgets/misc/e-task-widget.h49
-rw-r--r--widgets/misc/e-url-entry.c3
-rw-r--r--widgets/misc/test-info-label.c3
11 files changed, 85 insertions, 114 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index 6833cf44d6..15f82821c4 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -1,3 +1,24 @@
+2008-08-14 Matthew Barnes <mbarnes@redhat.com>
+
+ * e-multi-config-dialog.c:
+ * e-send-options.c:
+ Use e_display_help() for displaying help.
+
+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-send-options.c b/widgets/misc/e-send-options.c
index 32eb33b484..33c80d6917 100644
--- a/widgets/misc/e-send-options.c
+++ b/widgets/misc/e-send-options.c
@@ -23,11 +23,11 @@
#endif
#include <string.h>
-#include <libgnome/libgnome.h>
#include <glib/gi18n.h>
#include <glade/glade.h>
#include <time.h>
+#include "e-util/e-util.h"
#include "e-util/e-util-private.h"
#include "e-dateedit.h"
@@ -586,7 +586,6 @@ static void e_send_options_cb (GtkDialog *dialog, gint state, gpointer func_data
{
ESendOptionsDialogPrivate *priv;
ESendOptionsDialog *sod;
- GError *error = NULL;
sod = func_data;
priv = sod->priv;
@@ -600,12 +599,9 @@ static void e_send_options_cb (GtkDialog *dialog, gint state, gpointer func_data
g_object_unref (priv->xml);
break;
case GTK_RESPONSE_HELP:
- gnome_help_display (
- "evolution.xml", priv->help_section, &error);
- if (error != NULL) {
- g_warning ("%s", error->message);
- g_error_free (error);
- }
+ e_display_help (
+ GTK_WINDOW (priv->main),
+ priv->help_section);
break;
}
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);