|
2010-05-28
, 21:24
|
|
Posts: 3,790 |
Thanked: 5,718 times |
Joined on Mar 2006
@ Vienna, Austria
|
#2
|
|
2010-06-03
, 17:26
|
Posts: 29 |
Thanked: 7 times |
Joined on May 2010
@ Frankfurt, Germany
|
#3
|
/* gcc -Wall --std=gnu99 setmyinfo.c -o setmyinfo $(pkg-config --cflags --libs libosso-abook-1.0) $(pkg-config --cflags --libs glib-2.0) */ #include <glib/glist.h> #include <libosso-abook/osso-abook.h> int main(int argc, char** argv) { osso_context_t *osso_cxt = osso_initialize (argv[0], "1.0", FALSE, NULL); osso_abook_init (&argc, &argv, osso_cxt); GtkWidget *chooser; GList *selection; chooser = osso_abook_contact_chooser_new (NULL, "Choose a contact to use for 'My information'"); gtk_dialog_run (GTK_DIALOG (chooser)); gtk_widget_hide (chooser); selection = osso_abook_contact_chooser_get_selection (OSSO_ABOOK_CONTACT_CHOOSER (chooser)); if (selection) { // GList *l = selection; OssoABookContact *mergewith = selection->data; // g_printf ("%s\n", osso_abook_contact_get_display_name(selection->data)); OssoABookSelfContact *myself = osso_abook_self_contact_get_default(); OssoABookContact *myinfo = OSSO_ABOOK_CONTACT(myself); osso_abook_contact_reset(myinfo, mergewith); osso_abook_contact_commit(myinfo,0,NULL,NULL); } else { // g_printf ("Nothing selected\n"); } g_list_free (selection); gtk_widget_destroy (chooser); osso_deinitialize (osso_cxt); exit(0); }
If using an existing contacts entry is not possible, maybe someone could point out to me where 'my information' is stored, so I can try to find a workaround?
Thanks in advance!
Manuel