aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/addressbook-view.c
diff options
context:
space:
mode:
authorVeerapuram Varadhan <vvaradan@src.gnome.org>2005-07-11 21:34:53 +0800
committerVeerapuram Varadhan <vvaradan@src.gnome.org>2005-07-11 21:34:53 +0800
commit417c14c253d7aab254fb554ee78c9dc824fb8efa (patch)
tree5ae5be6dad00c4f0276e796a7b59a13067c05bfe /addressbook/gui/component/addressbook-view.c
parent619bc50ccd1d7c1d994abb70a7f0db413f3285e0 (diff)
downloadgsoc2013-evolution-417c14c253d7aab254fb554ee78c9dc824fb8efa.tar
gsoc2013-evolution-417c14c253d7aab254fb554ee78c9dc824fb8efa.tar.gz
gsoc2013-evolution-417c14c253d7aab254fb554ee78c9dc824fb8efa.tar.bz2
gsoc2013-evolution-417c14c253d7aab254fb554ee78c9dc824fb8efa.tar.lz
gsoc2013-evolution-417c14c253d7aab254fb554ee78c9dc824fb8efa.tar.xz
gsoc2013-evolution-417c14c253d7aab254fb554ee78c9dc824fb8efa.tar.zst
gsoc2013-evolution-417c14c253d7aab254fb554ee78c9dc824fb8efa.zip
// uris. Also, opens a contact in the editor if the contact-uid in the url
* Implementation to handle contacts:// uris. * Also, opens a contact in the editor if the contact-uid in the url is valid. svn path=/trunk/; revision=29719
Diffstat (limited to 'addressbook/gui/component/addressbook-view.c')
-rw-r--r--addressbook/gui/component/addressbook-view.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/addressbook/gui/component/addressbook-view.c b/addressbook/gui/component/addressbook-view.c
index 87d25df125..78d44d83c9 100644
--- a/addressbook/gui/component/addressbook-view.c
+++ b/addressbook/gui/component/addressbook-view.c
@@ -1405,3 +1405,42 @@ addressbook_view_peek_folder_view (AddressbookView *view)
return view->priv->folder_view_control;
}
+
+void
+addressbook_view_edit_contact (AddressbookView* view,
+ const char* source_uid,
+ const char* contact_uid)
+{
+ AddressbookViewPrivate *priv = view->priv;
+
+ ESource* source = NULL;
+ EContact* contact = NULL;
+ EBook* book = NULL;
+
+ if (!source_uid || !contact_uid)
+ return;
+
+ source = e_source_list_peek_source_by_uid (priv->source_list, source_uid);
+ if (!source)
+ return;
+
+ /* FIXME: Can I unref this book? */
+ book = e_book_new (source, NULL);
+ if (!book)
+ return;
+
+ if (!e_book_open (book, TRUE, NULL)) {
+ g_object_unref (book);
+ return;
+ }
+
+ e_book_get_contact (book, contact_uid, &contact, NULL);
+
+ if (!contact) {
+ g_object_unref (book);
+ return;
+ }
+ eab_show_contact_editor (book, contact, FALSE, FALSE);
+ g_object_unref (contact);
+ g_object_unref (book);
+}