author | tille <tille> | 2002-12-18 13:01:15 (UTC) |
---|---|---|
committer | tille <tille> | 2002-12-18 13:01:15 (UTC) |
commit | 9471f69c44e811781ed9f643f5b84d7b459df601 (patch) (unidiff) | |
tree | f8daf275c36b9a068cbec9ff487a195e639ff8bf | |
parent | 930884a92b064766ed436111778fc55f157c6e1c (diff) | |
download | opie-9471f69c44e811781ed9f643f5b84d7b459df601.zip opie-9471f69c44e811781ed9f643f5b84d7b459df601.tar.gz opie-9471f69c44e811781ed9f643f5b84d7b459df601.tar.bz2 |
changing from defaultemail to something else now hides the combo
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 17 | ||||
-rw-r--r-- | core/pim/addressbook/contacteditor.h | 3 |
2 files changed, 13 insertions, 7 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 | |||
@@ -70,8 +70,8 @@ ContactEditor::ContactEditor( const OContact &entry, | |||
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 | ||
77 | ContactEditor::~ContactEditor() { | 77 | ContactEditor::~ContactEditor() { |
@@ -631,8 +631,9 @@ void ContactEditor::defaultEmailChanged(int i){ | |||
631 | 631 | ||
632 | } | 632 | } |
633 | 633 | ||
634 | void ContactEditor::chooserChange( const QString &textChanged, int index, QLineEdit *inputWid ) { | 634 | void 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()); |
@@ -646,6 +647,10 @@ void ContactEditor::chooserChange( const QString &textChanged, int index, QLineE | |||
646 | cmbDefaultEmail->setCurrentItem( i ); | 647 | cmbDefaultEmail->setCurrentItem( i ); |
647 | 648 | ||
648 | cmbDefaultEmail->show(); | 649 | cmbDefaultEmail->show(); |
650 | defaultEmailChooserPosition = widgetPos; | ||
651 | }else if (defaultEmailChooserPosition == widgetPos){ | ||
652 | qDebug("cmbDefaultEmail->hide()"); | ||
653 | if (cmbDefaultEmail) cmbDefaultEmail->hide(); | ||
649 | } | 654 | } |
650 | 655 | ||
651 | 656 | ||
@@ -654,20 +659,20 @@ void ContactEditor::chooserChange( const QString &textChanged, int index, QLineE | |||
654 | } | 659 | } |
655 | 660 | ||
656 | void ContactEditor::slotChooser1Change( const QString &textChanged ) { | 661 | void ContactEditor::slotChooser1Change( const QString &textChanged ) { |
657 | chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1); | 662 | chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1, 1); |
658 | } | 663 | } |
659 | 664 | ||
660 | void ContactEditor::slotChooser2Change( const QString &textChanged ) { | 665 | void ContactEditor::slotChooser2Change( const QString &textChanged ) { |
661 | chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2); | 666 | chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2, 2); |
662 | 667 | ||
663 | } | 668 | } |
664 | 669 | ||
665 | void ContactEditor::slotChooser3Change( const QString &textChanged ) { | 670 | void ContactEditor::slotChooser3Change( const QString &textChanged ) { |
666 | chooserChange( textChanged, cmbChooserField3->currentItem(), txtChooserField3); | 671 | chooserChange( textChanged, cmbChooserField3->currentItem(), txtChooserField3, 3); |
667 | } | 672 | } |
668 | 673 | ||
669 | void ContactEditor::slotChooser4Change( const QString &textChanged ) { | 674 | void ContactEditor::slotChooser4Change( const QString &textChanged ) { |
670 | chooserChange( textChanged, cmbChooserField4->currentItem(), txtChooserField4); | 675 | chooserChange( textChanged, cmbChooserField4->currentItem(), txtChooserField4, 4); |
671 | } | 676 | } |
672 | 677 | ||
673 | void ContactEditor::slotAddressChange( const QString &textChanged ) { | 678 | void ContactEditor::slotAddressChange( 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 | |||
@@ -103,7 +103,8 @@ class ContactEditor : public QDialog { | |||
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; |