diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-05-08 08:27:11 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-05-08 08:27:11 +0800 |
commit | eb3a1331f1f6a5ac79133176631a83b5bc0dac18 (patch) | |
tree | 765850d5de9158e9b15a30e8fad716b28ab8d980 /addressbook/gui/widgets/e-minicard.c | |
parent | 0dabeb5908d978a1674fb276d5408e09a4ef4d4d (diff) | |
download | gsoc2013-evolution-eb3a1331f1f6a5ac79133176631a83b5bc0dac18.tar.gz gsoc2013-evolution-eb3a1331f1f6a5ac79133176631a83b5bc0dac18.tar.zst gsoc2013-evolution-eb3a1331f1f6a5ac79133176631a83b5bc0dac18.zip |
Added saving in minicard view.
2000-05-08 Christopher James Lahey <clahey@helixcode.com>
* gui/minicard/e-minicard.c: Added saving in minicard view.
svn path=/trunk/; revision=2891
Diffstat (limited to 'addressbook/gui/widgets/e-minicard.c')
-rw-r--r-- | addressbook/gui/widgets/e-minicard.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index b75d1779d4..6173ee2c9a 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -452,6 +452,47 @@ field_changed (EText *text, EMinicard *e_minicard) } static void +field_activated (EText *text, EMinicard *e_minicard) +{ + EBook *book; + + e_card_simple_sync_card(e_minicard->simple); + + gtk_object_get(GTK_OBJECT(GNOME_CANVAS_ITEM(e_minicard)->parent), + "book", &book, + NULL); + + /* Add the card in the contact editor to our ebook */ + e_book_commit_card (book, + e_minicard->card, + card_changed_cb, + NULL); +} + +static void +field_event (EText *text, GdkEvent *event, EMinicard *e_minicard) +{ + switch (event->type) { + case GDK_FOCUS_CHANGE: + if (!((GdkEventFocus *)event)->in) { + EBook *book; + + e_card_simple_sync_card(e_minicard->simple); + + gtk_object_get(GTK_OBJECT(GNOME_CANVAS_ITEM(e_minicard)->parent), + "book", &book, + NULL); + + /* Add the card in the contact editor to our ebook */ + e_book_commit_card (book, + e_minicard->card, + card_changed_cb, + NULL); + } + } +} + +static void add_field (EMinicard *e_minicard, ECardSimpleField field) { GnomeCanvasItem *new_item; @@ -474,6 +515,10 @@ add_field (EMinicard *e_minicard, ECardSimpleField field) NULL ); gtk_signal_connect(GTK_OBJECT(E_MINICARD_LABEL(new_item)->field), "changed", GTK_SIGNAL_FUNC(field_changed), e_minicard); + gtk_signal_connect(GTK_OBJECT(E_MINICARD_LABEL(new_item)->field), + "activate", GTK_SIGNAL_FUNC(field_activated), e_minicard); + gtk_signal_connect(GTK_OBJECT(E_MINICARD_LABEL(new_item)->field), + "event", GTK_SIGNAL_FUNC(field_event), e_minicard); gtk_object_set_data(GTK_OBJECT(E_MINICARD_LABEL(new_item)->field), "EMinicard:field", GINT_TO_POINTER(field)); |