summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/contacteditor.cpp19
-rw-r--r--core/pim/addressbook/contacteditor.h3
2 files changed, 14 insertions, 8 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp
index f125edb..cc3908a 100644
--- a/core/pim/addressbook/contacteditor.cpp
+++ b/core/pim/addressbook/contacteditor.cpp
@@ -61,26 +61,26 @@ void parseEmailFrom( const QString &txt, QString &strDefaultEmail,
61 61
62 ContactEditor::ContactEditor(const OContact &entry, 62 ContactEditor::ContactEditor(const OContact &entry,
63 QWidget *parent, 63 QWidget *parent,
64 const char *name, 64 const char *name,
65 WFlags fl ) 65 WFlags fl )
66 : QDialog( parent, name, TRUE, fl ), 66 : QDialog( parent, name, TRUE, fl ),
67 m_personalView ( false ) 67 m_personalView ( false )
68 68
69{ 69{
70 70
71 init(); 71 init();
72 setEntry( entry ); 72 setEntry( entry );
73
74 cmbDefaultEmail = 0; 73 cmbDefaultEmail = 0;
74 defaultEmailChooserPosition = -1;
75} 75}
76 76
77ContactEditor::~ContactEditor() { 77ContactEditor::~ContactEditor() {
78} 78}
79 79
80void ContactEditor::init() { 80void ContactEditor::init() {
81 81
82 useFullName = true; 82 useFullName = true;
83 83
84 uint i = 0; 84 uint i = 0;
85 85
86 QStringList trlChooserNames; 86 QStringList trlChooserNames;
@@ -622,61 +622,66 @@ void ContactEditor::init() {
622 new QPEDialogListener(this); 622 new QPEDialogListener(this);
623 623
624 setPersonalView ( m_personalView ); 624 setPersonalView ( m_personalView );
625} 625}
626 626
627void ContactEditor::defaultEmailChanged(int i){ 627void ContactEditor::defaultEmailChanged(int i){
628 qDebug("defaultEmailChanged"); 628 qDebug("defaultEmailChanged");
629 int index = cmbChooserField1->currentItem(); 629 int index = cmbChooserField1->currentItem();
630 slChooserValues[index] = cmbDefaultEmail->text(i); 630 slChooserValues[index] = cmbDefaultEmail->text(i);
631 631
632} 632}
633 633
634void ContactEditor::chooserChange( const QString &textChanged, int index, QLineEdit *inputWid ) { 634void ContactEditor::chooserChange( const QString &textChanged, int index, QLineEdit *inputWid, int widgetPos ) {
635 635
636 qDebug("defaultEmailChooserPosition %i, widgetPos %i ",defaultEmailChooserPosition,widgetPos);
636 if (slChooserNames[index] == "Default Email"){ 637 if (slChooserNames[index] == "Default Email"){
637 if (cmbDefaultEmail) delete cmbDefaultEmail; 638 if (cmbDefaultEmail) delete cmbDefaultEmail;
638 cmbDefaultEmail = new QComboBox(inputWid->parentWidget()); 639 cmbDefaultEmail = new QComboBox(inputWid->parentWidget());
639 cmbDefaultEmail->setGeometry(inputWid->frameGeometry()); 640 cmbDefaultEmail->setGeometry(inputWid->frameGeometry());
640 cmbDefaultEmail->insertStringList(ent.emailList()); 641 cmbDefaultEmail->insertStringList(ent.emailList());
641 connect(cmbDefaultEmail,SIGNAL(activated(int)), 642 connect(cmbDefaultEmail,SIGNAL(activated(int)),
642 SLOT(defaultEmailChanged(int))); 643 SLOT(defaultEmailChanged(int)));
643 QString demail = ent.defaultEmail(); 644 QString demail = ent.defaultEmail();
644 for ( int i = 0; i < cmbDefaultEmail->count(); i++) 645 for ( int i = 0; i < cmbDefaultEmail->count(); i++)
645 if ( cmbDefaultEmail->text( i ) == demail ) 646 if ( cmbDefaultEmail->text( i ) == demail )
646 cmbDefaultEmail->setCurrentItem( i ); 647 cmbDefaultEmail->setCurrentItem( i );
647 648
648 cmbDefaultEmail->show(); 649 cmbDefaultEmail->show();
649 } 650 defaultEmailChooserPosition = widgetPos;
651 }else if (defaultEmailChooserPosition == widgetPos){
652 qDebug("cmbDefaultEmail->hide()");
653 if (cmbDefaultEmail) cmbDefaultEmail->hide();
654 }
650 655
651 656
652 slChooserValues[index] = textChanged; 657 slChooserValues[index] = textChanged;
653 658
654} 659}
655 660
656void ContactEditor::slotChooser1Change( const QString &textChanged ) { 661void ContactEditor::slotChooser1Change( const QString &textChanged ) {
657 chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1); 662 chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1, 1);
658} 663}
659 664
660void ContactEditor::slotChooser2Change( const QString &textChanged ) { 665void ContactEditor::slotChooser2Change( const QString &textChanged ) {
661 chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2); 666 chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2, 2);
662 667
663} 668}
664 669
665void ContactEditor::slotChooser3Change( const QString &textChanged ) { 670void ContactEditor::slotChooser3Change( const QString &textChanged ) {
666 chooserChange( textChanged, cmbChooserField3->currentItem(), txtChooserField3); 671 chooserChange( textChanged, cmbChooserField3->currentItem(), txtChooserField3, 3);
667} 672}
668 673
669void ContactEditor::slotChooser4Change( const QString &textChanged ) { 674void ContactEditor::slotChooser4Change( const QString &textChanged ) {
670 chooserChange( textChanged, cmbChooserField4->currentItem(), txtChooserField4); 675 chooserChange( textChanged, cmbChooserField4->currentItem(), txtChooserField4, 4);
671} 676}
672 677
673void ContactEditor::slotAddressChange( const QString &textChanged ) { 678void ContactEditor::slotAddressChange( const QString &textChanged ) {
674 679
675 if ( cmbAddress->currentItem() == 0 ) { 680 if ( cmbAddress->currentItem() == 0 ) {
676 slBusinessAddress[0] = textChanged; 681 slBusinessAddress[0] = textChanged;
677 } else { 682 } else {
678 slHomeAddress[0] = textChanged; 683 slHomeAddress[0] = textChanged;
679 } 684 }
680} 685}
681 686
682void ContactEditor::slotAddress2Change( const QString &textChanged ) { 687void ContactEditor::slotAddress2Change( const QString &textChanged ) {
diff --git a/core/pim/addressbook/contacteditor.h b/core/pim/addressbook/contacteditor.h
index d4b7f27..63257f8 100644
--- a/core/pim/addressbook/contacteditor.h
+++ b/core/pim/addressbook/contacteditor.h
@@ -94,25 +94,26 @@ class ContactEditor : public QDialog {
94 void slotCityChange( const QString &textChanged ); 94 void slotCityChange( const QString &textChanged );
95 void slotStateChange( const QString &textChanged ); 95 void slotStateChange( const QString &textChanged );
96 void slotZipChange( const QString &textChanged ); 96 void slotZipChange( const QString &textChanged );
97 void slotCountryChange( const QString &textChanged ); 97 void slotCountryChange( const QString &textChanged );
98 void slotFullNameChange( const QString &textChanged ); 98 void slotFullNameChange( const QString &textChanged );
99 void slotAnniversaryDateChanged( int year, int month, int day); 99 void slotAnniversaryDateChanged( int year, int month, int day);
100 void slotBirthdayDateChanged( int year, int month, int day); 100 void slotBirthdayDateChanged( int year, int month, int day);
101 void slotRemoveBirthday(); 101 void slotRemoveBirthday();
102 void slotRemoveAnniversary(); 102 void slotRemoveAnniversary();
103 void defaultEmailChanged(int); 103 void defaultEmailChanged(int);
104 104
105 private: 105 private:
106 void chooserChange( const QString&, int , QLineEdit* ); 106 int defaultEmailChooserPosition;
107 void chooserChange( const QString&, int , QLineEdit*, int );
107 bool useFullName; 108 bool useFullName;
108 109
109 OContact ent; 110 OContact ent;
110 111
111 QDialog *dlgNote; 112 QDialog *dlgNote;
112 QDialog *dlgName; 113 QDialog *dlgName;
113 114
114 QList<QLineEdit> listValue; 115 QList<QLineEdit> listValue;
115 QList<QLabel> listName; 116 QList<QLabel> listName;
116 117
117 QStringList slDynamicEntries; 118 QStringList slDynamicEntries;
118 QStringList trlDynamicEntries; 119 QStringList trlDynamicEntries;