Diffstat (limited to 'core/pim/addressbook/contacteditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index 8fbd065..7932781 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp | |||
@@ -1062,65 +1062,63 @@ void ContactEditor::slotOrganizationChange( const QString &textChanged ){ | |||
1062 | qWarning( "ContactEditor::slotOrganizationChange( %s )", textChanged.latin1() ); | 1062 | qWarning( "ContactEditor::slotOrganizationChange( %s )", textChanged.latin1() ); |
1063 | // Special handling for storing Companies: | 1063 | // Special handling for storing Companies: |
1064 | // If no Fullname is given, we store the Company-Name as lastname | 1064 | // If no Fullname is given, we store the Company-Name as lastname |
1065 | // to handle it like a person.. | 1065 | // to handle it like a person.. |
1066 | if ( txtFullName->text() == txtOrganization->text().left( txtFullName->text().length() ) ) | 1066 | if ( txtFullName->text() == txtOrganization->text().left( txtFullName->text().length() ) ) |
1067 | txtFullName->setText( textChanged ); | 1067 | txtFullName->setText( textChanged ); |
1068 | 1068 | ||
1069 | } | 1069 | } |
1070 | 1070 | ||
1071 | void ContactEditor::accept() { | 1071 | void ContactEditor::accept() { |
1072 | 1072 | ||
1073 | if ( isEmpty() ) { | 1073 | if ( isEmpty() ) { |
1074 | cleanupFields(); | 1074 | cleanupFields(); |
1075 | reject(); | 1075 | reject(); |
1076 | } else { | 1076 | } else { |
1077 | saveEntry(); | 1077 | saveEntry(); |
1078 | cleanupFields(); | 1078 | cleanupFields(); |
1079 | QDialog::accept(); | 1079 | QDialog::accept(); |
1080 | } | 1080 | } |
1081 | 1081 | ||
1082 | } | 1082 | } |
1083 | 1083 | ||
1084 | void ContactEditor::slotNote() { | 1084 | void ContactEditor::slotNote() { |
1085 | 1085 | ||
1086 | dlgNote->showMaximized(); | 1086 | if ( ! QPEApplication::execDialog( dlgNote ) ) { |
1087 | if ( !dlgNote->exec() ) { | ||
1088 | txtNote->setText( ent.notes() ); | 1087 | txtNote->setText( ent.notes() ); |
1089 | } | 1088 | } |
1090 | } | 1089 | } |
1091 | 1090 | ||
1092 | void ContactEditor::slotName() { | 1091 | void ContactEditor::slotName() { |
1093 | 1092 | ||
1094 | QString tmpName; | 1093 | QString tmpName; |
1095 | 1094 | ||
1096 | txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); | 1095 | txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); |
1097 | txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); | 1096 | txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); |
1098 | txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); | 1097 | txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); |
1099 | // txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); | 1098 | // txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); |
1100 | 1099 | ||
1101 | dlgName->showMaximized(); | 1100 | if ( QPEApplication::execDialog( dlgName ) ) { |
1102 | if ( dlgName->exec() ) { | ||
1103 | if ( txtLastName->text().contains( ' ', TRUE ) ) | 1101 | if ( txtLastName->text().contains( ' ', TRUE ) ) |
1104 | tmpName = txtLastName->text() + ", " + txtFirstName->text() + " " + txtMiddleName->text(); | 1102 | tmpName = txtLastName->text() + ", " + txtFirstName->text() + " " + txtMiddleName->text(); |
1105 | else | 1103 | else |
1106 | tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text(); | 1104 | tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text(); |
1107 | 1105 | ||
1108 | txtFullName->setText( tmpName.simplifyWhiteSpace() ); | 1106 | txtFullName->setText( tmpName.simplifyWhiteSpace() ); |
1109 | slotFullNameChange( txtFullName->text() ); | 1107 | slotFullNameChange( txtFullName->text() ); |
1110 | } | 1108 | } |
1111 | 1109 | ||
1112 | } | 1110 | } |
1113 | 1111 | ||
1114 | void ContactEditor::setNameFocus() { | 1112 | void ContactEditor::setNameFocus() { |
1115 | 1113 | ||
1116 | txtFullName->setFocus(); | 1114 | txtFullName->setFocus(); |
1117 | 1115 | ||
1118 | } | 1116 | } |
1119 | 1117 | ||
1120 | bool ContactEditor::isEmpty() { | 1118 | bool ContactEditor::isEmpty() { |
1121 | // Test and see if the record should be saved. | 1119 | // Test and see if the record should be saved. |
1122 | // More strict than the original qtopia, needs name or fileas to save | 1120 | // More strict than the original qtopia, needs name or fileas to save |
1123 | 1121 | ||
1124 | QString t = txtFullName->text(); | 1122 | QString t = txtFullName->text(); |
1125 | if ( !t.isEmpty() && containsAlphaNum( t ) ) | 1123 | if ( !t.isEmpty() && containsAlphaNum( t ) ) |
1126 | return false; | 1124 | return false; |