diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-10-01 05:44:57 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-10-01 05:44:57 +0800 |
commit | 711bef6798d08dcb34bc83730f11575ffa411d07 (patch) | |
tree | d2df186e3ceab302d133faa02ef654365d0a6af2 | |
parent | 0ff98664ba2f06f71508288247b3b25ffb7f8f47 (diff) | |
download | gsoc2013-evolution-711bef6798d08dcb34bc83730f11575ffa411d07.tar gsoc2013-evolution-711bef6798d08dcb34bc83730f11575ffa411d07.tar.gz gsoc2013-evolution-711bef6798d08dcb34bc83730f11575ffa411d07.tar.bz2 gsoc2013-evolution-711bef6798d08dcb34bc83730f11575ffa411d07.tar.lz gsoc2013-evolution-711bef6798d08dcb34bc83730f11575ffa411d07.tar.xz gsoc2013-evolution-711bef6798d08dcb34bc83730f11575ffa411d07.tar.zst gsoc2013-evolution-711bef6798d08dcb34bc83730f11575ffa411d07.zip |
Made it so that minicard doesn't write out changes to the backend unless
Fri Sep 29 07:33:54 2000 Christopher James Lahey <clahey@helixcode.com>
* gui/widgets/e-minicard.c, gui/widgets/e-minicard.h: Made it so
that minicard doesn't write out changes to the backend unless
something's actually changed.
svn path=/trunk/; revision=5647
-rw-r--r-- | addressbook/ChangeLog | 6 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard.c | 56 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard.h | 2 |
3 files changed, 40 insertions, 24 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 196aacf24c..976f7eecae 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,9 @@ +Fri Sep 29 07:33:54 2000 Christopher James Lahey <clahey@helixcode.com> + + * gui/widgets/e-minicard.c, gui/widgets/e-minicard.h: Made it so + that minicard doesn't write out changes to the backend unless + something's actually changed. + Tue Sep 26 16:28:47 2000 Christopher James Lahey <clahey@helixcode.com> * backend/ebook/e-card.c: Make sure that card->name and diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index dcf3ff924a..c57e7adde7 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -133,17 +133,19 @@ e_minicard_class_init (EMinicardClass *klass) static void e_minicard_init (EMinicard *minicard) { - /* minicard->card = NULL;*/ - minicard->rect = NULL; - minicard->fields = NULL; - minicard->width = 10; - minicard->height = 10; - minicard->has_focus = FALSE; + /* minicard->card = NULL;*/ + minicard->rect = NULL; + minicard->fields = NULL; + minicard->width = 10; + minicard->height = 10; + minicard->has_focus = FALSE; - minicard->card = NULL; - minicard->simple = e_card_simple_new(NULL); + minicard->card = NULL; + minicard->simple = e_card_simple_new(NULL); - e_canvas_item_set_reflow_callback(GNOME_CANVAS_ITEM(minicard), e_minicard_reflow); + minicard->changed = FALSE; + + e_canvas_item_set_reflow_callback(GNOME_CANVAS_ITEM(minicard), e_minicard_reflow); } static void @@ -191,6 +193,7 @@ e_minicard_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) NULL); remodel(e_minicard); e_canvas_item_request_reflow(item); + e_minicard->changed = FALSE; break; } } @@ -425,27 +428,31 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event) e_minicard->has_focus = TRUE; } else { EBook *book = NULL; + + if (e_minicard->changed) { - e_card_simple_sync_card(e_minicard->simple); + e_card_simple_sync_card(e_minicard->simple); - if (E_IS_MINICARD_VIEW(GNOME_CANVAS_ITEM(e_minicard)->parent)) { + if (E_IS_MINICARD_VIEW(GNOME_CANVAS_ITEM(e_minicard)->parent)) { - gtk_object_get(GTK_OBJECT(GNOME_CANVAS_ITEM(e_minicard)->parent), - "book", &book, - NULL); + gtk_object_get(GTK_OBJECT(GNOME_CANVAS_ITEM(e_minicard)->parent), + "book", &book, + NULL); - } + } - if (book) { + if (book) { - /* Add the card in the contact editor to our ebook */ - e_book_commit_card (book, - e_minicard->card, - card_changed_cb, - NULL); - } else { - remodel(e_minicard); - e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(e_minicard)); + /* Add the card in the contact editor to our ebook */ + e_book_commit_card (book, + e_minicard->card, + card_changed_cb, + NULL); + } else { + remodel(e_minicard); + e_canvas_item_request_reflow(GNOME_CANVAS_ITEM(e_minicard)); + } + e_minicard->changed = FALSE; } gnome_canvas_item_set( e_minicard->rect, @@ -581,6 +588,7 @@ field_changed (EText *text, EMinicard *e_minicard) type, string); g_free(string); + e_minicard->changed = TRUE; } static void diff --git a/addressbook/gui/widgets/e-minicard.h b/addressbook/gui/widgets/e-minicard.h index 33a20b40ec..a0272ee58b 100644 --- a/addressbook/gui/widgets/e-minicard.h +++ b/addressbook/gui/widgets/e-minicard.h @@ -71,6 +71,8 @@ struct _EMinicard GList *fields; /* Of type EMinicardField */ guint needs_remodeling : 1; + + guint changed : 1; gboolean has_focus; |