aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/addressbook-component.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2004-03-31 07:21:34 +0800
committerChris Toshok <toshok@src.gnome.org>2004-03-31 07:21:34 +0800
commit3c310a60ee2720d520f1da2a7a911ad4f8c0d2d2 (patch)
treecd968b3b8fc986238f70b2cdfac8f27dcb946262 /addressbook/gui/component/addressbook-component.c
parentf4dc650dceb55c89ca497ab6ffa844daa51a96b4 (diff)
downloadgsoc2013-evolution-3c310a60ee2720d520f1da2a7a911ad4f8c0d2d2.tar.gz
gsoc2013-evolution-3c310a60ee2720d520f1da2a7a911ad4f8c0d2d2.tar.zst
gsoc2013-evolution-3c310a60ee2720d520f1da2a7a911ad4f8c0d2d2.zip
[ fixes bug #53544 ]
2004-03-30 Chris Toshok <toshok@ximian.com> [ fixes bug #53544 ] * gui/component/addressbook-component.c (impl__get_userCreatableItems): add "address_book" to the user creatable items list. complete with incorrect accelerator and shortcut! (impl_requestCreateItem): handle "address_book" here, and plug a memory leak. svn path=/trunk/; revision=25253
Diffstat (limited to 'addressbook/gui/component/addressbook-component.c')
-rw-r--r--addressbook/gui/component/addressbook-component.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c
index 429a991134..b066b94b3e 100644
--- a/addressbook/gui/component/addressbook-component.c
+++ b/addressbook/gui/component/addressbook-component.c
@@ -541,7 +541,7 @@ impl__get_userCreatableItems (PortableServer_Servant servant,
{
GNOME_Evolution_CreatableItemTypeList *list = GNOME_Evolution_CreatableItemTypeList__alloc ();
- list->_length = 2;
+ list->_length = 3;
list->_maximum = list->_length;
list->_buffer = GNOME_Evolution_CreatableItemTypeList_allocbuf (list->_length);
@@ -561,6 +561,13 @@ impl__get_userCreatableItems (PortableServer_Servant servant,
list->_buffer[1].menuShortcut = 'l';
list->_buffer[1].iconName = "contact-list-16.png";
+ 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].iconName = "evolution-contacts-mini.png";
+
return list;
}
@@ -572,12 +579,17 @@ impl_requestCreateItem (PortableServer_Servant servant,
AddressbookComponent *addressbook_component = ADDRESSBOOK_COMPONENT (bonobo_object_from_servant (servant));
AddressbookComponentPrivate *priv;
EBook *book;
- EContact *contact = e_contact_new ();
+ EContact *contact;
ESource *selected_source;
gchar *uri;
priv = addressbook_component->priv;
+ if (!strcmp (item_type_name, "address_book")) {
+ addressbook_config_create_new_source (NULL);
+ return;
+ }
+
selected_source = get_primary_source (addressbook_component);
if (!selected_source) {
CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_GNOME_Evolution_Component_Failed, NULL);
@@ -602,11 +614,14 @@ impl_requestCreateItem (PortableServer_Servant servant,
if (!item_type_name) {
CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_GNOME_Evolution_Component_UnknownType, NULL);
- } else if (!strcmp (item_type_name, "contact")) {
+ }
+ else if (!strcmp (item_type_name, "contact")) {
eab_show_contact_editor (book, contact, TRUE, TRUE);
- } else if (!strcmp (item_type_name, "contact_list")) {
+ }
+ else if (!strcmp (item_type_name, "contact_list")) {
eab_show_contact_list_editor (book, contact, TRUE, TRUE);
- } else {
+ }
+ else {
CORBA_exception_set (ev, CORBA_USER_EXCEPTION, ex_GNOME_Evolution_Component_UnknownType, NULL);
}