-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 62 | ||||
-rw-r--r-- | core/pim/addressbook/contacteditor.h | 8 |
2 files changed, 29 insertions, 41 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index 75dd2c1..7682399 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp | |||
@@ -76,34 +76,32 @@ ContactEditor::ContactEditor( const OContact &entry, | |||
76 | initializing = true; | 76 | initializing = true; |
77 | 77 | ||
78 | init(); | 78 | init(); |
79 | setEntry( entry ); | 79 | setEntry( entry ); |
80 | // cmbDefaultEmail = 0; | 80 | // cmbDefaultEmail = 0; |
81 | // defaultEmailChooserPosition = -1; | 81 | // defaultEmailChooserPosition = -1; |
82 | 82 | ||
83 | initializing = false; | 83 | initializing = false; |
84 | } | 84 | } |
85 | 85 | ||
86 | ContactEditor::~ContactEditor() { | 86 | ContactEditor::~ContactEditor() { |
87 | } | 87 | } |
88 | 88 | ||
89 | void ContactEditor::init() { | 89 | void ContactEditor::init() { |
90 | qWarning("init() START"); | 90 | qWarning("init() START"); |
91 | 91 | ||
92 | useFullName = true; | ||
93 | |||
94 | uint i = 0; | 92 | uint i = 0; |
95 | 93 | ||
96 | QStringList trlChooserNames; | 94 | QStringList trlChooserNames; |
97 | 95 | ||
98 | for (i = 0; i <= 6; i++) { | 96 | for (i = 0; i <= 6; i++) { |
99 | slHomeAddress.append( "" ); | 97 | slHomeAddress.append( "" ); |
100 | slBusinessAddress.append( "" ); | 98 | slBusinessAddress.append( "" ); |
101 | } | 99 | } |
102 | 100 | ||
103 | trlChooserNames = OContactFields::trphonefields( false ); | 101 | trlChooserNames = OContactFields::trphonefields( false ); |
104 | slChooserNames = OContactFields::untrphonefields( false ); | 102 | slChooserNames = OContactFields::untrphonefields( false ); |
105 | slDynamicEntries = OContactFields::untrdetailsfields( false ); | 103 | slDynamicEntries = OContactFields::untrdetailsfields( false ); |
106 | trlDynamicEntries = OContactFields::trdetailsfields( false ); | 104 | trlDynamicEntries = OContactFields::trdetailsfields( false ); |
107 | 105 | ||
108 | // Ok, we have to remove elements from the list of dynamic entries | 106 | // Ok, we have to remove elements from the list of dynamic entries |
109 | // which are now stored in special (not dynamic) widgets.. | 107 | // which are now stored in special (not dynamic) widgets.. |
@@ -1018,82 +1016,85 @@ void ContactEditor::slotAddressTypeChange( int index ) { | |||
1018 | 1016 | ||
1019 | } | 1017 | } |
1020 | 1018 | ||
1021 | } | 1019 | } |
1022 | 1020 | ||
1023 | void ContactEditor::slotFullNameChange( const QString &textChanged ) { | 1021 | void ContactEditor::slotFullNameChange( const QString &textChanged ) { |
1024 | 1022 | ||
1025 | qWarning( "ContactEditor::slotFullNameChange( %s )", textChanged.latin1() ); | 1023 | qWarning( "ContactEditor::slotFullNameChange( %s )", textChanged.latin1() ); |
1026 | 1024 | ||
1027 | int index = cmbFileAs->currentItem(); | 1025 | int index = cmbFileAs->currentItem(); |
1028 | 1026 | ||
1029 | cmbFileAs->clear(); | 1027 | cmbFileAs->clear(); |
1030 | 1028 | ||
1031 | cmbFileAs->insertItem( parseName( textChanged, NAME_LF ) ); | 1029 | cmbFileAs->insertItem( parseName( textChanged, NAME_LF ) ); |
1032 | cmbFileAs->insertItem( parseName( textChanged, NAME_LFM ) ); | 1030 | cmbFileAs->insertItem( parseName( textChanged, NAME_LFM ) ); |
1033 | cmbFileAs->insertItem( parseName( textChanged, NAME_FL ) ); | 1031 | cmbFileAs->insertItem( parseName( textChanged, NAME_FL ) ); |
1034 | cmbFileAs->insertItem( parseName( textChanged, NAME_FMLS ) ); | 1032 | cmbFileAs->insertItem( parseName( textChanged, NAME_FML ) ); |
1033 | if ( ! txtSuffix->text().isEmpty() ) | ||
1034 | cmbFileAs->insertItem( parseName( textChanged, NAME_FML ) + " " + txtSuffix->text() ); | ||
1035 | 1035 | ||
1036 | cmbFileAs->setCurrentItem( index ); | 1036 | cmbFileAs->setCurrentItem( index ); |
1037 | 1037 | ||
1038 | useFullName = true; | ||
1039 | 1038 | ||
1040 | } | 1039 | } |
1041 | 1040 | ||
1042 | void ContactEditor::slotSuffixChange( const QString& ) { | 1041 | void ContactEditor::slotSuffixChange( const QString& ) { |
1043 | // Just want to update the FileAs combo if the suffix was changed.. | 1042 | // Just want to update the FileAs combo if the suffix was changed.. |
1044 | slotFullNameChange( txtFullName->text() ); | 1043 | slotFullNameChange( txtFullName->text() ); |
1045 | } | 1044 | } |
1046 | 1045 | ||
1047 | void ContactEditor::accept() { | 1046 | void ContactEditor::accept() { |
1048 | 1047 | ||
1049 | if ( isEmpty() ) { | 1048 | if ( isEmpty() ) { |
1050 | cleanupFields(); | 1049 | cleanupFields(); |
1051 | reject(); | 1050 | reject(); |
1052 | } else { | 1051 | } else { |
1053 | saveEntry(); | 1052 | saveEntry(); |
1054 | cleanupFields(); | 1053 | cleanupFields(); |
1055 | QDialog::accept(); | 1054 | QDialog::accept(); |
1056 | } | 1055 | } |
1057 | 1056 | ||
1058 | } | 1057 | } |
1059 | 1058 | ||
1060 | void ContactEditor::slotNote() { | 1059 | void ContactEditor::slotNote() { |
1061 | 1060 | ||
1062 | dlgNote->showMaximized(); | 1061 | dlgNote->showMaximized(); |
1063 | if ( !dlgNote->exec() ) { | 1062 | if ( !dlgNote->exec() ) { |
1064 | txtNote->setText( ent.notes() ); | 1063 | txtNote->setText( ent.notes() ); |
1065 | } | 1064 | } |
1066 | } | 1065 | } |
1067 | 1066 | ||
1068 | void ContactEditor::slotName() { | 1067 | void ContactEditor::slotName() { |
1069 | 1068 | ||
1070 | QString tmpName; | 1069 | QString tmpName; |
1071 | if (useFullName) { | 1070 | |
1072 | txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); | 1071 | txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); |
1073 | txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); | 1072 | txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); |
1074 | txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); | 1073 | txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); |
1075 | // txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); | 1074 | // txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); |
1076 | } | 1075 | |
1077 | dlgName->showMaximized(); | 1076 | dlgName->showMaximized(); |
1078 | if ( dlgName->exec() ) { | 1077 | if ( dlgName->exec() ) { |
1078 | if ( txtLastName->text().contains( ' ', TRUE ) ) | ||
1079 | tmpName = txtLastName->text() + ", " + txtFirstName->text() + " " + txtMiddleName->text(); | ||
1080 | else | ||
1081 | tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text(); | ||
1079 | 1082 | ||
1080 | tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text(); | ||
1081 | txtFullName->setText( tmpName.simplifyWhiteSpace() ); | 1083 | txtFullName->setText( tmpName.simplifyWhiteSpace() ); |
1082 | slotFullNameChange( txtFullName->text() ); | 1084 | slotFullNameChange( txtFullName->text() ); |
1083 | useFullName = false; | ||
1084 | } | 1085 | } |
1085 | 1086 | ||
1086 | } | 1087 | } |
1087 | 1088 | ||
1088 | void ContactEditor::setNameFocus() { | 1089 | void ContactEditor::setNameFocus() { |
1089 | 1090 | ||
1090 | txtFullName->setFocus(); | 1091 | txtFullName->setFocus(); |
1091 | 1092 | ||
1092 | } | 1093 | } |
1093 | 1094 | ||
1094 | bool ContactEditor::isEmpty() { | 1095 | bool ContactEditor::isEmpty() { |
1095 | // Test and see if the record should be saved. | 1096 | // Test and see if the record should be saved. |
1096 | // More strict than the original qtopia, needs name or fileas to save | 1097 | // More strict than the original qtopia, needs name or fileas to save |
1097 | 1098 | ||
1098 | QString t = txtFullName->text(); | 1099 | QString t = txtFullName->text(); |
1099 | if ( !t.isEmpty() && containsAlphaNum( t ) ) | 1100 | if ( !t.isEmpty() && containsAlphaNum( t ) ) |
@@ -1166,34 +1167,34 @@ QString ContactEditor::parseName( const QString fullName, int type ) { | |||
1166 | 1167 | ||
1167 | qWarning(" strFirstName: %s", strFirstName.latin1()); | 1168 | qWarning(" strFirstName: %s", strFirstName.latin1()); |
1168 | qWarning(" strMiddleName: %s", strMiddleName.latin1()); | 1169 | qWarning(" strMiddleName: %s", strMiddleName.latin1()); |
1169 | qWarning(" strLastName: %s", strLastName.latin1()); | 1170 | qWarning(" strLastName: %s", strLastName.latin1()); |
1170 | qWarning(" strTitle: %s", strTitle.latin1()); | 1171 | qWarning(" strTitle: %s", strTitle.latin1()); |
1171 | 1172 | ||
1172 | switch (type) { | 1173 | switch (type) { |
1173 | case NAME_FL: | 1174 | case NAME_FL: |
1174 | return strFirstName + " " + strLastName; | 1175 | return strFirstName + " " + strLastName; |
1175 | 1176 | ||
1176 | case NAME_LF: | 1177 | case NAME_LF: |
1177 | return strLastName + ", " + strFirstName; | 1178 | return strLastName + ", " + strFirstName; |
1178 | 1179 | ||
1179 | case NAME_LFM: | 1180 | case NAME_LFM: |
1180 | return strLastName + ", " + strFirstName + " " + strMiddleName; | 1181 | return strLastName + ", " + strFirstName + " " + strMiddleName; |
1181 | 1182 | ||
1182 | case NAME_FMLS: | 1183 | case NAME_FML: |
1183 | return strFirstName + " " + strMiddleName + " " + strLastName + " " + txtSuffix->text(); | 1184 | return strFirstName + " " + strMiddleName + " " + strLastName ; |
1184 | 1185 | ||
1185 | case NAME_F: | 1186 | case NAME_F: |
1186 | return strFirstName; | 1187 | return strFirstName; |
1187 | 1188 | ||
1188 | case NAME_M: | 1189 | case NAME_M: |
1189 | return strMiddleName; | 1190 | return strMiddleName; |
1190 | 1191 | ||
1191 | case NAME_L: | 1192 | case NAME_L: |
1192 | return strLastName; | 1193 | return strLastName; |
1193 | 1194 | ||
1194 | case NAME_S: | 1195 | case NAME_S: |
1195 | return txtSuffix->text(); | 1196 | return txtSuffix->text(); |
1196 | 1197 | ||
1197 | } | 1198 | } |
1198 | return QString::null; | 1199 | return QString::null; |
1199 | } | 1200 | } |
@@ -1237,48 +1238,49 @@ void ContactEditor::cleanupFields() { | |||
1237 | 1238 | ||
1238 | } | 1239 | } |
1239 | 1240 | ||
1240 | void ContactEditor::setEntry( const OContact &entry ) { | 1241 | void ContactEditor::setEntry( const OContact &entry ) { |
1241 | 1242 | ||
1242 | initializing = true; | 1243 | initializing = true; |
1243 | 1244 | ||
1244 | cleanupFields(); | 1245 | cleanupFields(); |
1245 | 1246 | ||
1246 | ent = entry; | 1247 | ent = entry; |
1247 | 1248 | ||
1248 | emails = QStringList(ent.emailList()); | 1249 | emails = QStringList(ent.emailList()); |
1249 | defaultEmail = ent.defaultEmail(); | 1250 | defaultEmail = ent.defaultEmail(); |
1250 | if (defaultEmail.isEmpty()) defaultEmail = emails[0]; | 1251 | if (defaultEmail.isEmpty()) defaultEmail = emails[0]; |
1251 | qDebug("default email=%s",defaultEmail.latin1()); | 1252 | qDebug("default email=%s",defaultEmail.latin1()); |
1252 | 1253 | ||
1253 | useFullName = false; | ||
1254 | txtFirstName->setText( ent.firstName() ); | 1254 | txtFirstName->setText( ent.firstName() ); |
1255 | txtMiddleName->setText( ent.middleName() ); | 1255 | txtMiddleName->setText( ent.middleName() ); |
1256 | txtLastName->setText( ent.lastName() ); | 1256 | txtLastName->setText( ent.lastName() ); |
1257 | txtSuffix->setText( ent.suffix() ); | 1257 | txtSuffix->setText( ent.suffix() ); |
1258 | 1258 | ||
1259 | // QString *tmpString = new QString; | 1259 | // QString *tmpString = new QString; |
1260 | // *tmpString = ent.firstName() + " " + ent.middleName() + | 1260 | // *tmpString = ent.firstName() + " " + ent.middleName() + |
1261 | // + " " + ent.lastName() + " " + ent.suffix(); | 1261 | // + " " + ent.lastName() + " " + ent.suffix(); |
1262 | //txtFullName->setText( tmpString->simplifyWhiteSpace() ); | 1262 | //txtFullName->setText( tmpString->simplifyWhiteSpace() ); |
1263 | 1263 | ||
1264 | // Lastnames with multiple words need to be protected by a comma ! | 1264 | if ( !ent.isEmpty() ){ |
1265 | if ( ent.lastName().contains( ' ', TRUE ) ) | 1265 | // Lastnames with multiple words need to be protected by a comma ! |
1266 | txtFullName->setText( ent.lastName() + ", " + ent.firstName() + " " + ent.middleName() ); | 1266 | if ( ent.lastName().contains( ' ', TRUE ) ) |
1267 | else | 1267 | txtFullName->setText( ent.lastName() + ", " + ent.firstName() + " " + ent.middleName() ); |
1268 | txtFullName->setText( ent.firstName() + " " + ent.middleName() + " " + ent.lastName() ); | 1268 | else |
1269 | txtFullName->setText( ent.firstName() + " " + ent.middleName() + " " + ent.lastName() ); | ||
1270 | } | ||
1269 | 1271 | ||
1270 | cmbFileAs->setEditText( ent.fileAs() ); | 1272 | cmbFileAs->setEditText( ent.fileAs() ); |
1271 | 1273 | ||
1272 | //if (hasTitle) | 1274 | //if (hasTitle) |
1273 | txtJobTitle->setText( ent.jobTitle() ); | 1275 | txtJobTitle->setText( ent.jobTitle() ); |
1274 | 1276 | ||
1275 | //if (hasCompany) | 1277 | //if (hasCompany) |
1276 | txtOrganization->setText( ent.company() ); | 1278 | txtOrganization->setText( ent.company() ); |
1277 | 1279 | ||
1278 | //if (hasNotes) | 1280 | //if (hasNotes) |
1279 | txtNote->setText( ent.notes() ); | 1281 | txtNote->setText( ent.notes() ); |
1280 | 1282 | ||
1281 | //if (hasStreet) { | 1283 | //if (hasStreet) { |
1282 | slHomeAddress[0] = ent.homeStreet(); | 1284 | slHomeAddress[0] = ent.homeStreet(); |
1283 | slBusinessAddress[0] = ent.businessStreet(); | 1285 | slBusinessAddress[0] = ent.businessStreet(); |
1284 | //} | 1286 | //} |
@@ -1412,40 +1414,32 @@ void ContactEditor::setEntry( const OContact &entry ) { | |||
1412 | if ( ( *it == "Business WebPage" ) || ( *it == "Work Web Page" ) ) | 1414 | if ( ( *it == "Business WebPage" ) || ( *it == "Work Web Page" ) ) |
1413 | *itV = ent.businessWebpage(); | 1415 | *itV = ent.businessWebpage(); |
1414 | 1416 | ||
1415 | 1417 | ||
1416 | } | 1418 | } |
1417 | 1419 | ||
1418 | 1420 | ||
1419 | cmbCat->setCategories( ent.categories(), "Contacts", tr("Contacts") ); | 1421 | cmbCat->setCategories( ent.categories(), "Contacts", tr("Contacts") ); |
1420 | 1422 | ||
1421 | QString gender = ent.gender(); | 1423 | QString gender = ent.gender(); |
1422 | cmbGender->setCurrentItem( gender.toInt() ); | 1424 | cmbGender->setCurrentItem( gender.toInt() ); |
1423 | 1425 | ||
1424 | txtNote->setText( ent.notes() ); | 1426 | txtNote->setText( ent.notes() ); |
1425 | 1427 | ||
1426 | slotAddressTypeChange( cmbAddress->currentItem() ); | 1428 | slotAddressTypeChange( cmbAddress->currentItem() ); |
1427 | 1429 | ||
1428 | // Calling "show()" to arrange all widgets. Otherwise we will get | ||
1429 | // a wrong position of the textfields and are unable to put our | ||
1430 | // default-email combo over it.. This is very ugly ! | ||
1431 | // Does anybody has a better solution ? | ||
1432 | // Basically we should rethink the strategy to hide | ||
1433 | // a textfield with overwriting.. (se) | ||
1434 | show(); | ||
1435 | |||
1436 | // Get combo-settings from contact and set preset.. | 1430 | // Get combo-settings from contact and set preset.. |
1437 | contactfields.loadFromRecord( ent ); | 1431 | contactfields.loadFromRecord( ent ); |
1438 | cmbChooserField1->setCurrentItem( contactfields.getFieldOrder(0, 7) ); | 1432 | cmbChooserField1->setCurrentItem( contactfields.getFieldOrder(0, 7) ); |
1439 | cmbChooserField2->setCurrentItem( contactfields.getFieldOrder(1, 9) ); | 1433 | cmbChooserField2->setCurrentItem( contactfields.getFieldOrder(1, 9) ); |
1440 | cmbChooserField3->setCurrentItem( contactfields.getFieldOrder(2, 0) ); | 1434 | cmbChooserField3->setCurrentItem( contactfields.getFieldOrder(2, 0) ); |
1441 | cmbChooserField4->setCurrentItem( contactfields.getFieldOrder(3, 6) ); | 1435 | cmbChooserField4->setCurrentItem( contactfields.getFieldOrder(3, 6) ); |
1442 | cmbAddress->setCurrentItem( contactfields.getFieldOrder(4, 1) ); | 1436 | cmbAddress->setCurrentItem( contactfields.getFieldOrder(4, 1) ); |
1443 | slotCmbChooser1Change( cmbChooserField1->currentItem() ); | 1437 | slotCmbChooser1Change( cmbChooserField1->currentItem() ); |
1444 | slotCmbChooser2Change( cmbChooserField2->currentItem() ); | 1438 | slotCmbChooser2Change( cmbChooserField2->currentItem() ); |
1445 | slotCmbChooser3Change( cmbChooserField3->currentItem() ); | 1439 | slotCmbChooser3Change( cmbChooserField3->currentItem() ); |
1446 | slotCmbChooser4Change( cmbChooserField4->currentItem() ); | 1440 | slotCmbChooser4Change( cmbChooserField4->currentItem() ); |
1447 | slotAddressTypeChange( cmbAddress->currentItem() ); | 1441 | slotAddressTypeChange( cmbAddress->currentItem() ); |
1448 | 1442 | ||
1449 | updateDatePicker(); | 1443 | updateDatePicker(); |
1450 | 1444 | ||
1451 | initializing = false; | 1445 | initializing = false; |
@@ -1459,40 +1453,36 @@ void ContactEditor::updateDatePicker() | |||
1459 | } else | 1453 | } else |
1460 | birthdayButton->setText( tr ("Unknown") ); | 1454 | birthdayButton->setText( tr ("Unknown") ); |
1461 | 1455 | ||
1462 | if ( !ent.anniversary().isNull() ){ | 1456 | if ( !ent.anniversary().isNull() ){ |
1463 | anniversaryButton->setText( TimeString::numberDateString( ent.anniversary() ) ); | 1457 | anniversaryButton->setText( TimeString::numberDateString( ent.anniversary() ) ); |
1464 | anniversaryPicker->setDate( ent.anniversary() ); | 1458 | anniversaryPicker->setDate( ent.anniversary() ); |
1465 | } else | 1459 | } else |
1466 | anniversaryButton->setText( tr ("Unknown") ); | 1460 | anniversaryButton->setText( tr ("Unknown") ); |
1467 | 1461 | ||
1468 | } | 1462 | } |
1469 | 1463 | ||
1470 | void ContactEditor::saveEntry() { | 1464 | void ContactEditor::saveEntry() { |
1471 | 1465 | ||
1472 | // Store current combo into contact | 1466 | // Store current combo into contact |
1473 | contactfields.saveToRecord( ent ); | 1467 | contactfields.saveToRecord( ent ); |
1474 | 1468 | ||
1475 | if ( useFullName ) { | 1469 | txtFirstName->setText( parseName( txtFullName->text(), NAME_F ) ); |
1476 | txtFirstName->setText( parseName( txtFullName->text(), NAME_F ) ); | 1470 | txtMiddleName->setText( parseName( txtFullName->text(), NAME_M ) ); |
1477 | txtMiddleName->setText( parseName( txtFullName->text(), NAME_M ) ); | 1471 | txtLastName->setText( parseName( txtFullName->text(), NAME_L ) ); |
1478 | txtLastName->setText( parseName( txtFullName->text(), NAME_L ) ); | 1472 | // txtSuffix->setText( parseName( txtFullName->text(), NAME_S ) ); |
1479 | // txtSuffix->setText( parseName( txtFullName->text(), NAME_S ) ); | ||
1480 | |||
1481 | useFullName = false; | ||
1482 | } | ||
1483 | 1473 | ||
1484 | ent.setFirstName( txtFirstName->text() ); | 1474 | ent.setFirstName( txtFirstName->text() ); |
1485 | ent.setLastName( txtLastName->text() ); | 1475 | ent.setLastName( txtLastName->text() ); |
1486 | ent.setMiddleName( txtMiddleName->text() ); | 1476 | ent.setMiddleName( txtMiddleName->text() ); |
1487 | ent.setSuffix( txtSuffix->text() ); | 1477 | ent.setSuffix( txtSuffix->text() ); |
1488 | 1478 | ||
1489 | ent.setFileAs( cmbFileAs->currentText() ); | 1479 | ent.setFileAs( cmbFileAs->currentText() ); |
1490 | 1480 | ||
1491 | ent.setCategories( cmbCat->currentCategories() ); | 1481 | ent.setCategories( cmbCat->currentCategories() ); |
1492 | 1482 | ||
1493 | 1483 | ||
1494 | //if (hasTitle) | 1484 | //if (hasTitle) |
1495 | ent.setJobTitle( txtJobTitle->text() ); | 1485 | ent.setJobTitle( txtJobTitle->text() ); |
1496 | 1486 | ||
1497 | //if (hasCompany) | 1487 | //if (hasCompany) |
1498 | ent.setCompany( txtOrganization->text() ); | 1488 | ent.setCompany( txtOrganization->text() ); |
diff --git a/core/pim/addressbook/contacteditor.h b/core/pim/addressbook/contacteditor.h index 954c77e..c6fa48f 100644 --- a/core/pim/addressbook/contacteditor.h +++ b/core/pim/addressbook/contacteditor.h | |||
@@ -20,36 +20,36 @@ | |||
20 | 20 | ||
21 | #ifndef CONTACTEDITOR_H | 21 | #ifndef CONTACTEDITOR_H |
22 | #define CONTACTEDITOR_H | 22 | #define CONTACTEDITOR_H |
23 | 23 | ||
24 | #include <opie/ocontact.h> | 24 | #include <opie/ocontact.h> |
25 | 25 | ||
26 | #include <qpe/datebookmonth.h> | 26 | #include <qpe/datebookmonth.h> |
27 | 27 | ||
28 | #include <qdialog.h> | 28 | #include <qdialog.h> |
29 | #include <qlist.h> | 29 | #include <qlist.h> |
30 | #include <qmap.h> | 30 | #include <qmap.h> |
31 | #include <qstringlist.h> | 31 | #include <qstringlist.h> |
32 | #include <qwidgetstack.h> | 32 | #include <qwidgetstack.h> |
33 | 33 | ||
34 | #include "ocontactfields.h" | 34 | #include "ocontactfields.h" |
35 | 35 | ||
36 | const int NAME_LF = 0; | 36 | const int NAME_LF = 0; |
37 | const int NAME_LFM = 1; | 37 | const int NAME_LFM = 1; |
38 | const int NAME_FL = 2; | 38 | const int NAME_FL = 2; |
39 | const int NAME_FMLS = 3; | 39 | const int NAME_FML = 3; |
40 | 40 | ||
41 | const int NAME_F = 4; | 41 | const int NAME_F = 4; |
42 | const int NAME_M = 5; | 42 | const int NAME_M = 5; |
43 | const int NAME_L = 6; | 43 | const int NAME_L = 6; |
44 | const int NAME_S = 7; | 44 | const int NAME_S = 7; |
45 | 45 | ||
46 | 46 | ||
47 | class QScrollView; | 47 | class QScrollView; |
48 | class QTabWidget; | 48 | class QTabWidget; |
49 | class QMultiLineEdit; | 49 | class QMultiLineEdit; |
50 | class QLineEdit; | 50 | class QLineEdit; |
51 | class QComboBox; | 51 | class QComboBox; |
52 | class QPushButton; | 52 | class QPushButton; |
53 | class CategorySelect; | 53 | class CategorySelect; |
54 | class QLabel; | 54 | class QLabel; |
55 | 55 | ||
@@ -102,34 +102,32 @@ class ContactEditor : public QDialog { | |||
102 | void slotFullNameChange( const QString &textChanged ); | 102 | void slotFullNameChange( const QString &textChanged ); |
103 | void slotSuffixChange( const QString &textChanged ); | 103 | void slotSuffixChange( const QString &textChanged ); |
104 | void slotAnniversaryDateChanged( int year, int month, int day); | 104 | void slotAnniversaryDateChanged( int year, int month, int day); |
105 | void slotBirthdayDateChanged( int year, int month, int day); | 105 | void slotBirthdayDateChanged( int year, int month, int day); |
106 | void slotRemoveBirthday(); | 106 | void slotRemoveBirthday(); |
107 | void slotRemoveAnniversary(); | 107 | void slotRemoveAnniversary(); |
108 | void defaultEmailChanged(int); | 108 | void defaultEmailChanged(int); |
109 | 109 | ||
110 | private: | 110 | private: |
111 | enum StackWidgets { TextField = 1, Combo }; | 111 | enum StackWidgets { TextField = 1, Combo }; |
112 | int defaultEmailChooserPosition; | 112 | int defaultEmailChooserPosition; |
113 | void populateDefaultEmailCmb(); | 113 | void populateDefaultEmailCmb(); |
114 | void chooserChange( const QString&, int , QLineEdit*, int ); | 114 | void chooserChange( const QString&, int , QLineEdit*, int ); |
115 | bool cmbChooserChange( int , QWidgetStack*, int ); | 115 | bool cmbChooserChange( int , QWidgetStack*, int ); |
116 | OContactFields contactfields; | 116 | OContactFields contactfields; |
117 | 117 | ||
118 | bool useFullName; | ||
119 | |||
120 | OContact ent; | 118 | OContact ent; |
121 | 119 | ||
122 | QDialog *dlgNote; | 120 | QDialog *dlgNote; |
123 | QDialog *dlgName; | 121 | QDialog *dlgName; |
124 | 122 | ||
125 | QList<QLineEdit> listValue; | 123 | QList<QLineEdit> listValue; |
126 | QList<QLabel> listName; | 124 | QList<QLabel> listName; |
127 | 125 | ||
128 | QStringList slDynamicEntries; | 126 | QStringList slDynamicEntries; |
129 | QStringList trlDynamicEntries; | 127 | QStringList trlDynamicEntries; |
130 | 128 | ||
131 | bool m_personalView; | 129 | bool m_personalView; |
132 | 130 | ||
133 | QStringList slHomeAddress; | 131 | QStringList slHomeAddress; |
134 | QStringList slBusinessAddress; | 132 | QStringList slBusinessAddress; |
135 | QStringList slChooserNames; | 133 | QStringList slChooserNames; |