aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
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 /e-util
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 'e-util')
-rw-r--r--e-util/ChangeLog28
-rw-r--r--e-util/e-config.c2
-rw-r--r--e-util/e-event.c2
-rw-r--r--e-util/e-gui-utils.c27
-rw-r--r--e-util/e-gui-utils.h1
-rw-r--r--e-util/e-icon-factory.c56
-rw-r--r--e-util/e-icon-factory.h4
-rw-r--r--e-util/e-import.c2
-rw-r--r--e-util/e-popup.c10
-rw-r--r--e-util/e-util.c42
-rw-r--r--e-util/e-util.h2
11 files changed, 71 insertions, 105 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index 785383c11b..0c80024a22 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,31 @@
+2008-08-14 Matthew Barnes <mbarnes@redhat.com>
+
+ * e-util.c (e_display_help):
+ New convenience function for launching help from Evolution.
+ Displays an error dialog over the given parent window if an
+ error occurs.
+
+2008-08-13 Matthew Barnes <mbarnes@redhat.com>
+
+ * e-gui-utils.c (e_create_image_widget):
+ Remove this unused function.
+
+ * e-util.h: Cosmetic cleanups.
+
+2008-08-11 Matthew Barnes <mbarnes@redhat.com>
+
+ ** 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 <mbarnes@redhat.com>
** 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 <e-util/e-icon-factory.h>
-
#include <glib/gi18n.h>
#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 <e-util/e-icon-factory.h>
-
#include <glib/gi18n.h>
#include <libedataserver/e-msgport.h>
diff --git a/e-util/e-gui-utils.c b/e-util/e-gui-utils.c
index c354597153..cff2b500b0 100644
--- a/e-util/e-gui-utils.c
+++ b/e-util/e-gui-utils.c
@@ -18,7 +18,6 @@
#include <string.h>
#include "e-gui-utils.h"
-#include <e-util/e-icon-factory.h>
#include <libgnome/gnome-program.h>
#include <libgnomeui/gnome-icon-lookup.h>
@@ -53,29 +52,3 @@ e_icon_for_mime_type (const char *mime_type, int size_hint)
return pixbuf;
}
-
-GtkWidget *e_create_image_widget(gchar *name,
- gchar *string1, gchar *string2,
- gint int1, gint int2)
-{
- GtkWidget *alignment = NULL;
- GtkWidget *w;
-
- if (string1) {
- w = e_icon_factory_get_image (string1, E_ICON_SIZE_DIALOG);
-
- gtk_misc_set_alignment (GTK_MISC (w), 0.5, 0.5);
-
- alignment = gtk_widget_new(gtk_alignment_get_type(),
- "child", w,
- "xalign", (double) 0,
- "yalign", (double) 0,
- "xscale", (double) 0,
- "yscale", (double) 0,
- NULL);
-
- gtk_widget_show_all (alignment);
- }
-
- return alignment;
-}
diff --git a/e-util/e-gui-utils.h b/e-util/e-gui-utils.h
index 740c77e95e..bbeefa9c61 100644
--- a/e-util/e-gui-utils.h
+++ b/e-util/e-gui-utils.h
@@ -4,6 +4,5 @@
#include <gtk/gtk.h>
GdkPixbuf *e_icon_for_mime_type (const char *mime_type, int size);
-GtkWidget *e_create_image_widget (gchar *name, gchar *string1, gchar *string2, gint int1, gint int2);
#endif /* E_GUI_UTILS_H */
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 <e-util/e-icon-factory.h>
-
#include <glib/gi18n.h>
#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 <e-util/e-icon-factory.h>
-
#include <glib/gi18n.h>
#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);
diff --git a/e-util/e-util.c b/e-util/e-util.c
index 5bb42b2afa..06d7e1fcee 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -35,10 +35,11 @@
#include <sys/stat.h>
#include <fcntl.h>
-#include <glib.h>
-#include <glib/gstdio.h>
-#include <gtk/gtk.h>
#include <gio/gio.h>
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+#include <glib/gstdio.h>
+#include <libgnome/gnome-help.h>
#include <libgnome/gnome-util.h>
#ifdef G_OS_WIN32
@@ -70,6 +71,41 @@ e_get_user_data_dir (void)
}
/**
+ * e_display_help:
+ * @parent: a parent #GtkWindow or %NULL
+ * @link_id: help section to present or %NULL
+ *
+ * Opens the user documentation to the section given by @link_id, or to the
+ * table of contents if @link_id is %NULL. If the user documentation cannot
+ * be opened, it presents a dialog describing the error. The dialog is set
+ * as transient to @parent if @parent is non-%NULL.
+ **/
+void
+e_display_help (GtkWindow *parent,
+ const gchar *link_id)
+{
+ GtkWidget *dialog;
+ GError *error = NULL;
+
+ if (gnome_help_display ("evolution.xml", link_id, &error))
+ return;
+
+ dialog = gtk_message_dialog_new_with_markup (
+ parent, GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
+ "<big><b>%s</b></big>",
+ _("Could not display help for Evolution."));
+
+ gtk_message_dialog_format_secondary_text (
+ GTK_MESSAGE_DIALOG (dialog), "%s", error->message);
+
+ gtk_dialog_run (GTK_DIALOG (dialog));
+
+ gtk_widget_destroy (dialog);
+ g_error_free (error);
+}
+
+/**
* e_load_ui_definition:
* @manager: a #GtkUIManager
* @basename: basename of the UI definition file
diff --git a/e-util/e-util.h b/e-util/e-util.h
index f44c2a0e13..2abe72ced9 100644
--- a/e-util/e-util.h
+++ b/e-util/e-util.h
@@ -42,6 +42,8 @@ typedef enum {
} EFocus;
const gchar * e_get_user_data_dir (void);
+void e_display_help (GtkWindow *parent,
+ const gchar *link_id);
guint e_load_ui_definition (GtkUIManager *manager,
const gchar *basename);