diff options
author | Milan Crha <mcrha@redhat.com> | 2009-10-16 02:34:29 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2009-10-16 02:34:29 +0800 |
commit | d6034ed7fe206a9f98155305415d66b4f5f92dde (patch) | |
tree | 69c24e54e60cf48ffcdc365a092b71207723cfb9 /addressbook/gui/contact-editor | |
parent | 75887d8cde2c3d372fc402623fd7b1ee14526c5a (diff) | |
download | gsoc2013-evolution-d6034ed7fe206a9f98155305415d66b4f5f92dde.tar gsoc2013-evolution-d6034ed7fe206a9f98155305415d66b4f5f92dde.tar.gz gsoc2013-evolution-d6034ed7fe206a9f98155305415d66b4f5f92dde.tar.bz2 gsoc2013-evolution-d6034ed7fe206a9f98155305415d66b4f5f92dde.tar.lz gsoc2013-evolution-d6034ed7fe206a9f98155305415d66b4f5f92dde.tar.xz gsoc2013-evolution-d6034ed7fe206a9f98155305415d66b4f5f92dde.tar.zst gsoc2013-evolution-d6034ed7fe206a9f98155305415d66b4f5f92dde.zip |
Bug #565306 - "Edit Full" in "Add to address book" searches first
Diffstat (limited to 'addressbook/gui/contact-editor')
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-quick-add.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c index 5288ab009d..6c134192cd 100644 --- a/addressbook/gui/contact-editor/e-contact-quick-add.c +++ b/addressbook/gui/contact-editor/e-contact-quick-add.c @@ -183,26 +183,33 @@ editor_closed_cb (GtkWidget *w, gpointer closure) } static void -ce_have_book (EBook *book, EBookStatus status, gpointer closure) +ce_have_contact (EBook *book, EBookStatus status, EContact *contact, gpointer closure) { QuickAdd *qa = (QuickAdd *) closure; if (status != E_BOOK_ERROR_OK) { if (book) g_object_unref (book); - g_warning ("Couldn't open local address book."); + g_warning ("Failed to find contact, status %d.", status); quick_add_unref (qa); } else { EShell *shell; EABEditor *contact_editor; + if (contact) { + /* use found contact */ + if (qa->contact) + g_object_unref (qa->contact); + qa->contact = g_object_ref (contact); + } + shell = e_shell_get_default (); contact_editor = e_contact_editor_new ( shell, book, qa->contact, TRUE, TRUE /* XXX */); /* mark it as changed so the Save buttons are enabled when we bring up the dialog. */ g_object_set (contact_editor, - "changed", TRUE, + "changed", contact != NULL, NULL); /* We pass this via object data, so that we don't get a dangling pointer referenced if both @@ -225,6 +232,21 @@ ce_have_book (EBook *book, EBookStatus status, gpointer closure) } static void +ce_have_book (EBook *book, EBookStatus status, gpointer closure) +{ + QuickAdd *qa = (QuickAdd *) closure; + + if (status != E_BOOK_ERROR_OK) { + if (book) + g_object_unref (book); + g_warning ("Couldn't open local address book."); + quick_add_unref (qa); + } else { + eab_merging_book_find_contact (book, qa->contact, ce_have_contact, qa); + } +} + +static void edit_contact (QuickAdd *qa) { addressbook_load (qa->book, ce_have_book, qa); |