diff options
-rw-r--r-- | addressbook/ChangeLog | 9 | ||||
-rw-r--r-- | addressbook/gui/component/Makefile.am | 3 | ||||
-rw-r--r-- | addressbook/gui/component/addressbook-component.c | 43 |
3 files changed, 48 insertions, 7 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index e5b942029b..a46e0b2448 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,12 @@ +2002-02-21 Ettore Perazzoli <ettore@ximian.com> + + * gui/component/Makefile.am: Define $(iconsdir). + + * gui/component/addressbook-component.c (add_creatable_item): New + helper function. + (create_component): Add the icons for the user creatable items as + well. + 2002-02-20 Chris Toshok <toshok@ximian.com> * backend/pas/pas-backend-file.c (pas_backend_file_load_uri): diff --git a/addressbook/gui/component/Makefile.am b/addressbook/gui/component/Makefile.am index 0916f75f98..c68aa8fd63 100644 --- a/addressbook/gui/component/Makefile.am +++ b/addressbook/gui/component/Makefile.am @@ -21,7 +21,6 @@ INCLUDES = \ -DEVOLUTION_IMAGESDIR=\""$(datadir)"/images/evolution\" \ $(EVOLUTION_ADDRESSBOOK_CFLAGS) - bin_PROGRAMS = \ evolution-addressbook @@ -73,6 +72,8 @@ oaf_DATA = $(oaf_in_files:.oaf.in=.oaf) gladedir = $(datadir)/evolution/glade glade_DATA = addressbook-config.glade +iconsdir = $(datadir)/images/evolution + EXTRA_DIST = \ $(glade_DATA) \ $(oaf_DATA) \ diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c index 766d655b39..7ff0f05770 100644 --- a/addressbook/gui/component/addressbook-component.c +++ b/addressbook/gui/component/addressbook-component.c @@ -503,6 +503,37 @@ destination_folder_handle_drop (EvolutionShellComponentDndDestinationFolder *fol /* The factory function. */ +static void +add_creatable_item (EvolutionShellComponent *shell_component, + const char *id, + const char *description, + const char *menu_description, + char menu_shortcut, + const char *icon_name) +{ + char *icon_path; + GdkPixbuf *icon; + + if (icon_name == NULL) { + icon_path = NULL; + icon = NULL; + } else { + icon_path = g_concat_dir_and_file (EVOLUTION_ICONSDIR, icon_name); + icon = gdk_pixbuf_new_from_file (icon_path); + } + + evolution_shell_component_add_user_creatable_item (shell_component, + id, + description, + menu_description, + menu_shortcut, + icon); + + if (icon != NULL) + gdk_pixbuf_unref (icon); + g_free (icon_path); +} + static BonoboObject * create_component (void) { @@ -523,12 +554,12 @@ create_component (void) bonobo_object_add_interface (BONOBO_OBJECT (shell_component), BONOBO_OBJECT (destination_interface)); - evolution_shell_component_add_user_creatable_item (shell_component, "contact", - _("New Contact"), _("_Contact"), 'c', - NULL); - evolution_shell_component_add_user_creatable_item (shell_component, "contact_list", - _("New Contact List"), _("Contact _List"), 'l', - NULL); + add_creatable_item (shell_component, "contact", + _("New Contact"), _("_Contact"), 'c', + "evolution-contacts-mini.png"); + add_creatable_item (shell_component, "contact_list", + _("New Contact List"), _("Contact _List"), 'l', + "all_contacts.xpm"); gtk_signal_connect (GTK_OBJECT (shell_component), "owner_set", GTK_SIGNAL_FUNC (owner_set_cb), NULL); |