summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/pim/addressbook/contacteditor.cpp51
-rw-r--r--core/pim/addressbook/contacteditor.h4
-rw-r--r--core/pim/addressbook/ocontactfields.cpp4
3 files changed, 39 insertions, 20 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp
index 5a7bf1a..7338eeb 100644
--- a/core/pim/addressbook/contacteditor.cpp
+++ b/core/pim/addressbook/contacteditor.cpp
@@ -58,4 +58,4 @@ void parseEmailFrom( const QString &txt, QString &strDefaultEmail,
58// helper convert from file format to comma delimited... 58// helper convert from file format to comma delimited...
59void parseEmailTo( const QString &strDefaultEmail, 59//void parseEmailTo( const QString &strDefaultEmail,
60 const QString &strOtherEmail, QString &strBack ); 60 // const QString &strOtherEmail, QString &strBack );
61 61
@@ -623,7 +623,6 @@ void ContactEditor::init() {
623 623
624void ContactEditor::slotChooser1Change( const QString &textChanged ) { 624void ContactEditor::defaultEmailChanged(int i){
625 625 qDebug("defaultEmailChanged");
626 int index = cmbChooserField1->currentItem(); 626 int index = cmbChooserField1->currentItem();
627 627 slChooserValues[index] = cmbDefaultEmail->text(i);
628 slChooserValues[index] = textChanged;
629 628
@@ -631,13 +630,19 @@ void ContactEditor::slotChooser1Change( const QString &textChanged ) {
631 630
632void ContactEditor::slotChooser2Change( const QString &textChanged ) { 631void ContactEditor::chooserChange( const QString &textChanged, int index, QLineEdit *inputWid ) {
633 632
634 int index = cmbChooserField2->currentItem(); 633 if (slChooserNames[index] == "Default Email"){
635 634 delete cmbDefaultEmail;
636 slChooserValues[index] = textChanged; 635 cmbDefaultEmail = new QComboBox(inputWid->parentWidget());
636 cmbDefaultEmail->setGeometry(inputWid->frameGeometry());
637 cmbDefaultEmail->insertStringList(ent.emailList());
638 connect(cmbDefaultEmail,SIGNAL(activated(int)),
639 SLOT(defaultEmailChanged(int)));
640 QString demail = ent.defaultEmail();
641 for ( int i = 0; i < cmbDefaultEmail->count(); i++)
642 if ( cmbDefaultEmail->text( i ) == demail )
643 cmbDefaultEmail->setCurrentItem( i );
637 644
645 cmbDefaultEmail->show();
638} 646}
639 647
640void ContactEditor::slotChooser3Change( const QString &textChanged ) {
641
642 int index = cmbChooserField3->currentItem();
643 648
@@ -647,8 +652,17 @@ void ContactEditor::slotChooser3Change( const QString &textChanged ) {
647 652
648void ContactEditor::slotChooser4Change( const QString &textChanged ) { 653void ContactEditor::slotChooser1Change( const QString &textChanged ) {
654 chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1);
655}
649 656
650 int index = cmbChooserField4->currentItem(); 657void ContactEditor::slotChooser2Change( const QString &textChanged ) {
658 chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2);
651 659
652 slChooserValues[index] = textChanged; 660}
653 661
662void ContactEditor::slotChooser3Change( const QString &textChanged ) {
663 chooserChange( textChanged, cmbChooserField3->currentItem(), txtChooserField3);
664}
665
666void ContactEditor::slotChooser4Change( const QString &textChanged ) {
667 chooserChange( textChanged, cmbChooserField4->currentItem(), txtChooserField4);
654} 668}
@@ -1377,3 +1391,3 @@ void ContactEditor::saveEntry() {
1377 // ent.clearEmails(); 1391 // ent.clearEmails();
1378 ent.setDefaultEmail( defaultmail ); 1392 // ent.setDefaultEmail( defaultmail );
1379 ent.setEmails( allemail ); 1393 ent.setEmails( allemail );
@@ -1381,2 +1395,5 @@ void ContactEditor::saveEntry() {
1381 1395
1396 if ( *it == "Default Email")
1397 ent.setDefaultEmail( *itV );
1398
1382 if ( *it == "Home Phone" ) 1399 if ( *it == "Home Phone" )
diff --git a/core/pim/addressbook/contacteditor.h b/core/pim/addressbook/contacteditor.h
index 250b831..d4b7f27 100644
--- a/core/pim/addressbook/contacteditor.h
+++ b/core/pim/addressbook/contacteditor.h
@@ -102,6 +102,7 @@ class ContactEditor : public QDialog {
102 void slotRemoveAnniversary(); 102 void slotRemoveAnniversary();
103 void defaultEmailChanged(int);
103 104
104 private: 105 private:
106 void chooserChange( const QString&, int , QLineEdit* );
105 bool useFullName; 107 bool useFullName;
106 // bool hasGender, hasTitle, hasCompany, hasNotes, hasStreet, hasStreet2, hasPOBox, hasCity, hasState, hasZip, hasCountry;
107 108
@@ -149,2 +150,3 @@ class ContactEditor : public QDialog {
149 QComboBox *cmbChooserField4; 150 QComboBox *cmbChooserField4;
151 QComboBox *cmbDefaultEmail;
150 QComboBox *cmbFileAs; 152 QComboBox *cmbFileAs;
diff --git a/core/pim/addressbook/ocontactfields.cpp b/core/pim/addressbook/ocontactfields.cpp
index df57efa..7823a9c 100644
--- a/core/pim/addressbook/ocontactfields.cpp
+++ b/core/pim/addressbook/ocontactfields.cpp
@@ -44,3 +44,3 @@ QStringList OContactFields::trphonefields( bool sorted )
44 44
45 // list.append( QObject::tr( "Default Email" ) ); 45 list.append( QObject::tr( "Default Email" ) );
46 list.append( QObject::tr( "Emails" ) ); 46 list.append( QObject::tr( "Emails" ) );
@@ -140,3 +140,3 @@ QStringList OContactFields::untrphonefields( bool sorted )
140 140
141 // list.append( "Default Email" ); 141 list.append( "Default Email" );
142 list.append( "Emails" ); 142 list.append( "Emails" );