From eca83b21db88e5d9e9ac712bd566942c8b2ff00a Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Sun, 4 Mar 2001 09:55:49 +0000 Subject: Cleaned up the formatting in this file a bit. 2001-03-04 Christopher James Lahey * backend/ebook/e-card-simple.c: Cleaned up the formatting in this file a bit. * contact-editor/e-contact-editor.c (e_contact_editor_set_arg): Made it so that passing in NULL to the writable_fields arg sets the set of writable fields to the empty set. * gui/component/select-names/e-select-names-text-model.c (e_select_names_text_model_activate_obj): Pass NULL as the writable_fields argument here. * gui/widgets/e-addressbook-model.c: Don't offset by one here. This way we will get the file_as field as one of our ETableColumns. * gui/widgets/e-addressbook-view.c (SPEC): Updated this for the changes in ECardSimple. * gui/widgets/e-minicard.c (remodel): Don't remodel if the item isn't realized. svn path=/trunk/; revision=8538 --- addressbook/gui/widgets/e-addressbook-model.c | 10 ++-- addressbook/gui/widgets/e-addressbook-view.c | 70 +++++++++++++++------------ addressbook/gui/widgets/e-minicard.c | 2 + 3 files changed, 46 insertions(+), 36 deletions(-) (limited to 'addressbook/gui/widgets') diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c index c40c21f3bb..31443a65b3 100644 --- a/addressbook/gui/widgets/e-addressbook-model.c +++ b/addressbook/gui/widgets/e-addressbook-model.c @@ -90,7 +90,7 @@ addressbook_destroy(GtkObject *object) static int addressbook_col_count (ETableModel *etc) { - return E_CARD_SIMPLE_FIELD_LAST; + return E_CARD_SIMPLE_FIELD_LAST - 4; } /* This function returns the number of rows in our ETableModel. */ @@ -107,11 +107,11 @@ addressbook_value_at (ETableModel *etc, int col, int row) { EAddressbookModel *addressbook = E_ADDRESSBOOK_MODEL(etc); const char *value; - if ( col >= E_CARD_SIMPLE_FIELD_LAST - 1 || row >= addressbook->data_count ) + if ( col >= E_CARD_SIMPLE_FIELD_LAST || row >= addressbook->data_count ) return NULL; value = e_card_simple_get_const(addressbook->data[row], - col + 1); + col); return (void *)(value ? value : ""); } @@ -122,10 +122,10 @@ addressbook_set_value_at (ETableModel *etc, int col, int row, const void *val) EAddressbookModel *addressbook = E_ADDRESSBOOK_MODEL(etc); ECard *card; if (addressbook->editable) { - if ( col >= E_CARD_SIMPLE_FIELD_LAST - 1|| row >= addressbook->data_count ) + if ( col >= E_CARD_SIMPLE_FIELD_LAST|| row >= addressbook->data_count ) return; e_card_simple_set(addressbook->data[row], - col + 1, + col, val); gtk_object_get(GTK_OBJECT(addressbook->data[row]), "card", &card, diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index bc22ff65d6..b19d185d93 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -609,37 +609,45 @@ static char *list [] = { #define SPEC " \ \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ \ \ \ diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c index 22566ec749..f55999e140 100644 --- a/addressbook/gui/widgets/e-minicard.c +++ b/addressbook/gui/widgets/e-minicard.c @@ -809,6 +809,8 @@ static void remodel( EMinicard *e_minicard ) { int count = 0; + if ( !(GTK_OBJECT_FLAGS( e_minicard ) & GNOME_CANVAS_ITEM_REALIZED) ) + return; if (e_minicard->simple) { ECardSimpleField field; GList *list; -- cgit v1.2.3