author | tille <tille> | 2002-12-08 18:37:00 (UTC) |
---|---|---|
committer | tille <tille> | 2002-12-08 18:37:00 (UTC) |
commit | ff55ff70dc982d070bb085acb96831ae30b30902 (patch) (unidiff) | |
tree | 3cb5f5c0e75794420a525ebc7aa929003fc6a650 | |
parent | 741a70d585c5680ccdb2786df4a73e7bde1d7c5d (diff) | |
download | opie-ff55ff70dc982d070bb085acb96831ae30b30902.zip opie-ff55ff70dc982d070bb085acb96831ae30b30902.tar.gz opie-ff55ff70dc982d070bb085acb96831ae30b30902.tar.bz2 |
fix
-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index 7338eeb..f125edb 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp | |||
@@ -44,52 +44,55 @@ | |||
44 | #include <qpopupmenu.h> | 44 | #include <qpopupmenu.h> |
45 | #include <qlistbox.h> | 45 | #include <qlistbox.h> |
46 | #include <qhbox.h> | 46 | #include <qhbox.h> |
47 | #include <qaction.h> | 47 | #include <qaction.h> |
48 | #include <qiconset.h> | 48 | #include <qiconset.h> |
49 | 49 | ||
50 | static inline bool containsAlphaNum( const QString &str ); | 50 | static inline bool containsAlphaNum( const QString &str ); |
51 | static inline bool constainsWhiteSpace( const QString &str ); | 51 | static inline bool constainsWhiteSpace( const QString &str ); |
52 | 52 | ||
53 | // helper functions, convert our comma delimited list to proper | 53 | // helper functions, convert our comma delimited list to proper |
54 | // file format... | 54 | // file format... |
55 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, | 55 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, |
56 | QString &strAll ); | 56 | QString &strAll ); |
57 | 57 | ||
58 | // helper convert from file format to comma delimited... | 58 | // helper convert from file format to comma delimited... |
59 | //void parseEmailTo( const QString &strDefaultEmail, | 59 | //void parseEmailTo( const QString &strDefaultEmail, |
60 | // const QString &strOtherEmail, QString &strBack ); | 60 | // const QString &strOtherEmail, QString &strBack ); |
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 | init(); | 71 | init(); |
71 | setEntry( entry ); | 72 | setEntry( entry ); |
73 | |||
74 | cmbDefaultEmail = 0; | ||
72 | } | 75 | } |
73 | 76 | ||
74 | ContactEditor::~ContactEditor() { | 77 | ContactEditor::~ContactEditor() { |
75 | } | 78 | } |
76 | 79 | ||
77 | void ContactEditor::init() { | 80 | void ContactEditor::init() { |
78 | 81 | ||
79 | useFullName = true; | 82 | useFullName = true; |
80 | 83 | ||
81 | uint i = 0; | 84 | uint i = 0; |
82 | 85 | ||
83 | QStringList trlChooserNames; | 86 | QStringList trlChooserNames; |
84 | 87 | ||
85 | for (i = 0; i <= 6; i++) { | 88 | for (i = 0; i <= 6; i++) { |
86 | slHomeAddress.append( "" ); | 89 | slHomeAddress.append( "" ); |
87 | slBusinessAddress.append( "" ); | 90 | slBusinessAddress.append( "" ); |
88 | } | 91 | } |
89 | 92 | ||
90 | trlChooserNames = OContactFields::trphonefields(); | 93 | trlChooserNames = OContactFields::trphonefields(); |
91 | slChooserNames = OContactFields::untrphonefields(); | 94 | slChooserNames = OContactFields::untrphonefields(); |
92 | slDynamicEntries = OContactFields::untrdetailsfields(); | 95 | slDynamicEntries = OContactFields::untrdetailsfields(); |
93 | trlDynamicEntries = OContactFields::trdetailsfields(); | 96 | trlDynamicEntries = OContactFields::trdetailsfields(); |
94 | for (i = 0; i < slChooserNames.count(); i++) | 97 | for (i = 0; i < slChooserNames.count(); i++) |
95 | slChooserValues.append(""); | 98 | slChooserValues.append(""); |
@@ -610,49 +613,49 @@ void ContactEditor::init() { | |||
610 | connect( cmbChooserField2, SIGNAL(activated(int)), | 613 | connect( cmbChooserField2, SIGNAL(activated(int)), |
611 | this, SLOT(slotCmbChooser2Change(int)) ); | 614 | this, SLOT(slotCmbChooser2Change(int)) ); |
612 | connect( cmbChooserField3, SIGNAL(activated(int)), | 615 | connect( cmbChooserField3, SIGNAL(activated(int)), |
613 | this, SLOT(slotCmbChooser3Change(int)) ); | 616 | this, SLOT(slotCmbChooser3Change(int)) ); |
614 | connect( cmbChooserField4, SIGNAL(activated(int)), | 617 | connect( cmbChooserField4, SIGNAL(activated(int)), |
615 | this, SLOT(slotCmbChooser4Change(int)) ); | 618 | this, SLOT(slotCmbChooser4Change(int)) ); |
616 | connect( cmbAddress, SIGNAL(activated(int)), | 619 | connect( cmbAddress, SIGNAL(activated(int)), |
617 | this, SLOT(slotAddressTypeChange(int)) ); | 620 | this, SLOT(slotAddressTypeChange(int)) ); |
618 | 621 | ||
619 | new QPEDialogListener(this); | 622 | new QPEDialogListener(this); |
620 | 623 | ||
621 | setPersonalView ( m_personalView ); | 624 | setPersonalView ( m_personalView ); |
622 | } | 625 | } |
623 | 626 | ||
624 | void ContactEditor::defaultEmailChanged(int i){ | 627 | void ContactEditor::defaultEmailChanged(int i){ |
625 | qDebug("defaultEmailChanged"); | 628 | qDebug("defaultEmailChanged"); |
626 | int index = cmbChooserField1->currentItem(); | 629 | int index = cmbChooserField1->currentItem(); |
627 | slChooserValues[index] = cmbDefaultEmail->text(i); | 630 | slChooserValues[index] = cmbDefaultEmail->text(i); |
628 | 631 | ||
629 | } | 632 | } |
630 | 633 | ||
631 | void ContactEditor::chooserChange( const QString &textChanged, int index, QLineEdit *inputWid ) { | 634 | void ContactEditor::chooserChange( const QString &textChanged, int index, QLineEdit *inputWid ) { |
632 | 635 | ||
633 | if (slChooserNames[index] == "Default Email"){ | 636 | if (slChooserNames[index] == "Default Email"){ |
634 | delete cmbDefaultEmail; | 637 | if (cmbDefaultEmail) delete cmbDefaultEmail; |
635 | cmbDefaultEmail = new QComboBox(inputWid->parentWidget()); | 638 | cmbDefaultEmail = new QComboBox(inputWid->parentWidget()); |
636 | cmbDefaultEmail->setGeometry(inputWid->frameGeometry()); | 639 | cmbDefaultEmail->setGeometry(inputWid->frameGeometry()); |
637 | cmbDefaultEmail->insertStringList(ent.emailList()); | 640 | cmbDefaultEmail->insertStringList(ent.emailList()); |
638 | connect(cmbDefaultEmail,SIGNAL(activated(int)), | 641 | connect(cmbDefaultEmail,SIGNAL(activated(int)), |
639 | SLOT(defaultEmailChanged(int))); | 642 | SLOT(defaultEmailChanged(int))); |
640 | QString demail = ent.defaultEmail(); | 643 | QString demail = ent.defaultEmail(); |
641 | for ( int i = 0; i < cmbDefaultEmail->count(); i++) | 644 | for ( int i = 0; i < cmbDefaultEmail->count(); i++) |
642 | if ( cmbDefaultEmail->text( i ) == demail ) | 645 | if ( cmbDefaultEmail->text( i ) == demail ) |
643 | cmbDefaultEmail->setCurrentItem( i ); | 646 | cmbDefaultEmail->setCurrentItem( i ); |
644 | 647 | ||
645 | cmbDefaultEmail->show(); | 648 | cmbDefaultEmail->show(); |
646 | } | 649 | } |
647 | 650 | ||
648 | 651 | ||
649 | slChooserValues[index] = textChanged; | 652 | slChooserValues[index] = textChanged; |
650 | 653 | ||
651 | } | 654 | } |
652 | 655 | ||
653 | void ContactEditor::slotChooser1Change( const QString &textChanged ) { | 656 | void ContactEditor::slotChooser1Change( const QString &textChanged ) { |
654 | chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1); | 657 | chooserChange( textChanged, cmbChooserField1->currentItem(), txtChooserField1); |
655 | } | 658 | } |
656 | 659 | ||
657 | void ContactEditor::slotChooser2Change( const QString &textChanged ) { | 660 | void ContactEditor::slotChooser2Change( const QString &textChanged ) { |
658 | chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2); | 661 | chooserChange( textChanged, cmbChooserField2->currentItem(), txtChooserField2); |