aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-05-08 08:27:11 +0800
committerChris Lahey <clahey@src.gnome.org>2000-05-08 08:27:11 +0800
commiteb3a1331f1f6a5ac79133176631a83b5bc0dac18 (patch)
tree765850d5de9158e9b15a30e8fad716b28ab8d980 /addressbook/gui
parent0dabeb5908d978a1674fb276d5408e09a4ef4d4d (diff)
downloadgsoc2013-evolution-eb3a1331f1f6a5ac79133176631a83b5bc0dac18.tar
gsoc2013-evolution-eb3a1331f1f6a5ac79133176631a83b5bc0dac18.tar.gz
gsoc2013-evolution-eb3a1331f1f6a5ac79133176631a83b5bc0dac18.tar.bz2
gsoc2013-evolution-eb3a1331f1f6a5ac79133176631a83b5bc0dac18.tar.lz
gsoc2013-evolution-eb3a1331f1f6a5ac79133176631a83b5bc0dac18.tar.xz
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')
-rw-r--r--addressbook/gui/minicard/e-minicard.c45
-rw-r--r--addressbook/gui/widgets/e-minicard.c45
2 files changed, 90 insertions, 0 deletions
diff --git a/addressbook/gui/minicard/e-minicard.c b/addressbook/gui/minicard/e-minicard.c
index b75d1779d4..6173ee2c9a 100644
--- a/addressbook/gui/minicard/e-minicard.c
+++ b/addressbook/gui/minicard/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));
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));