From c35cccb170c74c3656ce0981b7e6376d712fca5b Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 9 Apr 2004 15:51:36 +0000 Subject: create an EUserCreatableItemsHandler (addressbook_view_clear): destroy it * gui/component/addressbook.c (addressbook_new_control): create an EUserCreatableItemsHandler (addressbook_view_clear): destroy it (control_activate): Activate it * gui/component/addressbook-component.c (impl__get_userCreatableItems): Add object/folder flags to the creatable items. Rename "Address Book" to "Contacts Group" per new specs svn path=/trunk/; revision=25381 --- addressbook/gui/component/addressbook-component.c | 11 +++++++---- addressbook/gui/component/addressbook.c | 11 +++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) (limited to 'addressbook/gui') diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c index b066b94b3e..17da13b43e 100644 --- a/addressbook/gui/component/addressbook-component.c +++ b/addressbook/gui/component/addressbook-component.c @@ -553,6 +553,7 @@ impl__get_userCreatableItems (PortableServer_Servant servant, list->_buffer[0].tooltip = _("Create a new contact"); list->_buffer[0].menuShortcut = 'c'; list->_buffer[0].iconName = "evolution-contacts-mini.png"; + list->_buffer[0].type = GNOME_Evolution_CREATABLE_OBJECT; list->_buffer[1].id = "contact_list"; list->_buffer[1].description = _("New Contact List"); @@ -560,13 +561,15 @@ impl__get_userCreatableItems (PortableServer_Servant servant, list->_buffer[1].tooltip = _("Create a new contact list"); list->_buffer[1].menuShortcut = 'l'; list->_buffer[1].iconName = "contact-list-16.png"; + list->_buffer[1].type = GNOME_Evolution_CREATABLE_OBJECT; list->_buffer[2].id = "address_book"; - list->_buffer[2].description = _("New Addressbook Book"); - list->_buffer[2].menuDescription = _("_Address Book"); - list->_buffer[2].tooltip = _("Create a new address book"); - list->_buffer[2].menuShortcut = 'a'; + list->_buffer[2].description = _("New Contacts Group"); + list->_buffer[2].menuDescription = _("_Contacts Group"); + list->_buffer[2].tooltip = _("Create a new contacts group"); + list->_buffer[2].menuShortcut = 'g'; list->_buffer[2].iconName = "evolution-contacts-mini.png"; + list->_buffer[2].type = GNOME_Evolution_CREATABLE_FOLDER; return list; } diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c index a698094a94..6de2d8d921 100644 --- a/addressbook/gui/component/addressbook.c +++ b/addressbook/gui/component/addressbook.c @@ -39,6 +39,7 @@ #include #include "e-util/e-passwords.h" +#include "shell/e-user-creatable-items-handler.h" #include "evolution-shell-component-utils.h" #include "e-activity-handler.h" @@ -76,6 +77,7 @@ typedef struct { BonoboPropertyBag *properties; ESourceList *source_list; char *passwd; + EUserCreatableItemsHandler *creatable_items_handler; } AddressbookView; static void addressbook_view_ref (AddressbookView *); @@ -458,6 +460,8 @@ control_activate (BonoboControl *control, e_pixmaps_update (uic, pixmaps); + e_user_creatable_items_handler_activate (view->creatable_items_handler, uic); + bonobo_ui_component_thaw (uic, NULL); if (v) @@ -554,6 +558,11 @@ addressbook_view_clear (AddressbookView *view) g_hash_table_destroy (view->uid_to_view); view->uid_to_view = NULL; } + + if (view->creatable_items_handler) { + g_object_unref (view->creatable_items_handler); + view->creatable_items_handler = NULL; + } } static void @@ -1126,6 +1135,8 @@ addressbook_new_control (void) "changed", G_CALLBACK (source_list_changed_cb), view); + view->creatable_items_handler = e_user_creatable_items_handler_new ("contacts"); + g_signal_connect (view->control, "activate", G_CALLBACK (control_activate_cb), view); -- cgit v1.2.3