aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorDevashish Sharma <dsharma@src.gnome.org>2006-02-23 12:52:22 +0800
committerDevashish Sharma <dsharma@src.gnome.org>2006-02-23 12:52:22 +0800
commit24bf0218e8f93e904e0f8d0285806fc1506cbbb3 (patch)
tree1ce2820253b6e8b44ff1a5fab598e80b424aa5bf /addressbook/gui
parentfebbaf9d0562534aa676226de1138a7005d4d4c5 (diff)
downloadgsoc2013-evolution-24bf0218e8f93e904e0f8d0285806fc1506cbbb3.tar.gz
gsoc2013-evolution-24bf0218e8f93e904e0f8d0285806fc1506cbbb3.tar.zst
gsoc2013-evolution-24bf0218e8f93e904e0f8d0285806fc1506cbbb3.zip
New->Contact should create contact on selected addressbook.
svn path=/trunk/; revision=31566
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/component/addressbook-component.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/addressbook/gui/component/addressbook-component.c b/addressbook/gui/component/addressbook-component.c
index 476220afed..ad99d22fc9 100644
--- a/addressbook/gui/component/addressbook-component.c
+++ b/addressbook/gui/component/addressbook-component.c
@@ -283,6 +283,9 @@ impl_requestCreateItem (PortableServer_Servant servant,
CORBA_Environment *ev)
{
EBook *book;
+ GConfClient *gconf_client;
+ ESourceList *source_list;
+ char *uid;
if (!item_type_name ||
(strcmp (item_type_name, "address_book") &&
@@ -297,7 +300,28 @@ impl_requestCreateItem (PortableServer_Servant servant,
return;
}
- book = e_book_new_default_addressbook (NULL);
+ gconf_client = gconf_client_get_default();
+ uid = gconf_client_get_string (gconf_client, "/apps/evolution/addressbook/display/primary_addressbook",
+ NULL);
+ g_object_unref (gconf_client);
+ if (!e_book_get_addressbooks (&source_list, NULL)) {
+ g_warning ("Could not get addressbook source list from GConf!");
+ return;
+ }
+ if (uid) {
+ ESource *source = e_source_list_peek_source_by_uid(source_list, uid);
+ if (source) {
+ book = e_book_new (source, NULL);
+ }
+ else {
+ book = e_book_new_default_addressbook (NULL);
+ }
+ g_free (uid);
+ }
+ else {
+ book = e_book_new_default_addressbook (NULL);
+ }
+
e_book_async_open (book, FALSE, book_loaded_cb, g_strdup (item_type_name));
}