From c13ea522069443479b5370d6bb0084b281272ef2 Mon Sep 17 00:00:00 2001 From: Rodney Dawes Date: Mon, 19 Apr 2004 15:19:05 +0000 Subject: Set the default image for the contact photo to be the stock_person image 2004-04-19 Rodney Dawes * 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 * 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 --- .../gui/contact-editor/contact-editor.glade | 1 + .../gui/contact-editor/e-contact-editor-address.c | 13 +++++--- .../gui/contact-editor/e-contact-editor-fullname.c | 13 +++++--- .../gui/contact-editor/e-contact-editor-im.c | 36 ++++++++++------------ 4 files changed, 34 insertions(+), 29 deletions(-) (limited to 'addressbook/gui/contact-editor') diff --git a/addressbook/gui/contact-editor/contact-editor.glade b/addressbook/gui/contact-editor/contact-editor.glade index cefd73f07a..ceb32b2b67 100644 --- a/addressbook/gui/contact-editor/contact-editor.glade +++ b/addressbook/gui/contact-editor/contact-editor.glade @@ -64,6 +64,7 @@ True eab_create_image_chooser_widget + stock_person 0 0 Tue, 13 Apr 2004 20:51:33 GMT diff --git a/addressbook/gui/contact-editor/e-contact-editor-address.c b/addressbook/gui/contact-editor/e-contact-editor-address.c index 683fa12da0..375bf5a197 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-address.c +++ b/addressbook/gui/contact-editor/e-contact-editor-address.c @@ -22,10 +22,10 @@ #include #include +#include #include #include -#include #include #include #include @@ -420,7 +420,7 @@ e_contact_editor_address_init (EContactEditorAddress *e_contact_editor_address) { GladeXML *gui; GtkWidget *widget; - char *icon_path; + GList *icon_list; gtk_dialog_add_buttons (GTK_DIALOG (e_contact_editor_address), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, @@ -447,9 +447,12 @@ e_contact_editor_address_init (EContactEditorAddress *e_contact_editor_address) gtk_box_pack_start (GTK_BOX (GTK_DIALOG (e_contact_editor_address)->vbox), widget, TRUE, TRUE, 0); g_object_unref(widget); - icon_path = g_concat_dir_and_file (EVOLUTION_IMAGESDIR, "evolution-contacts-mini.png"); - gnome_window_icon_set_from_file (GTK_WINDOW (e_contact_editor_address), icon_path); - g_free (icon_path); + icon_list = e_icon_factory_get_icon_list ("stock_contact"); + if (icon_list) { + gtk_window_set_icon_list (GTK_WINDOW (e_contact_editor_address), icon_list); + g_list_foreach (icon_list, (GFunc) g_object_unref, NULL); + g_list_free (icon_list); + } } void diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c index 824a4e45a9..b8887fa051 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c +++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c @@ -21,7 +21,7 @@ #include #include "e-contact-editor-fullname.h" -#include +#include #include #include #include @@ -103,7 +103,7 @@ e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullnam { GladeXML *gui; GtkWidget *widget; - char *icon_path; + GList *icon_list; gtk_dialog_add_buttons (GTK_DIALOG (e_contact_editor_fullname), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, @@ -126,9 +126,12 @@ e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullnam gtk_box_pack_start (GTK_BOX (GTK_DIALOG (e_contact_editor_fullname)->vbox), widget, TRUE, TRUE, 0); g_object_unref(widget); - icon_path = g_concat_dir_and_file (EVOLUTION_IMAGESDIR, "evolution-contacts-mini.png"); - gnome_window_icon_set_from_file (GTK_WINDOW (e_contact_editor_fullname), icon_path); - g_free (icon_path); + icon_list = e_icon_factory_get_icon_list ("stock_contact"); + if (icon_list) { + gtk_window_set_icon_list (GTK_WINDOW (e_contact_editor_fullname), icon_list); + g_list_foreach (icon_list, (GFunc) g_object_unref, NULL); + g_list_free (icon_list); + } } void diff --git a/addressbook/gui/contact-editor/e-contact-editor-im.c b/addressbook/gui/contact-editor/e-contact-editor-im.c index dc1a4e39bc..0be3c2b09f 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-im.c +++ b/addressbook/gui/contact-editor/e-contact-editor-im.c @@ -21,7 +21,6 @@ #include #include "e-contact-editor-im.h" -#include #include #include #include @@ -34,6 +33,7 @@ #include #include #include +#include static void e_contact_editor_im_init (EContactEditorIm *card); static void e_contact_editor_im_class_init (EContactEditorImClass *klass); @@ -68,12 +68,12 @@ static const char *im_labels[] = { }; static const char *im_images[] = { - "im-aim.png", - "im-nov.png", - "im-jabber.png", - "im-yahoo.png", - "im-msn.png", - "im-icq.png" + "im-aim", + "im-nov", + "im-jabber", + "im-yahoo", + "im-msn", + "im-icq" }; GType @@ -176,9 +176,7 @@ setup_service_optmenu(EContactEditorIm *editor) GtkWidget *label; GtkWidget *image; GdkPixbuf *pixbuf; - GdkPixbuf *scale; GtkSizeGroup *sg; - char *icon_path; int i; optmenu = glade_xml_get_widget(editor->gui, "optmenu-service"); @@ -198,16 +196,12 @@ setup_service_optmenu(EContactEditorIm *editor) gtk_container_add(GTK_CONTAINER(item), hbox); gtk_widget_show(hbox); - icon_path = g_concat_dir_and_file(EVOLUTION_IMAGESDIR, im_images[i]); - pixbuf = gdk_pixbuf_new_from_file(icon_path, NULL); - g_free(icon_path); + pixbuf = e_icon_factory_get_icon(im_images[i], 16); if (pixbuf != NULL) { - scale = gdk_pixbuf_scale_simple(pixbuf, 16, 16, GDK_INTERP_BILINEAR); - image = gtk_image_new_from_pixbuf(scale); + image = gtk_image_new_from_pixbuf(pixbuf); g_object_unref(G_OBJECT(pixbuf)); - g_object_unref(G_OBJECT(scale)); } else image = gtk_image_new(); @@ -261,7 +255,7 @@ e_contact_editor_im_init (EContactEditorIm *e_contact_editor_im) { GladeXML *gui; GtkWidget *widget; - char *icon_path; + GList *icon_list; gtk_dialog_add_buttons (GTK_DIALOG (e_contact_editor_im), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, @@ -295,9 +289,13 @@ e_contact_editor_im_init (EContactEditorIm *e_contact_editor_im) gtk_widget_grab_focus(glade_xml_get_widget(gui, "entry-username")); - icon_path = g_concat_dir_and_file (EVOLUTION_IMAGESDIR, "evolution-contacts-mini.png"); - gnome_window_icon_set_from_file (GTK_WINDOW (e_contact_editor_im), icon_path); - g_free (icon_path); + /* set the icon */ + icon_list = e_icon_factory_get_icon_list ("stock_contact"); + if (icon_list) { + gtk_window_set_icon_list (GTK_WINDOW (e_contact_editor_im), icon_list); + g_list_foreach (icon_list, (GFunc) g_object_unref, NULL); + g_list_free (icon_list); + } } void -- cgit v1.2.3