aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-07-10 00:03:39 +0800
committerChris Lahey <clahey@src.gnome.org>2000-07-10 00:03:39 +0800
commit36c3c3cf936008c0c0f8b85605f4970f395b3fb7 (patch)
tree90f95f5cd18b2c9f764a6ca85c48cef56e46c949 /addressbook/backend
parenta9cc8f7c2dbf8f5282cc287ae8d20bb586dd8702 (diff)
downloadgsoc2013-evolution-36c3c3cf936008c0c0f8b85605f4970f395b3fb7.tar
gsoc2013-evolution-36c3c3cf936008c0c0f8b85605f4970f395b3fb7.tar.gz
gsoc2013-evolution-36c3c3cf936008c0c0f8b85605f4970f395b3fb7.tar.bz2
gsoc2013-evolution-36c3c3cf936008c0c0f8b85605f4970f395b3fb7.tar.lz
gsoc2013-evolution-36c3c3cf936008c0c0f8b85605f4970f395b3fb7.tar.xz
gsoc2013-evolution-36c3c3cf936008c0c0f8b85605f4970f395b3fb7.tar.zst
gsoc2013-evolution-36c3c3cf936008c0c0f8b85605f4970f395b3fb7.zip
Added a field that gives the name if it exists and the company name
2000-07-09 Christopher James Lahey <clahey@helixcode.com> * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h: Added a field that gives the name if it exists and the company name otherwise. * gui/component/e-addressbook-model.c: Formatting changes. * gui/component/select-names/e-select-names-table-model.c: Added stripping of names and display of company name if name doesn't exist. * gui/component/select-names/e-select-names.c: Fixed up the display so that we display both name and email address. svn path=/trunk/; revision=4020
Diffstat (limited to 'addressbook/backend')
-rw-r--r--addressbook/backend/ebook/e-card-simple.c21
-rw-r--r--addressbook/backend/ebook/e-card-simple.h1
2 files changed, 22 insertions, 0 deletions
diff --git a/addressbook/backend/ebook/e-card-simple.c b/addressbook/backend/ebook/e-card-simple.c
index cc3ff416ce..ddad7249dd 100644
--- a/addressbook/backend/ebook/e-card-simple.c
+++ b/addressbook/backend/ebook/e-card-simple.c
@@ -58,6 +58,7 @@ enum _ECardSimpleInternalType {
E_CARD_SIMPLE_INTERNAL_TYPE_ADDRESS,
E_CARD_SIMPLE_INTERNAL_TYPE_PHONE,
E_CARD_SIMPLE_INTERNAL_TYPE_EMAIL,
+ E_CARD_SIMPLE_INTERNAL_TYPE_SPECIAL,
};
struct _ECardSimpleFieldData {
@@ -108,6 +109,7 @@ static ECardSimpleFieldData field_data[] =
{ E_CARD_SIMPLE_FIELD_ANNIVERSARY, "anniversary", "Anniversary", "Anniv", 0, E_CARD_SIMPLE_INTERNAL_TYPE_DATE },
{ E_CARD_SIMPLE_FIELD_BIRTH_DATE, "birth_date", "Birth Date", "", 0, E_CARD_SIMPLE_INTERNAL_TYPE_DATE },
{ E_CARD_SIMPLE_FIELD_MAILER, "mailer", "", "", 0, E_CARD_SIMPLE_INTERNAL_TYPE_STRING },
+ { E_CARD_SIMPLE_FIELD_NAME_OR_ORG, "nameororg", "", "", 0, E_CARD_SIMPLE_INTERNAL_TYPE_SPECIAL },
};
static void e_card_simple_init (ECardSimple *simple);
@@ -904,6 +906,19 @@ char *e_card_simple_get (ECardSimple *simple,
string = e_card_simple_get_email(simple,
field_data[field].list_type_index);
return g_strdup(string);
+ case E_CARD_SIMPLE_INTERNAL_TYPE_SPECIAL:
+ switch (field) {
+ case E_CARD_SIMPLE_FIELD_NAME_OR_ORG:
+ gtk_object_get(GTK_OBJECT(simple->card),
+ "full_name", &string,
+ NULL);
+ if (string && *string)
+ return g_strdup(string);
+ gtk_object_get(GTK_OBJECT(simple->card),
+ "org", &string,
+ NULL);
+ return g_strdup(string);
+ }
default:
return NULL;
}
@@ -1080,6 +1095,8 @@ void e_card_simple_set (ECardSimple *simple,
field_data[field].list_type_index,
data);
break;
+ case E_CARD_SIMPLE_INTERNAL_TYPE_SPECIAL:
+ break;
}
break;
}
@@ -1096,8 +1113,12 @@ ECardSimpleType e_card_simple_type (ECardSimple *simple,
case E_CARD_SIMPLE_INTERNAL_TYPE_EMAIL:
default:
return E_CARD_SIMPLE_TYPE_STRING;
+
case E_CARD_SIMPLE_INTERNAL_TYPE_DATE:
return E_CARD_SIMPLE_TYPE_DATE;
+
+ case E_CARD_SIMPLE_INTERNAL_TYPE_SPECIAL:
+ return E_CARD_SIMPLE_TYPE_STRING;
}
}
diff --git a/addressbook/backend/ebook/e-card-simple.h b/addressbook/backend/ebook/e-card-simple.h
index 7e2be4b728..2d3b1cb4f4 100644
--- a/addressbook/backend/ebook/e-card-simple.h
+++ b/addressbook/backend/ebook/e-card-simple.h
@@ -111,6 +111,7 @@ enum _ECardSimpleField {
E_CARD_SIMPLE_FIELD_ANNIVERSARY,
E_CARD_SIMPLE_FIELD_BIRTH_DATE,
E_CARD_SIMPLE_FIELD_MAILER,
+ E_CARD_SIMPLE_FIELD_NAME_OR_ORG,
E_CARD_SIMPLE_FIELD_LAST
};