summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/contacteditor.cpp218
1 files changed, 156 insertions, 62 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp
index fa60f98..d419142 100644
--- a/core/pim/addressbook/contacteditor.cpp
+++ b/core/pim/addressbook/contacteditor.cpp
@@ -107,3 +107,3 @@ void ContactEditor::init() {
107 107
108 if ( (*it).right( 3 ) == tr( "Fax" ) ) { 108 if ( (*it) == tr( "Business Fax" ) ) {
109 slChooserNames.append( *it ); 109 slChooserNames.append( *it );
@@ -113,4 +113,12 @@ void ContactEditor::init() {
113 } 113 }
114
115 if ( (*it) == tr( "Home Fax" ) ) {
116 slChooserNames.append( *it );
117 slChooserValues.append("" );
118 //slDynamicEntries->remove( it );
119 continue;
120 }
121
114 122
115 if ( (*it).right( 5 ) == tr( "Phone" ) ) { 123 if ( (*it) == tr( "Business Phone" ) ) {
116 slChooserNames.append( *it ); 124 slChooserNames.append( *it );
@@ -121,2 +129,10 @@ void ContactEditor::init() {
121 129
130 if ( (*it) == tr( "Home Phone" ) ) {
131 slChooserNames.append( *it );
132 slChooserValues.append( "" );
133 //slDynamicEntries->remove( it );
134 continue;
135 }
136
137/*
122 if ( (*it).right( 2 ) == tr( "IM" ) ) { 138 if ( (*it).right( 2 ) == tr( "IM" ) ) {
@@ -126,5 +142,20 @@ void ContactEditor::init() {
126 continue; 142 continue;
143 } */
144
145 if ( (*it) == tr( "Business Mobile" ) ) {
146 slChooserNames.append( *it );
147 slChooserValues.append( "" );
148 //slDynamicEntries->remove( it );
149 continue;
150 }
151
152 if ( (*it) == tr( "Home Mobile" ) ) {
153 slChooserNames.append( *it );
154 slChooserValues.append( "" );
155 //slDynamicEntries->remove( it );
156 continue;
127 } 157 }
128 158
129 if ( (*it).right( 6 ) == tr( "Mobile" ) ) { 159
160 if ( (*it) == tr( "Business WebPage" ) ) {
130 slChooserNames.append( *it ); 161 slChooserNames.append( *it );
@@ -135,3 +166,3 @@ void ContactEditor::init() {
135 166
136 if ( (*it).right( 4 ) == tr( "Page" ) ) { 167 if ( (*it) == tr( "Home Web Page" ) ) {
137 slChooserNames.append( *it ); 168 slChooserNames.append( *it );
@@ -142,3 +173,3 @@ void ContactEditor::init() {
142 173
143 if ( (*it).right( 5 ) == tr( "Pager" ) ) { 174 if ( (*it) == tr( "Business Pager" ) ) {
144 slChooserNames.append( *it ); 175 slChooserNames.append( *it );
@@ -162,2 +193,5 @@ void ContactEditor::init() {
162 } 193 }
194
195 if ( *it == "Name Title" || *it == "First Name" || *it == "Middle Name" || *it == "Last Name" || *it == "File As" || *it == "Default Email" || *it == "Emails" || *it == "Groups" )
196 continue;
163 197
@@ -205,3 +239,3 @@ void ContactEditor::init() {
205 239
206 if ( *it == tr( "Company" ) ) { 240 if ( *it == tr( "Company") || *it == tr( "Organization" ) ) {
207 hasCompany = TRUE; 241 hasCompany = TRUE;
@@ -222,3 +256,3 @@ void ContactEditor::init() {
222 256
223 if ( (*it).right( 6 ) == tr( "Street" ) ) { 257 if ( (*it) == tr( "Business Street" ) ) {
224 hasStreet = TRUE; 258 hasStreet = TRUE;
@@ -228,2 +262,8 @@ void ContactEditor::init() {
228 262
263 if ( (*it) == tr( "Home Street" ) ) {
264 hasStreet = TRUE;
265 //slDynamicEntries->remove( it );
266 continue;
267 }
268/*
229 if ( (*it).right( 8 ) == tr( "Street 2" ) ) { 269 if ( (*it).right( 8 ) == tr( "Street 2" ) ) {
@@ -232,3 +272,3 @@ void ContactEditor::init() {
232 continue; 272 continue;
233 } 273 }
234 274
@@ -238,5 +278,29 @@ void ContactEditor::init() {
238 continue; 278 continue;
279 } */
280
281 if ( (*it) == tr( "Business City" ) ) {
282 hasCity = TRUE;
283 //slDynamicEntries->remove( it );
284 continue;
285 }
286
287 if ( (*it) == tr( "Business State" ) ) {
288 hasState = TRUE;
289 //slDynamicEntries->remove( it );
290 continue;
291 }
292
293 if ( (*it) == tr( "Business Zip" ) ) {
294 hasZip = TRUE;
295 //slDynamicEntries->remove( it );
296 continue;
297 }
298
299 if ( (*it) == tr( "Business Country" ) ) {
300 hasCountry = TRUE;
301 //slDynamicEntries->remove( it );
302 continue;
239 } 303 }
240 304
241 if ( (*it).right( 4 ) == tr( "City" ) ) { 305 if ( (*it) == tr( "Home City" ) ) {
242 hasCity = TRUE; 306 hasCity = TRUE;
@@ -246,3 +310,3 @@ void ContactEditor::init() {
246 310
247 if ( (*it).right( 5 ) == tr( "State" ) ) { 311 if ( (*it) == tr( "Home State" ) ) {
248 hasState = TRUE; 312 hasState = TRUE;
@@ -252,3 +316,3 @@ void ContactEditor::init() {
252 316
253 if ( (*it).right( 3 ) == tr( "Zip" ) ) { 317 if ( (*it) == tr( "Home Zip" ) ) {
254 hasZip = TRUE; 318 hasZip = TRUE;
@@ -258,3 +322,3 @@ void ContactEditor::init() {
258 322
259 if ( (*it).right( 7 ) == tr( "Country" ) ) { 323 if ( (*it) == tr( "Home Country" ) ) {
260 hasCountry = TRUE; 324 hasCountry = TRUE;
@@ -264,2 +328,3 @@ void ContactEditor::init() {
264 328
329
265 slDynamicEntries.append( *it ); 330 slDynamicEntries.append( *it );
@@ -962,3 +1027,4 @@ void ContactEditor::slotName() {
962 1027
963 if (useFullName = TRUE) { 1028 QString tmpName;
1029 if (useFullName == TRUE) {
964 txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); 1030 txtFirstName->setText( parseName(txtFullName->text(), NAME_F) );
@@ -968,6 +1034,7 @@ void ContactEditor::slotName() {
968 } 1034 }
969
970 dlgName->showMaximized(); 1035 dlgName->showMaximized();
971 if ( dlgName->exec() ) { 1036 if ( dlgName->exec() ) {
972 txtFullName->setText( txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text() + " " + txtSuffix->text() ); 1037
1038 tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text() + " " + txtSuffix->text();
1039 txtFullName->setText( tmpName.simplifyWhiteSpace() );
973 slotFullNameChange( txtFullName->text() ); 1040 slotFullNameChange( txtFullName->text() );
@@ -1021,3 +1088,17 @@ QString ContactEditor::parseName( const QString fullName, int type ) {
1021 case 0: 1088 case 0:
1022 return simplifiedName; 1089 //return simplifiedName;
1090 if (txtLastName->text() != "") {
1091 strLastName = simplifiedName;
1092 break;
1093 }
1094 if (txtMiddleName->text() != "") {
1095 strMiddleName = simplifiedName;
1096 break;
1097 }
1098 if (txtSuffix->text() != "") {
1099 strSuffix = simplifiedName;
1100 break;
1101 }
1102 strFirstName = simplifiedName;
1103 break;
1023 1104
@@ -1077,3 +1158,17 @@ QString ContactEditor::parseName( const QString fullName, int type ) {
1077 case 0: 1158 case 0:
1078 return simplifiedName; 1159 //return simplifiedName;
1160 if (txtLastName->text() != "") {
1161 strLastName = simplifiedName;
1162 break;
1163 }
1164 if (txtMiddleName->text() != "") {
1165 strMiddleName = simplifiedName;
1166 break;
1167 }
1168 if (txtSuffix->text() != "") {
1169 strSuffix = simplifiedName;
1170 break;
1171 }
1172 strFirstName = simplifiedName;
1173 break;
1079 1174
@@ -1128,3 +1223,2 @@ QString ContactEditor::parseName( const QString fullName, int type ) {
1128 } 1223 }
1129
1130 switch (type) { 1224 switch (type) {
@@ -1268,33 +1362,33 @@ void ContactEditor::setEntry( const Contact &entry ) {
1268 for ( it = slDynamicEntries.begin(); it != slDynamicEntries.end(); ++it, ++itLE) { 1362 for ( it = slDynamicEntries.begin(); it != slDynamicEntries.end(); ++it, ++itLE) {
1269 if ( *it == "Department" ) 1363 if ( *it == tr("Department") )
1270 (*itLE)->setText( ent.department() ); 1364 (*itLE)->setText( ent.department() );
1271 1365
1272 if ( *it == "Company" ) 1366 if ( *it == tr("Company" ))
1273 (*itLE)->setText( ent.company() ); 1367 (*itLE)->setText( ent.company() );
1274 1368
1275 if ( *it == "Office" ) 1369 if ( *it == tr("Office" ))
1276 (*itLE)->setText( ent.office() ); 1370 (*itLE)->setText( ent.office() );
1277 1371
1278 if ( *it == "Profession" ) 1372 if ( *it == tr("Profession" ))
1279 (*itLE)->setText( ent.profession() ); 1373 (*itLE)->setText( ent.profession() );
1280 1374
1281 if ( *it == "Assistant" ) 1375 if ( *it == tr("Assistant" ))
1282 (*itLE)->setText( ent.assistant() ); 1376 (*itLE)->setText( ent.assistant() );
1283 1377
1284 if ( *it == "Manager" ) 1378 if ( *it == tr("Manager" ))
1285 (*itLE)->setText( ent.manager() ); 1379 (*itLE)->setText( ent.manager() );
1286 1380
1287 if ( *it == "Spouse" ) 1381 if ( *it == tr("Spouse" ))
1288 (*itLE)->setText( ent.spouse() ); 1382 (*itLE)->setText( ent.spouse() );
1289 1383
1290 if ( *it == "Birthday" ) 1384 if ( *it == tr("Birthday" ))
1291 (*itLE)->setText( ent.birthday() ); 1385 (*itLE)->setText( ent.birthday() );
1292 1386
1293 if ( *it == "Anniversary" ) 1387 if ( *it == tr("Anniversary" ))
1294 (*itLE)->setText( ent.anniversary() ); 1388 (*itLE)->setText( ent.anniversary() );
1295 1389
1296 if ( *it == "Nickname" ) 1390 if ( *it == tr("Nickname" ))
1297 (*itLE)->setText( ent.nickname() ); 1391 (*itLE)->setText( ent.nickname() );
1298 1392
1299 if ( *it == "Children" ) 1393 if ( *it == tr("Children" ))
1300 (*itLE)->setText( ent.children() ); 1394 (*itLE)->setText( ent.children() );
@@ -1306,3 +1400,3 @@ void ContactEditor::setEntry( const Contact &entry ) {
1306 1400
1307 if ( *it == "Business Phone" || *it == "Work Phone" ) 1401 if ( *it == tr("Business Phone") || *it == tr("Work Phone" ))
1308 *itV = ent.businessPhone(); 1402 *itV = ent.businessPhone();
@@ -1312,6 +1406,6 @@ void ContactEditor::setEntry( const Contact &entry ) {
1312*/ 1406*/
1313 if ( *it == "Business Fax" || *it == "Work Fax" ) 1407 if ( *it == tr("Business Fax") || *it == tr("Work Fax" ))
1314 *itV = ent.businessFax(); 1408 *itV = ent.businessFax();
1315 1409
1316 if ( *it == "Business Mobile" || *it == "work Mobile" ) 1410 if ( *it == tr("Business Mobile") || *it == tr("work Mobile" ))
1317 *itV = ent.businessMobile(); 1411 *itV = ent.businessMobile();
@@ -1321,9 +1415,9 @@ void ContactEditor::setEntry( const Contact &entry ) {
1321*/ 1415*/
1322 if ( *it == "Default Email" ) 1416 if ( *it == tr("Default Email" ))
1323 *itV = ent.defaultEmail(); 1417 *itV = ent.defaultEmail();
1324 1418
1325 if ( *it == "Emails" ) 1419 if ( *it == tr("Emails" ))
1326 *itV = ent.emails(); 1420 *itV = ent.emails();
1327 1421
1328 if ( *it == "Home Phone" ) 1422 if ( *it == tr("Home Phone" ))
1329 *itV = ent.homePhone(); 1423 *itV = ent.homePhone();
@@ -1333,6 +1427,6 @@ void ContactEditor::setEntry( const Contact &entry ) {
1333*/ 1427*/
1334 if ( *it == "Home Fax" ) 1428 if ( *it == tr("Home Fax" ))
1335 *itV = ent.homeFax(); 1429 *itV = ent.homeFax();
1336 1430
1337 if ( *it == "Home Mobile" ) 1431 if ( *it == tr("Home Mobile" ))
1338 *itV = ent.homeMobile(); 1432 *itV = ent.homeMobile();
@@ -1348,3 +1442,3 @@ void ContactEditor::setEntry( const Contact &entry ) {
1348*/ 1442*/
1349 if ( *it == "Business Pager" || *it == "Work Pager" ) 1443 if ( *it == tr("Business Pager") || *it == tr("Work Pager" ))
1350 *itV = ent.businessPager(); 1444 *itV = ent.businessPager();
@@ -1369,5 +1463,5 @@ void ContactEditor::setEntry( const Contact &entry ) {
1369*/ 1463*/
1370 if ( *it == "Home Web Page" ) 1464 if ( *it == tr("Home Web Page") )
1371 *itV = ent.homeWebpage(); 1465 *itV = ent.homeWebpage();
1372 if ( *it == "Business Web Page" || *it == "Work Web Page" ) 1466 if ( *it == tr("Business WebPage") || *it == tr("Work Web Page") )
1373 *itV = ent.businessWebpage(); 1467 *itV = ent.businessWebpage();
@@ -1465,33 +1559,33 @@ void ContactEditor::saveEntry() {
1465 for ( it = slDynamicEntries.begin(); it != slDynamicEntries.end(); ++it, ++itLE) { 1559 for ( it = slDynamicEntries.begin(); it != slDynamicEntries.end(); ++it, ++itLE) {
1466 if ( *it == "Department" ) 1560 if ( *it == tr("Department" ))
1467 ent.setDepartment( (*itLE)->text() ); 1561 ent.setDepartment( (*itLE)->text() );
1468 1562
1469 if ( *it == "Company" ) 1563 if ( *it == tr("Company" ))
1470 ent.setCompany( (*itLE)->text() ); 1564 ent.setCompany( (*itLE)->text() );
1471 1565
1472 if ( *it == "Office" ) 1566 if ( *it == tr("Office" ))
1473 ent.setOffice( (*itLE)->text() ); 1567 ent.setOffice( (*itLE)->text() );
1474 1568
1475 if ( *it == "Profession" ) 1569 if ( *it == tr("Profession" ))
1476 ent.setProfession( (*itLE)->text() ); 1570 ent.setProfession( (*itLE)->text() );
1477 1571
1478 if ( *it == "Assistant" ) 1572 if ( *it == tr("Assistant" ))
1479 ent.setAssistant( (*itLE)->text() ); 1573 ent.setAssistant( (*itLE)->text() );
1480 1574
1481 if ( *it == "Manager" ) 1575 if ( *it == tr("Manager" ))
1482 ent.setManager( (*itLE)->text() ); 1576 ent.setManager( (*itLE)->text() );
1483 1577
1484 if ( *it == "Spouse" ) 1578 if ( *it == tr("Spouse" ))
1485 ent.setSpouse( (*itLE)->text() ); 1579 ent.setSpouse( (*itLE)->text() );
1486 1580
1487 if ( *it == "Birthday" ) 1581 if ( *it == tr("Birthday" ))
1488 ent.setBirthday( (*itLE)->text() ); 1582 ent.setBirthday( (*itLE)->text() );
1489 1583
1490 if ( *it == "Anniversary" ) 1584 if ( *it == tr("Anniversary" ))
1491 ent.setAnniversary( (*itLE)->text() ); 1585 ent.setAnniversary( (*itLE)->text() );
1492 1586
1493 if ( *it == "Nickname" ) 1587 if ( *it == tr("Nickname" ))
1494 ent.setNickname( (*itLE)->text() ); 1588 ent.setNickname( (*itLE)->text() );
1495 1589
1496 if ( *it == "Children" ) 1590 if ( *it == tr("Children" ))
1497 ent.setChildren( (*itLE)->text() ); 1591 ent.setChildren( (*itLE)->text() );
@@ -1503,12 +1597,12 @@ void ContactEditor::saveEntry() {
1503 1597
1504 if ( *it == "Business Phone" || *it == "Work Phone" ) 1598 if ( *it == tr("Business Phone") || *it == tr("Work Phone" ))
1505 ent.setBusinessPhone( *itV ); 1599 ent.setBusinessPhone( *itV );
1506/* 1600/*
1507 if ( *it == "Business 2 Phone" ) 1601 if ( *it == tr("Business 2 Phone" )
1508 ent.setBusiness2Phone( *itV ); 1602 ent.setBusiness2Phone( *itV );
1509*/ 1603*/
1510 if ( *it == "Business Fax" || *it == "Work Fax" ) 1604 if ( *it == tr("Business Fax") || *it == tr("Work Fax" ))
1511 ent.setBusinessFax( *itV ); 1605 ent.setBusinessFax( *itV );
1512 1606
1513 if ( *it == "Business Mobile" || *it == "Work Mobile" ) 1607 if ( *it == tr("Business Mobile") || *it == tr("Work Mobile" ))
1514 ent.setBusinessMobile( *itV ); 1608 ent.setBusinessMobile( *itV );
@@ -1521,3 +1615,3 @@ void ContactEditor::saveEntry() {
1521 1615
1522 if ( *it == "Emails" ) { 1616 if ( *it == tr("Emails" )) {
1523 QString allemail; 1617 QString allemail;
@@ -1529,3 +1623,3 @@ void ContactEditor::saveEntry() {
1529 1623
1530 if ( *it == "Home Phone" ) 1624 if ( *it == tr("Home Phone" ))
1531 ent.setHomePhone( *itV ); 1625 ent.setHomePhone( *itV );
@@ -1535,6 +1629,6 @@ void ContactEditor::saveEntry() {
1535*/ 1629*/
1536 if ( *it == "Home Fax" ) 1630 if ( *it == tr("Home Fax" ))
1537 ent.setHomeFax( *itV ); 1631 ent.setHomeFax( *itV );
1538 1632
1539 if ( *it == "Home Mobile" ) 1633 if ( *it == tr("Home Mobile" ))
1540 ent.setHomeMobile( *itV ); 1634 ent.setHomeMobile( *itV );
@@ -1550,3 +1644,3 @@ void ContactEditor::saveEntry() {
1550*/ 1644*/
1551 if ( *it == "Business Pager" || *it == "Work Pager" ) 1645 if ( *it == tr("Business Pager") || *it == tr("Work Pager") )
1552 ent.setBusinessPager( *itV ); 1646 ent.setBusinessPager( *itV );
@@ -1571,5 +1665,5 @@ void ContactEditor::saveEntry() {
1571*/ 1665*/
1572 if ( *it == "Home Web Page" ) 1666 if ( *it == tr("Home Web Page") )
1573 ent.setHomeWebpage( *itV ); 1667 ent.setHomeWebpage( *itV );
1574 if ( *it == "Business Web Page" || *it == "Work Web Page" ) 1668 if ( *it == tr("Business WebPage") || *it == tr("Work Web Page" ))
1575 ent.setBusinessWebpage( *itV ); 1669 ent.setBusinessWebpage( *itV );