summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/contacteditor.cpp4
-rw-r--r--core/pim/addressbook/ocontactfields.cpp257
-rw-r--r--core/pim/addressbook/ocontactfields.h2
3 files changed, 176 insertions, 87 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp
index d830ad3..9efb8c0 100644
--- a/core/pim/addressbook/contacteditor.cpp
+++ b/core/pim/addressbook/contacteditor.cpp
@@ -551,2 +551,4 @@ void ContactEditor::init() {
551 QStringList::ConstIterator trit = trlDynamicEntries.begin(); 551 QStringList::ConstIterator trit = trlDynamicEntries.begin();
552 QMap<QString, int> mapStrToID = OContactFields::untrFieldsToId();
553 QMap<int, QString> mapIdToStr = OContactFields::idToTrFields();
552 for (i = counter; it != slDynamicEntries.end(); i++, ++it, ++trit) { 554 for (i = counter; it != slDynamicEntries.end(); i++, ++it, ++trit) {
@@ -556,3 +558,3 @@ void ContactEditor::init() {
556 558
557 l = new QLabel( (*it).utf8() , container ); 559 l = new QLabel( mapIdToStr[mapStrToID[*it]].utf8() , container );
558 listName.append( l ); 560 listName.append( l );
diff --git a/core/pim/addressbook/ocontactfields.cpp b/core/pim/addressbook/ocontactfields.cpp
index 75a7641..18b68c4 100644
--- a/core/pim/addressbook/ocontactfields.cpp
+++ b/core/pim/addressbook/ocontactfields.cpp
@@ -18,14 +18,15 @@ QStringList OContactFields::untrdetailsfields( bool sorted )
18 QStringList list; 18 QStringList list;
19 QMap<int, QString> mapIdToStr = idToUntrFields();
19 20
20 list.append( "Office" ); 21 list.append( mapIdToStr[ Qtopia::Office ] );
21 list.append( "Profession" ); 22 list.append( mapIdToStr[ Qtopia::Profession ] );
22 list.append( "Assistant" ); 23 list.append( mapIdToStr[ Qtopia::Assistant ] );
23 list.append( "Manager" ); 24 list.append( mapIdToStr[ Qtopia::Manager ] );
24 25
25 list.append( "Spouse" ); 26 list.append( mapIdToStr[ Qtopia::Spouse ] );
26 list.append( "Gender" ); 27 list.append( mapIdToStr[ Qtopia::Gender ] );
27 list.append( "Birthday" ); 28 list.append( mapIdToStr[ Qtopia::Birthday ] );
28 list.append( "Anniversary" ); 29 list.append( mapIdToStr[ Qtopia::Anniversary ] );
29 list.append( "Nickname" ); 30 list.append( mapIdToStr[ Qtopia::Nickname ] );
30 list.append( "Children" ); 31 list.append( mapIdToStr[ Qtopia::Children ] );
31 32
@@ -42,14 +43,15 @@ QStringList OContactFields::trdetailsfields( bool sorted )
42 QStringList list; 43 QStringList list;
44 QMap<int, QString> mapIdToStr = idToTrFields();
43 45
44 list.append( QObject::tr( "Office" ) ); 46 list.append( mapIdToStr[Qtopia::Office] );
45 list.append( QObject::tr( "Profession" ) ); 47 list.append( mapIdToStr[Qtopia::Profession] );
46 list.append( QObject::tr( "Assistant" ) ); 48 list.append( mapIdToStr[Qtopia::Assistant] );
47 list.append( QObject::tr( "Manager" ) ); 49 list.append( mapIdToStr[Qtopia::Manager] );
48 50
49 list.append( QObject::tr( "Spouse" ) ); 51 list.append( mapIdToStr[Qtopia::Spouse] );
50 list.append( QObject::tr( "Gender" ) ); 52 list.append( mapIdToStr[Qtopia::Gender] );
51 list.append( QObject::tr( "Birthday" ) ); 53 list.append( mapIdToStr[Qtopia::Birthday] );
52 list.append( QObject::tr( "Anniversary" ) ); 54 list.append( mapIdToStr[Qtopia::Anniversary] );
53 list.append( QObject::tr( "Nickname" ) ); 55 list.append( mapIdToStr[Qtopia::Nickname] );
54 list.append( QObject::tr( "Children" ) ); 56 list.append( mapIdToStr[Qtopia::Children] );
55 57
@@ -67,12 +69,14 @@ QStringList OContactFields::trphonefields( bool sorted )
67 QStringList list; 69 QStringList list;
68 list.append( QObject::tr( "Business Phone" ) ); 70 QMap<int, QString> mapIdToStr = idToTrFields();
69 list.append( QObject::tr( "Business Fax" ) );
70 list.append( QObject::tr( "Business Mobile" ) );
71 71
72 list.append( QObject::tr( "Default Email" ) ); 72 list.append( mapIdToStr[Qtopia::BusinessPhone] );
73 list.append( QObject::tr( "Emails" ) ); 73 list.append( mapIdToStr[Qtopia::BusinessFax] );
74 list.append( mapIdToStr[Qtopia::BusinessMobile] );
74 75
75 list.append( QObject::tr( "Home Phone" ) ); 76 list.append( mapIdToStr[Qtopia::DefaultEmail] );
76 list.append( QObject::tr( "Home Fax" ) ); 77 list.append( mapIdToStr[Qtopia::Emails] );
77 list.append( QObject::tr( "Home Mobile" ) ); 78
79 list.append( mapIdToStr[Qtopia::HomePhone] );
80 list.append( mapIdToStr[Qtopia::HomeFax] );
81 list.append( mapIdToStr[Qtopia::HomeMobile] );
78 82
@@ -91,13 +95,14 @@ QStringList OContactFields::untrphonefields( bool sorted )
91 QStringList list; 95 QStringList list;
96 QMap<int, QString> mapIdToStr = idToUntrFields();
92 97
93 list.append( "Business Phone" ); 98 list.append( mapIdToStr[ Qtopia::BusinessPhone ] );
94 list.append( "Business Fax" ); 99 list.append( mapIdToStr[ Qtopia::BusinessFax ] );
95 list.append( "Business Mobile" ); 100 list.append( mapIdToStr[ Qtopia::BusinessMobile ] );
96 101
97 list.append( "Default Email" ); 102 list.append( mapIdToStr[ Qtopia::DefaultEmail ] );
98 list.append( "Emails" ); 103 list.append( mapIdToStr[ Qtopia::Emails ] );
99 104
100 list.append( "Home Phone" ); 105 list.append( mapIdToStr[ Qtopia::HomePhone ] );
101 list.append( "Home Fax" ); 106 list.append( mapIdToStr[ Qtopia::HomeFax ] );
102 list.append( "Home Mobile" ); 107 list.append( mapIdToStr[ Qtopia::HomeMobile ] );
103 108
@@ -116,13 +121,14 @@ QStringList OContactFields::trfields( bool sorted )
116 QStringList list; 121 QStringList list;
122 QMap<int, QString> mapIdToStr = idToTrFields();
117 123
118 list.append( QObject::tr( "Name Title") ); 124 list.append( mapIdToStr[Qtopia::Title]);
119 list.append( QObject::tr( "First Name" ) ); 125 list.append( mapIdToStr[Qtopia::FirstName] );
120 list.append( QObject::tr( "Middle Name" ) ); 126 list.append( mapIdToStr[Qtopia::MiddleName] );
121 list.append( QObject::tr( "Last Name" ) ); 127 list.append( mapIdToStr[Qtopia::LastName] );
122 list.append( QObject::tr( "Suffix" ) ); 128 list.append( mapIdToStr[Qtopia::Suffix] );
123 list.append( QObject::tr( "File As" ) ); 129 list.append( mapIdToStr[Qtopia::FileAs] );
124 130
125 list.append( QObject::tr( "Job Title" ) ); 131 list.append( mapIdToStr[Qtopia::JobTitle] );
126 list.append( QObject::tr( "Department" ) ); 132 list.append( mapIdToStr[Qtopia::Department] );
127 list.append( QObject::tr( "Company" ) ); 133 list.append( mapIdToStr[Qtopia::Company] );
128 134
@@ -130,16 +136,16 @@ QStringList OContactFields::trfields( bool sorted )
130 136
131 list.append( QObject::tr( "Business Street" ) ); 137 list.append( mapIdToStr[Qtopia::BusinessStreet] );
132 list.append( QObject::tr( "Business City" ) ); 138 list.append( mapIdToStr[Qtopia::BusinessCity] );
133 list.append( QObject::tr( "Business State" ) ); 139 list.append( mapIdToStr[Qtopia::BusinessState] );
134 list.append( QObject::tr( "Business Zip" ) ); 140 list.append( mapIdToStr[Qtopia::BusinessZip] );
135 list.append( QObject::tr( "Business Country" ) ); 141 list.append( mapIdToStr[Qtopia::BusinessCountry] );
136 list.append( QObject::tr( "Business Pager" ) ); 142 list.append( mapIdToStr[Qtopia::BusinessPager] );
137 list.append( QObject::tr( "Business WebPage" ) ); 143 list.append( mapIdToStr[Qtopia::BusinessWebPage] );
138 144
139 list.append( QObject::tr( "Home Street" ) ); 145 list.append( mapIdToStr[Qtopia::HomeStreet] );
140 list.append( QObject::tr( "Home City" ) ); 146 list.append( mapIdToStr[Qtopia::HomeCity] );
141 list.append( QObject::tr( "Home State" ) ); 147 list.append( mapIdToStr[Qtopia::HomeState] );
142 list.append( QObject::tr( "Home Zip" ) ); 148 list.append( mapIdToStr[Qtopia::HomeZip] );
143 list.append( QObject::tr( "Home Country" ) ); 149 list.append( mapIdToStr[Qtopia::HomeCountry] );
144 list.append( QObject::tr( "Home Web Page" ) ); 150 list.append( mapIdToStr[Qtopia::HomeWebPage] );
145 151
@@ -147,4 +153,4 @@ QStringList OContactFields::trfields( bool sorted )
147 153
148 list.append( QObject::tr( "Notes" ) ); 154 list.append( mapIdToStr[Qtopia::Notes] );
149 list.append( QObject::tr( "Groups" ) ); 155 list.append( mapIdToStr[Qtopia::Groups] );
150 156
@@ -162,13 +168,14 @@ QStringList OContactFields::untrfields( bool sorted )
162 QStringList list; 168 QStringList list;
169 QMap<int, QString> mapIdToStr = idToUntrFields();
163 170
164 list.append( "Name Title" ); 171 list.append( mapIdToStr[ Qtopia::Title ] );
165 list.append( "First Name" ); 172 list.append( mapIdToStr[ Qtopia::FirstName ] );
166 list.append( "Middle Name" ); 173 list.append( mapIdToStr[ Qtopia::MiddleName ] );
167 list.append( "Last Name" ); 174 list.append( mapIdToStr[ Qtopia::LastName ] );
168 list.append( "Suffix" ); 175 list.append( mapIdToStr[ Qtopia::Suffix ] );
169 list.append( "File As" ); 176 list.append( mapIdToStr[ Qtopia::FileAs ] );
170 177
171 list.append( "Job Title" ); 178 list.append( mapIdToStr[ Qtopia::JobTitle ] );
172 list.append( "Department" ); 179 list.append( mapIdToStr[ Qtopia::Department ] );
173 list.append( "Company" ); 180 list.append( mapIdToStr[ Qtopia::Company ] );
174 181
@@ -176,16 +183,16 @@ QStringList OContactFields::untrfields( bool sorted )
176 183
177 list.append( "Business Street" ); 184 list.append( mapIdToStr[ Qtopia::BusinessStreet ] );
178 list.append( "Business City" ); 185 list.append( mapIdToStr[ Qtopia::BusinessCity ] );
179 list.append( "Business State" ); 186 list.append( mapIdToStr[ Qtopia::BusinessState ] );
180 list.append( "Business Zip" ); 187 list.append( mapIdToStr[ Qtopia::BusinessZip ] );
181 list.append( "Business Country" ); 188 list.append( mapIdToStr[ Qtopia::BusinessCountry ] );
182 list.append( "Business Pager" ); 189 list.append( mapIdToStr[ Qtopia::BusinessPager ] );
183 list.append( "Business WebPage" ); 190 list.append( mapIdToStr[ Qtopia::BusinessWebPage ] );
184 191
185 list.append( "Home Street" ); 192 list.append( mapIdToStr[ Qtopia::HomeStreet ] );
186 list.append( "Home City" ); 193 list.append( mapIdToStr[ Qtopia::HomeCity ] );
187 list.append( "Home State" ); 194 list.append( mapIdToStr[ Qtopia::HomeState ] );
188 list.append( "Home Zip" ); 195 list.append( mapIdToStr[ Qtopia::HomeZip ] );
189 list.append( "Home Country" ); 196 list.append( mapIdToStr[ Qtopia::HomeCountry ] );
190 list.append( "Home Web Page" ); 197 list.append( mapIdToStr[ Qtopia::HomeWebPage] );
191 198
@@ -193,4 +200,4 @@ QStringList OContactFields::untrfields( bool sorted )
193 200
194 list.append( "Notes" ); 201 list.append( mapIdToStr[ Qtopia::Notes ] );
195 list.append( "Groups" ); 202 list.append( mapIdToStr[ Qtopia::Groups ] );
196 203
@@ -263,2 +270,65 @@ QMap<int, QString> OContactFields::idToTrFields()
263 270
271QMap<int, QString> OContactFields::idToUntrFields()
272{
273 QMap<int, QString> ret_map;
274
275 ret_map.insert( Qtopia::Title, "Name Title" );
276 ret_map.insert( Qtopia::FirstName, "First Name" );
277 ret_map.insert( Qtopia::MiddleName, "Middle Name" );
278 ret_map.insert( Qtopia::LastName, "Last Name" );
279 ret_map.insert( Qtopia::Suffix, "Suffix" );
280 ret_map.insert( Qtopia::FileAs, "File As" );
281
282 ret_map.insert( Qtopia::JobTitle, "Job Title" );
283 ret_map.insert( Qtopia::Department, "Department" );
284 ret_map.insert( Qtopia::Company, "Company" );
285 ret_map.insert( Qtopia::BusinessPhone, "Business Phone" );
286 ret_map.insert( Qtopia::BusinessFax, "Business Fax" );
287 ret_map.insert( Qtopia::BusinessMobile, "Business Mobile" );
288
289 // email
290 ret_map.insert( Qtopia::DefaultEmail, "Default Email" );
291 ret_map.insert( Qtopia::Emails, "Emails" );
292
293 ret_map.insert( Qtopia::HomePhone, "Home Phone" );
294 ret_map.insert( Qtopia::HomeFax, "Home Fax" );
295 ret_map.insert( Qtopia::HomeMobile, "Home Mobile" );
296
297 // business
298 ret_map.insert( Qtopia::BusinessStreet, "Business Street" );
299 ret_map.insert( Qtopia::BusinessCity, "Business City" );
300 ret_map.insert( Qtopia::BusinessState, "Business State" );
301 ret_map.insert( Qtopia::BusinessZip, "Business Zip" );
302 ret_map.insert( Qtopia::BusinessCountry, "Business Country" );
303 ret_map.insert( Qtopia::BusinessPager, "Business Pager" );
304 ret_map.insert( Qtopia::BusinessWebPage, "Business WebPage" );
305
306 ret_map.insert( Qtopia::Office, "Office" );
307 ret_map.insert( Qtopia::Profession, "Profession" );
308 ret_map.insert( Qtopia::Assistant, "Assistant" );
309 ret_map.insert( Qtopia::Manager, "Manager" );
310
311 // home
312 ret_map.insert( Qtopia::HomeStreet, "Home Street" );
313 ret_map.insert( Qtopia::HomeCity, "Home City" );
314 ret_map.insert( Qtopia::HomeState, "Home State" );
315 ret_map.insert( Qtopia::HomeZip, "Home Zip" );
316 ret_map.insert( Qtopia::HomeCountry, "Home Country" );
317 ret_map.insert( Qtopia::HomeWebPage, "Home Web Page" );
318
319 //personal
320 ret_map.insert( Qtopia::Spouse, "Spouse" );
321 ret_map.insert( Qtopia::Gender, "Gender" );
322 ret_map.insert( Qtopia::Birthday, "Birthday" );
323 ret_map.insert( Qtopia::Anniversary, "Anniversary" );
324 ret_map.insert( Qtopia::Nickname, "Nickname" );
325 ret_map.insert( Qtopia::Children, "Children" );
326
327 // other
328 ret_map.insert( Qtopia::Notes, "Notes" );
329
330
331 return ret_map;
332}
333
264QMap<QString, int> OContactFields::trFieldsToId() 334QMap<QString, int> OContactFields::trFieldsToId()
@@ -277,2 +347,17 @@ QMap<QString, int> OContactFields::trFieldsToId()
277 347
348QMap<QString, int> OContactFields::untrFieldsToId()
349{
350 QMap<int, QString> idtostr = idToUntrFields();
351 QMap<QString, int> ret_map;
352
353
354 QMap<int, QString>::Iterator it;
355 for( it = idtostr.begin(); it != idtostr.end(); ++it )
356 ret_map.insert( *it, it.key() );
357
358
359 return ret_map;
360}
361
362
278OContactFields::OContactFields(): 363OContactFields::OContactFields():
diff --git a/core/pim/addressbook/ocontactfields.h b/core/pim/addressbook/ocontactfields.h
index bf3a7f5..9f6171b 100644
--- a/core/pim/addressbook/ocontactfields.h
+++ b/core/pim/addressbook/ocontactfields.h
@@ -54,2 +54,4 @@ class OContactFields{
54 static QMap<QString, int> trFieldsToId(); 54 static QMap<QString, int> trFieldsToId();
55 static QMap<int, QString> idToUntrFields();
56 static QMap<QString, int> untrFieldsToId();
55 57