author | eilers <eilers> | 2003-05-11 12:36:30 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-05-11 12:36:30 (UTC) |
commit | 37084d3961026893840ef9891132bdf193a312b3 (patch) (unidiff) | |
tree | 342792abd777eb11a378cc5e06e0436ab48f6d89 /core/pim/addressbook/contacteditor.cpp | |
parent | b068a42c89af19f5642b68060c1d085afa78e7b1 (diff) | |
download | opie-37084d3961026893840ef9891132bdf193a312b3.zip opie-37084d3961026893840ef9891132bdf193a312b3.tar.gz opie-37084d3961026893840ef9891132bdf193a312b3.tar.bz2 |
Some improvements in handling of organizations:
- If you enter a organization name and no Fullname is entered, the
organization name will be used.
Thus, the organization is shown correctly in the listview..
- The letterpicker now searches for the SaveAs Entry (configurable)
instead for lastname. Ths guarantees that the organization is found
as expected..
This addresses bugreport #590 and #895..
Diffstat (limited to 'core/pim/addressbook/contacteditor.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index f33ee0a..ce14f98 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp | |||
@@ -647,28 +647,30 @@ void ContactEditor::init() { | |||
647 | 647 | ||
648 | cmbChooserField1->insertStringList( trlChooserNames ); | 648 | cmbChooserField1->insertStringList( trlChooserNames ); |
649 | cmbChooserField2->insertStringList( trlChooserNames ); | 649 | cmbChooserField2->insertStringList( trlChooserNames ); |
650 | cmbChooserField3->insertStringList( trlChooserNames ); | 650 | cmbChooserField3->insertStringList( trlChooserNames ); |
651 | cmbChooserField4->insertStringList( trlChooserNames ); | 651 | cmbChooserField4->insertStringList( trlChooserNames ); |
652 | 652 | ||
653 | cmbChooserField1->setCurrentItem( 0 ); | 653 | cmbChooserField1->setCurrentItem( 0 ); |
654 | cmbChooserField2->setCurrentItem( 1 ); | 654 | cmbChooserField2->setCurrentItem( 1 ); |
655 | cmbChooserField3->setCurrentItem( 2 ); | 655 | cmbChooserField3->setCurrentItem( 2 ); |
656 | 656 | ||
657 | connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); | 657 | connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); |
658 | 658 | ||
659 | connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); | 659 | connect( txtFullName, SIGNAL(textChanged(const QString &)), |
660 | 660 | this, SLOT(slotFullNameChange(const QString &)) ); | |
661 | connect( txtSuffix, SIGNAL(textChanged(const QString &)), this, SLOT(slotSuffixChange(const QString &)) ); | 661 | connect( txtSuffix, SIGNAL(textChanged(const QString &)), |
662 | 662 | this, SLOT(slotSuffixChange(const QString &)) ); | |
663 | connect( txtOrganization, SIGNAL(textChanged(const QString &)), | ||
664 | this, SLOT(slotOrganizationChange(const QString &)) ); | ||
663 | connect( txtChooserField1, SIGNAL(textChanged(const QString &)), | 665 | connect( txtChooserField1, SIGNAL(textChanged(const QString &)), |
664 | this, SLOT(slotChooser1Change(const QString &)) ); | 666 | this, SLOT(slotChooser1Change(const QString &)) ); |
665 | connect( txtChooserField2, SIGNAL(textChanged(const QString &)), | 667 | connect( txtChooserField2, SIGNAL(textChanged(const QString &)), |
666 | this, SLOT(slotChooser2Change(const QString &)) ); | 668 | this, SLOT(slotChooser2Change(const QString &)) ); |
667 | connect( txtChooserField3, SIGNAL(textChanged(const QString &)), | 669 | connect( txtChooserField3, SIGNAL(textChanged(const QString &)), |
668 | this, SLOT(slotChooser3Change(const QString &)) ); | 670 | this, SLOT(slotChooser3Change(const QString &)) ); |
669 | connect( txtChooserField4, SIGNAL(textChanged(const QString &)), | 671 | connect( txtChooserField4, SIGNAL(textChanged(const QString &)), |
670 | this, SLOT(slotChooser4Change(const QString &)) ); | 672 | this, SLOT(slotChooser4Change(const QString &)) ); |
671 | connect( txtAddress, SIGNAL(textChanged(const QString &)), | 673 | connect( txtAddress, SIGNAL(textChanged(const QString &)), |
672 | this, SLOT(slotAddressChange(const QString &)) ); | 674 | this, SLOT(slotAddressChange(const QString &)) ); |
673 | connect( txtCity, SIGNAL(textChanged(const QString &)), | 675 | connect( txtCity, SIGNAL(textChanged(const QString &)), |
674 | this, SLOT(slotCityChange(const QString &)) ); | 676 | this, SLOT(slotCityChange(const QString &)) ); |
@@ -1048,24 +1050,34 @@ void ContactEditor::slotFullNameChange( const QString &textChanged ) { | |||
1048 | cmbFileAs->insertItem( parseName( textChanged, NAME_FML ) + " " + txtSuffix->text() ); | 1050 | cmbFileAs->insertItem( parseName( textChanged, NAME_FML ) + " " + txtSuffix->text() ); |
1049 | 1051 | ||
1050 | cmbFileAs->setCurrentItem( index ); | 1052 | cmbFileAs->setCurrentItem( index ); |
1051 | 1053 | ||
1052 | 1054 | ||
1053 | } | 1055 | } |
1054 | 1056 | ||
1055 | void ContactEditor::slotSuffixChange( const QString& ) { | 1057 | void ContactEditor::slotSuffixChange( const QString& ) { |
1056 | // Just want to update the FileAs combo if the suffix was changed.. | 1058 | // Just want to update the FileAs combo if the suffix was changed.. |
1057 | slotFullNameChange( txtFullName->text() ); | 1059 | slotFullNameChange( txtFullName->text() ); |
1058 | } | 1060 | } |
1059 | 1061 | ||
1062 | void ContactEditor::slotOrganizationChange( const QString &textChanged ){ | ||
1063 | qWarning( "ContactEditor::slotOrganizationChange( %s )", textChanged.latin1() ); | ||
1064 | // Special handling for storing Companies: | ||
1065 | // If no Fullname is given, we store the Company-Name as lastname | ||
1066 | // to handle it like a person.. | ||
1067 | if ( txtFullName->text() == txtOrganization->text().left( txtFullName->text().length() ) ) | ||
1068 | txtFullName->setText( textChanged ); | ||
1069 | |||
1070 | } | ||
1071 | |||
1060 | void ContactEditor::accept() { | 1072 | void ContactEditor::accept() { |
1061 | 1073 | ||
1062 | if ( isEmpty() ) { | 1074 | if ( isEmpty() ) { |
1063 | cleanupFields(); | 1075 | cleanupFields(); |
1064 | reject(); | 1076 | reject(); |
1065 | } else { | 1077 | } else { |
1066 | saveEntry(); | 1078 | saveEntry(); |
1067 | cleanupFields(); | 1079 | cleanupFields(); |
1068 | QDialog::accept(); | 1080 | QDialog::accept(); |
1069 | } | 1081 | } |
1070 | 1082 | ||
1071 | } | 1083 | } |