aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets
diff options
context:
space:
mode:
authorRodney Dawes <dobey@ximian.com>2004-04-19 23:19:05 +0800
committerRodney Dawes <dobey@src.gnome.org>2004-04-19 23:19:05 +0800
commitc13ea522069443479b5370d6bb0084b281272ef2 (patch)
tree39a68c387cffde755433bbc0db48d7a44d9cb54a /addressbook/gui/widgets
parentf4b4be936edef388577024f565b2f1643d4bd2f9 (diff)
downloadgsoc2013-evolution-c13ea522069443479b5370d6bb0084b281272ef2.tar.gz
gsoc2013-evolution-c13ea522069443479b5370d6bb0084b281272ef2.tar.zst
gsoc2013-evolution-c13ea522069443479b5370d6bb0084b281272ef2.zip
Set the default image for the contact photo to be the stock_person image
2004-04-19 Rodney Dawes <dobey@ximian.com> * gui/contact-editor/contact-editor.glade: Set the default image for the contact photo to be the stock_person image in the icon theme 2004-04-19 Michael Terry <mike@mterry.name> * gui/component/GNOME_Evolution_Addressbook.server.in.in: * gui/component/addressbook-component.c: * gui/component/addressbook-view.c: * gui/component/select-names/e-select-names-popup.c: * gui/contact-editor/e-contact-editor-address.c: * gui/contact-editor/e-contact-editor-fullname.c: * gui/contact-editor/e-contact-editor-im.c: * gui/contact-list-editor/contact-list-editor.glade: * gui/contact-list-editor/e-contact-list-editor.c: * gui/merging/eab-contact-commit-duplicate-detected.glade: * gui/merging/eab-contact-duplicate-detected.glade: * gui/widgets/e-minicard.c: * gui/widgets/eab-contact-display.c: * gui/widgets/eab-gui-util.c: Update the addressbook to use the icon theme via the EIconFactory object in e-util svn path=/trunk/; revision=25514
Diffstat (limited to 'addressbook/gui/widgets')
-rw-r--r--addressbook/gui/widgets/e-minicard.c8
-rw-r--r--addressbook/gui/widgets/eab-contact-display.c35
-rw-r--r--addressbook/gui/widgets/eab-gui-util.c5
3 files changed, 23 insertions, 25 deletions
diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c
index fdaf1692ba..e49b162fc1 100644
--- a/addressbook/gui/widgets/e-minicard.c
+++ b/addressbook/gui/widgets/e-minicard.c
@@ -39,6 +39,7 @@
#include "e-minicard-label.h"
#include "e-minicard-view.h"
#include "e-contact-editor.h"
+#include <e-util/e-icon-factory.h>
#include "util/e-destination.h"
static void e_minicard_init (EMinicard *card);
@@ -62,7 +63,7 @@ static GnomeCanvasGroupClass *parent_class = NULL;
#define d(x)
-#define LIST_ICON_FILENAME "contact-list-16.png"
+#define LIST_ICON_NAME "stock_contact-list"
static void
e_minicard_field_destroy(EMinicardField *field)
@@ -235,7 +236,7 @@ e_minicard_init (EMinicard *minicard)
minicard->contact = NULL;
- minicard->list_icon_pixbuf = gdk_pixbuf_new_from_file (EVOLUTION_IMAGESDIR "/" LIST_ICON_FILENAME, NULL);
+ minicard->list_icon_pixbuf = e_icon_factory_get_icon (LIST_ICON_NAME, 16);
minicard->list_icon_size = gdk_pixbuf_get_height (minicard->list_icon_pixbuf);
minicard->editor = NULL;
@@ -426,6 +427,9 @@ e_minicard_finalize (GObject *object)
if (e_minicard->contact)
g_object_unref (e_minicard->contact);
+
+ if (e_minicard->list_icon_pixbuf)
+ g_object_unref (e_minicard->list_icon_pixbuf);
if (G_OBJECT_CLASS (parent_class)->finalize)
(* G_OBJECT_CLASS (parent_class)->finalize) (object);
diff --git a/addressbook/gui/widgets/eab-contact-display.c b/addressbook/gui/widgets/eab-contact-display.c
index f81ff673ad..1d4cc794b8 100644
--- a/addressbook/gui/widgets/eab-contact-display.c
+++ b/addressbook/gui/widgets/eab-contact-display.c
@@ -44,14 +44,14 @@ struct _EABContactDisplayPrivate {
#define HEADER_COLOR "#7f7f7f"
#define IMAGE_COL_WIDTH "20"
-#define CONTACT_LIST_ICON "contact-list-16.png"
-#define AIM_ICON "im-aim.png"
-#define GROUPWISE_ICON "im-nov.png"
-#define ICQ_ICON "im-icq.png"
-#define JABBER_ICON "im-jabber.png"
-#define MSN_ICON "im-msn.png"
-#define YAHOO_ICON "im-yahoo.png"
-#define VIDEOCONF_ICON "videoconf.png"
+#define CONTACT_LIST_ICON "stock_contact-list"
+#define AIM_ICON "im-aim"
+#define GROUPWISE_ICON "im-nov"
+#define ICQ_ICON "im-icq"
+#define JABBER_ICON "im-jabber"
+#define MSN_ICON "im-msn"
+#define YAHOO_ICON "im-yahoo"
+#define VIDEOCONF_ICON "stock_video-conferencing"
#define MAX_COMPACT_IMAGE_DIMENSION 48
@@ -73,20 +73,17 @@ on_url_requested (GtkHTML *html, const char *url, GtkHTMLStream *handle,
else if (!strncmp (url, "evo-icon:", strlen ("evo-icon:"))) {
gchar *data;
gsize data_length;
- char *filename;
+ gchar *filename;
- /* make sure people can't embed ../../../../../../etc/passwd or something */
- if (!strchr (url, '/')) {
- filename = g_build_filename (EVOLUTION_IMAGESDIR, url + strlen ("evo-icon:"), NULL);
-
- if (g_file_get_contents (filename, &data, &data_length, NULL))
- gtk_html_stream_write (handle, data, data_length);
-
- gtk_html_end (html, handle, GTK_HTML_STREAM_OK);
-
- g_free (filename);
+ filename = e_icon_factory_get_icon_filename (url + strlen ("evo-icon:"), 16);
+ if (g_file_get_contents (filename, &data, &data_length, NULL)) {
+ gtk_html_stream_write (handle, data, data_length);
g_free (data);
}
+
+ gtk_html_stream_close (handle, GTK_HTML_STREAM_OK);
+
+ g_free (filename);
}
}
diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c
index 14f446644f..eed07a3621 100644
--- a/addressbook/gui/widgets/eab-gui-util.c
+++ b/addressbook/gui/widgets/eab-gui-util.c
@@ -971,10 +971,7 @@ eab_create_image_chooser_widget(gchar *name,
char *filename;
GtkWidget *w = NULL;
if (string1) {
- if (*string1 == '/')
- filename = g_strdup(string1);
- else
- filename = g_build_filename (EVOLUTION_IMAGESDIR, string1, NULL);
+ filename = e_icon_factory_get_icon_filename (string1, 48);
w = e_image_chooser_new ();
e_image_chooser_set_from_file (E_IMAGE_CHOOSER (w), filename);