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 | |||
@@ -1,1146 +1,1149 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2002 Michael R. Crawford <mike@tuxnami.org> | 2 | * Copyright (c) 2002 Michael R. Crawford <mike@tuxnami.org> |
3 | * Copyright (C) 2002 by Stefan Eilers (eilers.stefan@epost.de) | 3 | * Copyright (C) 2002 by Stefan Eilers (eilers.stefan@epost.de) |
4 | * | 4 | * |
5 | * This file is an add-on for the OPIE Palmtop Environment | 5 | * This file is an add-on for the OPIE Palmtop Environment |
6 | * | 6 | * |
7 | * This file may be distributed and/or modified under the terms of the | 7 | * This file may be distributed and/or modified under the terms of the |
8 | * GNU General Public License version 2 as published by the Free Software | 8 | * GNU General Public License version 2 as published by the Free Software |
9 | * Foundation and appearing in the file LICENSE.GPL included in the pacakaging | 9 | * Foundation and appearing in the file LICENSE.GPL included in the pacakaging |
10 | * of this file. | 10 | * of this file. |
11 | * | 11 | * |
12 | * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 12 | * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
13 | * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 13 | * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
14 | * | 14 | * |
15 | * | 15 | * |
16 | * This is a rewrite of the abeditor.h file, modified to provide a more | 16 | * This is a rewrite of the abeditor.h file, modified to provide a more |
17 | * intuitive interface to TrollTech's original Address Book editor. This | 17 | * intuitive interface to TrollTech's original Address Book editor. This |
18 | * is made to operate exactly in interface with the exception of name. | 18 | * is made to operate exactly in interface with the exception of name. |
19 | * | 19 | * |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #include "contacteditor.h" | 22 | #include "contacteditor.h" |
23 | #include "addresspicker.h" | 23 | #include "addresspicker.h" |
24 | #include "ocontactfields.h" | 24 | #include "ocontactfields.h" |
25 | 25 | ||
26 | #include <qpe/categoryselect.h> | 26 | #include <qpe/categoryselect.h> |
27 | #include <qpe/qpeapplication.h> | 27 | #include <qpe/qpeapplication.h> |
28 | #include <qpe/qpedialog.h> | 28 | #include <qpe/qpedialog.h> |
29 | #include <qpe/timeconversion.h> | 29 | #include <qpe/timeconversion.h> |
30 | #include <opie/ocontact.h> | 30 | #include <opie/ocontact.h> |
31 | #include <qpe/resource.h> | 31 | #include <qpe/resource.h> |
32 | 32 | ||
33 | #include <qcombobox.h> | 33 | #include <qcombobox.h> |
34 | #include <qlabel.h> | 34 | #include <qlabel.h> |
35 | #include <qtabwidget.h> | 35 | #include <qtabwidget.h> |
36 | #include <qlayout.h> | 36 | #include <qlayout.h> |
37 | #include <qlineedit.h> | 37 | #include <qlineedit.h> |
38 | #include <qmultilineedit.h> | 38 | #include <qmultilineedit.h> |
39 | #include <qscrollview.h> | 39 | #include <qscrollview.h> |
40 | #include <qtoolbutton.h> | 40 | #include <qtoolbutton.h> |
41 | #include <qpushbutton.h> | 41 | #include <qpushbutton.h> |
42 | #include <qmainwindow.h> | 42 | #include <qmainwindow.h> |
43 | #include <qvaluelist.h> | 43 | #include <qvaluelist.h> |
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(""); |
96 | 99 | ||
97 | 100 | ||
98 | QVBoxLayout *vb = new QVBoxLayout( this ); | 101 | QVBoxLayout *vb = new QVBoxLayout( this ); |
99 | 102 | ||
100 | tabMain = new QTabWidget( this ); | 103 | tabMain = new QTabWidget( this ); |
101 | vb->addWidget( tabMain ); | 104 | vb->addWidget( tabMain ); |
102 | 105 | ||
103 | QWidget *tabViewport = new QWidget ( tabMain ); | 106 | QWidget *tabViewport = new QWidget ( tabMain ); |
104 | 107 | ||
105 | vb = new QVBoxLayout( tabViewport ); | 108 | vb = new QVBoxLayout( tabViewport ); |
106 | 109 | ||
107 | svGeneral = new QScrollView( tabViewport ); | 110 | svGeneral = new QScrollView( tabViewport ); |
108 | vb->addWidget( svGeneral, 0, 0 ); | 111 | vb->addWidget( svGeneral, 0, 0 ); |
109 | svGeneral->setResizePolicy( QScrollView::AutoOneFit ); | 112 | svGeneral->setResizePolicy( QScrollView::AutoOneFit ); |
110 | svGeneral->setFrameStyle( QFrame::NoFrame ); | 113 | svGeneral->setFrameStyle( QFrame::NoFrame ); |
111 | 114 | ||
112 | QWidget *container = new QWidget( svGeneral->viewport() ); | 115 | QWidget *container = new QWidget( svGeneral->viewport() ); |
113 | svGeneral->addChild( container ); | 116 | svGeneral->addChild( container ); |
114 | 117 | ||
115 | QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 ); | 118 | QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 ); |
116 | gl->setResizeMode( QLayout::FreeResize ); | 119 | gl->setResizeMode( QLayout::FreeResize ); |
117 | 120 | ||
118 | btnFullName = new QPushButton( tr( "Full Name..." ), container ); | 121 | btnFullName = new QPushButton( tr( "Full Name..." ), container ); |
119 | gl->addWidget( btnFullName, 0, 0 ); | 122 | gl->addWidget( btnFullName, 0, 0 ); |
120 | txtFullName = new QLineEdit( container ); | 123 | txtFullName = new QLineEdit( container ); |
121 | gl->addWidget( txtFullName, 0, 1 ); | 124 | gl->addWidget( txtFullName, 0, 1 ); |
122 | 125 | ||
123 | QLabel *l = new QLabel( tr( "Job Title" ), container ); | 126 | QLabel *l = new QLabel( tr( "Job Title" ), container ); |
124 | gl->addWidget( l, 1, 0 ); | 127 | gl->addWidget( l, 1, 0 ); |
125 | txtJobTitle = new QLineEdit( container ); | 128 | txtJobTitle = new QLineEdit( container ); |
126 | gl->addWidget( txtJobTitle, 1, 1 ); | 129 | gl->addWidget( txtJobTitle, 1, 1 ); |
127 | 130 | ||
128 | l = new QLabel( tr( "Organization" ), container ); | 131 | l = new QLabel( tr( "Organization" ), container ); |
129 | gl->addWidget( l, 2, 0 ); | 132 | gl->addWidget( l, 2, 0 ); |
130 | txtOrganization = new QLineEdit( container ); | 133 | txtOrganization = new QLineEdit( container ); |
131 | gl->addWidget( txtOrganization, 2, 1 ); | 134 | gl->addWidget( txtOrganization, 2, 1 ); |
132 | 135 | ||
133 | cmbChooserField1 = new QComboBox( FALSE, container ); | 136 | cmbChooserField1 = new QComboBox( FALSE, container ); |
134 | cmbChooserField1->setMaximumWidth( 90 ); | 137 | cmbChooserField1->setMaximumWidth( 90 ); |
135 | gl->addWidget( cmbChooserField1, 3, 0 ); | 138 | gl->addWidget( cmbChooserField1, 3, 0 ); |
136 | txtChooserField1 = new QLineEdit( container ); | 139 | txtChooserField1 = new QLineEdit( container ); |
137 | gl->addWidget( txtChooserField1, 3, 1 ); | 140 | gl->addWidget( txtChooserField1, 3, 1 ); |
138 | 141 | ||
139 | cmbChooserField2 = new QComboBox( FALSE, container ); | 142 | cmbChooserField2 = new QComboBox( FALSE, container ); |
140 | cmbChooserField2->setMaximumWidth( 90 ); | 143 | cmbChooserField2->setMaximumWidth( 90 ); |
141 | gl->addWidget( cmbChooserField2, 4, 0 ); | 144 | gl->addWidget( cmbChooserField2, 4, 0 ); |
142 | txtChooserField2 = new QLineEdit( container ); | 145 | txtChooserField2 = new QLineEdit( container ); |
143 | gl->addWidget( txtChooserField2, 4, 1 ); | 146 | gl->addWidget( txtChooserField2, 4, 1 ); |
144 | 147 | ||
145 | cmbChooserField3 = new QComboBox( FALSE, container ); | 148 | cmbChooserField3 = new QComboBox( FALSE, container ); |
146 | cmbChooserField3->setMaximumWidth( 90 ); | 149 | cmbChooserField3->setMaximumWidth( 90 ); |
147 | gl->addWidget( cmbChooserField3, 5, 0 ); | 150 | gl->addWidget( cmbChooserField3, 5, 0 ); |
148 | txtChooserField3 = new QLineEdit( container ); | 151 | txtChooserField3 = new QLineEdit( container ); |
149 | gl->addWidget( txtChooserField3, 5, 1 ); | 152 | gl->addWidget( txtChooserField3, 5, 1 ); |
150 | 153 | ||
151 | l = new QLabel( tr( "File As" ), container ); | 154 | l = new QLabel( tr( "File As" ), container ); |
152 | gl->addWidget( l, 6, 0 ); | 155 | gl->addWidget( l, 6, 0 ); |
153 | cmbFileAs = new QComboBox( TRUE, container ); | 156 | cmbFileAs = new QComboBox( TRUE, container ); |
154 | gl->addWidget( cmbFileAs, 6, 1 ); | 157 | gl->addWidget( cmbFileAs, 6, 1 ); |
155 | 158 | ||
156 | labCat = new QLabel( tr( "Category" ), container ); | 159 | labCat = new QLabel( tr( "Category" ), container ); |
157 | gl->addWidget( labCat, 7, 0 ); | 160 | gl->addWidget( labCat, 7, 0 ); |
158 | cmbCat = new CategorySelect( container ); | 161 | cmbCat = new CategorySelect( container ); |
159 | gl->addWidget( cmbCat, 7, 1 ); | 162 | gl->addWidget( cmbCat, 7, 1 ); |
160 | labCat->show(); | 163 | labCat->show(); |
161 | cmbCat->show(); | 164 | cmbCat->show(); |
162 | 165 | ||
163 | btnNote = new QPushButton( tr( "Notes..." ), container ); | 166 | btnNote = new QPushButton( tr( "Notes..." ), container ); |
164 | gl->addWidget( btnNote, 8, 1 ); | 167 | gl->addWidget( btnNote, 8, 1 ); |
165 | 168 | ||
166 | tabMain->insertTab( tabViewport, tr( "General" ) ); | 169 | tabMain->insertTab( tabViewport, tr( "General" ) ); |
167 | 170 | ||
168 | tabViewport = new QWidget ( tabMain ); | 171 | tabViewport = new QWidget ( tabMain ); |
169 | 172 | ||
170 | vb = new QVBoxLayout( tabViewport ); | 173 | vb = new QVBoxLayout( tabViewport ); |
171 | 174 | ||
172 | svAddress = new QScrollView( tabViewport ); | 175 | svAddress = new QScrollView( tabViewport ); |
173 | vb->addWidget( svAddress, 0, 0 ); | 176 | vb->addWidget( svAddress, 0, 0 ); |
174 | svAddress->setResizePolicy( QScrollView::AutoOneFit ); | 177 | svAddress->setResizePolicy( QScrollView::AutoOneFit ); |
175 | svAddress->setFrameStyle( QFrame::NoFrame ); | 178 | svAddress->setFrameStyle( QFrame::NoFrame ); |
176 | 179 | ||
177 | container = new QWidget( svAddress->viewport() ); | 180 | container = new QWidget( svAddress->viewport() ); |
178 | svAddress->addChild( container ); | 181 | svAddress->addChild( container ); |
179 | 182 | ||
180 | gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem | 183 | gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem |
181 | 184 | ||
182 | cmbAddress = new QComboBox( FALSE, container ); | 185 | cmbAddress = new QComboBox( FALSE, container ); |
183 | cmbAddress->insertItem( tr( "Business" ) ); | 186 | cmbAddress->insertItem( tr( "Business" ) ); |
184 | cmbAddress->insertItem( tr( "Home" ) ); | 187 | cmbAddress->insertItem( tr( "Home" ) ); |
185 | gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 ); | 188 | gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 ); |
186 | 189 | ||
187 | l = new QLabel( tr( "Address" ), container ); | 190 | l = new QLabel( tr( "Address" ), container ); |
188 | gl->addWidget( l, 1, 0 ); | 191 | gl->addWidget( l, 1, 0 ); |
189 | txtAddress = new QLineEdit( container ); | 192 | txtAddress = new QLineEdit( container ); |
190 | gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 ); | 193 | gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 ); |
191 | 194 | ||
192 | l = new QLabel( tr( "City" ), container ); | 195 | l = new QLabel( tr( "City" ), container ); |
193 | gl->addWidget( l, 2, 0 ); | 196 | gl->addWidget( l, 2, 0 ); |
194 | txtCity = new QLineEdit( container ); | 197 | txtCity = new QLineEdit( container ); |
195 | gl->addMultiCellWidget( txtCity, 2, 2, 1, 2 ); | 198 | gl->addMultiCellWidget( txtCity, 2, 2, 1, 2 ); |
196 | 199 | ||
197 | l = new QLabel( tr( "State" ), container ); | 200 | l = new QLabel( tr( "State" ), container ); |
198 | gl->addWidget( l, 3, 0 ); | 201 | gl->addWidget( l, 3, 0 ); |
199 | txtState = new QLineEdit( container ); | 202 | txtState = new QLineEdit( container ); |
200 | gl->addMultiCellWidget( txtState, 3, 3, 1, 2 ); | 203 | gl->addMultiCellWidget( txtState, 3, 3, 1, 2 ); |
201 | 204 | ||
202 | l = new QLabel( tr( "Zip Code" ), container ); | 205 | l = new QLabel( tr( "Zip Code" ), container ); |
203 | gl->addWidget( l, 4, 0 ); | 206 | gl->addWidget( l, 4, 0 ); |
204 | txtZip = new QLineEdit( container ); | 207 | txtZip = new QLineEdit( container ); |
205 | gl->addMultiCellWidget( txtZip, 4, 4, 1, 2 ); | 208 | gl->addMultiCellWidget( txtZip, 4, 4, 1, 2 ); |
206 | 209 | ||
207 | l = new QLabel( tr( "Country" ), container ); | 210 | l = new QLabel( tr( "Country" ), container ); |
208 | gl->addWidget( l, 5, 0 ); | 211 | gl->addWidget( l, 5, 0 ); |
209 | cmbCountry = new QComboBox( TRUE, container ); | 212 | cmbCountry = new QComboBox( TRUE, container ); |
210 | cmbCountry->insertItem( tr( "" ) ); | 213 | cmbCountry->insertItem( tr( "" ) ); |
211 | cmbCountry->insertItem( tr ( "United States" ) ); | 214 | cmbCountry->insertItem( tr ( "United States" ) ); |
212 | cmbCountry->insertItem( tr ( "United Kingdom" ) ); | 215 | cmbCountry->insertItem( tr ( "United Kingdom" ) ); |
213 | cmbCountry->insertItem( tr ( "Afganistan" ) ); | 216 | cmbCountry->insertItem( tr ( "Afganistan" ) ); |
214 | cmbCountry->insertItem( tr ( "Albania" ) ); | 217 | cmbCountry->insertItem( tr ( "Albania" ) ); |
215 | cmbCountry->insertItem( tr ( "Algeria" ) ); | 218 | cmbCountry->insertItem( tr ( "Algeria" ) ); |
216 | cmbCountry->insertItem( tr ( "American Samoa" ) ); | 219 | cmbCountry->insertItem( tr ( "American Samoa" ) ); |
217 | cmbCountry->insertItem( tr ( "Andorra" ) ); | 220 | cmbCountry->insertItem( tr ( "Andorra" ) ); |
218 | cmbCountry->insertItem( tr ( "Angola" ) ); | 221 | cmbCountry->insertItem( tr ( "Angola" ) ); |
219 | cmbCountry->insertItem( tr ( "Anguilla" ) ); | 222 | cmbCountry->insertItem( tr ( "Anguilla" ) ); |
220 | cmbCountry->insertItem( tr ( "Antartica" ) ); | 223 | cmbCountry->insertItem( tr ( "Antartica" ) ); |
221 | cmbCountry->insertItem( tr ( "Argentina" ) ); | 224 | cmbCountry->insertItem( tr ( "Argentina" ) ); |
222 | cmbCountry->insertItem( tr ( "Armania" ) ); | 225 | cmbCountry->insertItem( tr ( "Armania" ) ); |
223 | cmbCountry->insertItem( tr ( "Aruba" ) ); | 226 | cmbCountry->insertItem( tr ( "Aruba" ) ); |
224 | cmbCountry->insertItem( tr ( "Australia" ) ); | 227 | cmbCountry->insertItem( tr ( "Australia" ) ); |
225 | cmbCountry->insertItem( tr ( "Austria" ) ); | 228 | cmbCountry->insertItem( tr ( "Austria" ) ); |
226 | cmbCountry->insertItem( tr ( "Azerbaijan" ) ); | 229 | cmbCountry->insertItem( tr ( "Azerbaijan" ) ); |
227 | cmbCountry->insertItem( tr ( "Bahamas" ) ); | 230 | cmbCountry->insertItem( tr ( "Bahamas" ) ); |
228 | cmbCountry->insertItem( tr ( "Bahrain" ) ); | 231 | cmbCountry->insertItem( tr ( "Bahrain" ) ); |
229 | cmbCountry->insertItem( tr ( "Bangladesh" ) ); | 232 | cmbCountry->insertItem( tr ( "Bangladesh" ) ); |
230 | cmbCountry->insertItem( tr ( "Barbados" ) ); | 233 | cmbCountry->insertItem( tr ( "Barbados" ) ); |
231 | cmbCountry->insertItem( tr ( "Belarus" ) ); | 234 | cmbCountry->insertItem( tr ( "Belarus" ) ); |
232 | cmbCountry->insertItem( tr ( "Belgium" ) ); | 235 | cmbCountry->insertItem( tr ( "Belgium" ) ); |
233 | cmbCountry->insertItem( tr ( "Belize" ) ); | 236 | cmbCountry->insertItem( tr ( "Belize" ) ); |
234 | cmbCountry->insertItem( tr ( "Benin" ) ); | 237 | cmbCountry->insertItem( tr ( "Benin" ) ); |
235 | cmbCountry->insertItem( tr ( "Bermuda" ) ); | 238 | cmbCountry->insertItem( tr ( "Bermuda" ) ); |
236 | cmbCountry->insertItem( tr ( "Bhutan" ) ); | 239 | cmbCountry->insertItem( tr ( "Bhutan" ) ); |
237 | cmbCountry->insertItem( tr ( "Boliva" ) ); | 240 | cmbCountry->insertItem( tr ( "Boliva" ) ); |
238 | cmbCountry->insertItem( tr ( "Botswana" ) ); | 241 | cmbCountry->insertItem( tr ( "Botswana" ) ); |
239 | cmbCountry->insertItem( tr ( "Bouvet Island" ) ); | 242 | cmbCountry->insertItem( tr ( "Bouvet Island" ) ); |
240 | cmbCountry->insertItem( tr ( "Brazil" ) ); | 243 | cmbCountry->insertItem( tr ( "Brazil" ) ); |
241 | cmbCountry->insertItem( tr ( "Brunei Darussalam" ) ); | 244 | cmbCountry->insertItem( tr ( "Brunei Darussalam" ) ); |
242 | cmbCountry->insertItem( tr ( "Bulgaria" ) ); | 245 | cmbCountry->insertItem( tr ( "Bulgaria" ) ); |
243 | cmbCountry->insertItem( tr ( "Burkina Faso" ) ); | 246 | cmbCountry->insertItem( tr ( "Burkina Faso" ) ); |
244 | cmbCountry->insertItem( tr ( "Burundi" ) ); | 247 | cmbCountry->insertItem( tr ( "Burundi" ) ); |
245 | cmbCountry->insertItem( tr ( "Cambodia" ) ); | 248 | cmbCountry->insertItem( tr ( "Cambodia" ) ); |
246 | cmbCountry->insertItem( tr ( "Camaroon" ) ); | 249 | cmbCountry->insertItem( tr ( "Camaroon" ) ); |
247 | cmbCountry->insertItem( tr ( "Canada" ) ); | 250 | cmbCountry->insertItem( tr ( "Canada" ) ); |
248 | cmbCountry->insertItem( tr ( "Cape Verde" ) ); | 251 | cmbCountry->insertItem( tr ( "Cape Verde" ) ); |
249 | cmbCountry->insertItem( tr ( "Cayman Islands" ) ); | 252 | cmbCountry->insertItem( tr ( "Cayman Islands" ) ); |
250 | cmbCountry->insertItem( tr ( "Chad" ) ); | 253 | cmbCountry->insertItem( tr ( "Chad" ) ); |
251 | cmbCountry->insertItem( tr ( "Chile" ) ); | 254 | cmbCountry->insertItem( tr ( "Chile" ) ); |
252 | cmbCountry->insertItem( tr ( "China" ) ); | 255 | cmbCountry->insertItem( tr ( "China" ) ); |
253 | cmbCountry->insertItem( tr ( "Christmas Island" ) ); | 256 | cmbCountry->insertItem( tr ( "Christmas Island" ) ); |
254 | cmbCountry->insertItem( tr ( "Colombia" ) ); | 257 | cmbCountry->insertItem( tr ( "Colombia" ) ); |
255 | cmbCountry->insertItem( tr ( "Comoros" ) ); | 258 | cmbCountry->insertItem( tr ( "Comoros" ) ); |
256 | cmbCountry->insertItem( tr ( "Congo" ) ); | 259 | cmbCountry->insertItem( tr ( "Congo" ) ); |
257 | cmbCountry->insertItem( tr ( "Cook Island" ) ); | 260 | cmbCountry->insertItem( tr ( "Cook Island" ) ); |
258 | cmbCountry->insertItem( tr ( "Costa Rica" ) ); | 261 | cmbCountry->insertItem( tr ( "Costa Rica" ) ); |
259 | cmbCountry->insertItem( tr ( "Cote d'Ivoire" ) ); | 262 | cmbCountry->insertItem( tr ( "Cote d'Ivoire" ) ); |
260 | cmbCountry->insertItem( tr ( "Croatia" ) ); | 263 | cmbCountry->insertItem( tr ( "Croatia" ) ); |
261 | cmbCountry->insertItem( tr ( "Cuba" ) ); | 264 | cmbCountry->insertItem( tr ( "Cuba" ) ); |
262 | cmbCountry->insertItem( tr ( "Cyprus" ) ); | 265 | cmbCountry->insertItem( tr ( "Cyprus" ) ); |
263 | cmbCountry->insertItem( tr ( "Czech Republic" ) ); | 266 | cmbCountry->insertItem( tr ( "Czech Republic" ) ); |
264 | cmbCountry->insertItem( tr ( "Denmark" ) ); | 267 | cmbCountry->insertItem( tr ( "Denmark" ) ); |
265 | cmbCountry->insertItem( tr ( "Djibouti" ) ); | 268 | cmbCountry->insertItem( tr ( "Djibouti" ) ); |
266 | cmbCountry->insertItem( tr ( "Dominica" ) ); | 269 | cmbCountry->insertItem( tr ( "Dominica" ) ); |
267 | cmbCountry->insertItem( tr ( "Dominican Republic" ) ); | 270 | cmbCountry->insertItem( tr ( "Dominican Republic" ) ); |
268 | cmbCountry->insertItem( tr ( "East Timor" ) ); | 271 | cmbCountry->insertItem( tr ( "East Timor" ) ); |
269 | cmbCountry->insertItem( tr ( "Ecuador" ) ); | 272 | cmbCountry->insertItem( tr ( "Ecuador" ) ); |
270 | cmbCountry->insertItem( tr ( "Egypt" ) ); | 273 | cmbCountry->insertItem( tr ( "Egypt" ) ); |
271 | cmbCountry->insertItem( tr ( "El Salvador" ) ); | 274 | cmbCountry->insertItem( tr ( "El Salvador" ) ); |
272 | cmbCountry->insertItem( tr ( "Equatorial Guinea" ) ); | 275 | cmbCountry->insertItem( tr ( "Equatorial Guinea" ) ); |
273 | cmbCountry->insertItem( tr ( "Eritrea" ) ); | 276 | cmbCountry->insertItem( tr ( "Eritrea" ) ); |
274 | cmbCountry->insertItem( tr ( "Estonia" ) ); | 277 | cmbCountry->insertItem( tr ( "Estonia" ) ); |
275 | cmbCountry->insertItem( tr ( "Ethiopia" ) ); | 278 | cmbCountry->insertItem( tr ( "Ethiopia" ) ); |
276 | cmbCountry->insertItem( tr ( "Falkland Islands" ) ); | 279 | cmbCountry->insertItem( tr ( "Falkland Islands" ) ); |
277 | cmbCountry->insertItem( tr ( "Faroe Islands" ) ); | 280 | cmbCountry->insertItem( tr ( "Faroe Islands" ) ); |
278 | cmbCountry->insertItem( tr ( "Fiji" ) ); | 281 | cmbCountry->insertItem( tr ( "Fiji" ) ); |
279 | cmbCountry->insertItem( tr ( "Finland" ) ); | 282 | cmbCountry->insertItem( tr ( "Finland" ) ); |
280 | cmbCountry->insertItem( tr ( "France" ) ); | 283 | cmbCountry->insertItem( tr ( "France" ) ); |
281 | cmbCountry->insertItem( tr ( "French Guiana" ) ); | 284 | cmbCountry->insertItem( tr ( "French Guiana" ) ); |
282 | cmbCountry->insertItem( tr ( "French Polynesia" ) ); | 285 | cmbCountry->insertItem( tr ( "French Polynesia" ) ); |
283 | cmbCountry->insertItem( tr ( "Gabon" ) ); | 286 | cmbCountry->insertItem( tr ( "Gabon" ) ); |
284 | cmbCountry->insertItem( tr ( "Gambia" ) ); | 287 | cmbCountry->insertItem( tr ( "Gambia" ) ); |
285 | cmbCountry->insertItem( tr ( "Georgia" ) ); | 288 | cmbCountry->insertItem( tr ( "Georgia" ) ); |
286 | cmbCountry->insertItem( tr ( "Germany" ) ); | 289 | cmbCountry->insertItem( tr ( "Germany" ) ); |
287 | cmbCountry->insertItem( tr ( "Gahna" ) ); | 290 | cmbCountry->insertItem( tr ( "Gahna" ) ); |
288 | cmbCountry->insertItem( tr ( "Gibraltar" ) ); | 291 | cmbCountry->insertItem( tr ( "Gibraltar" ) ); |
289 | cmbCountry->insertItem( tr ( "Greece" ) ); | 292 | cmbCountry->insertItem( tr ( "Greece" ) ); |
290 | cmbCountry->insertItem( tr ( "Greenland" ) ); | 293 | cmbCountry->insertItem( tr ( "Greenland" ) ); |
291 | cmbCountry->insertItem( tr ( "Grenada" ) ); | 294 | cmbCountry->insertItem( tr ( "Grenada" ) ); |
292 | cmbCountry->insertItem( tr ( "Guadelupe" ) ); | 295 | cmbCountry->insertItem( tr ( "Guadelupe" ) ); |
293 | cmbCountry->insertItem( tr ( "Guam" ) ); | 296 | cmbCountry->insertItem( tr ( "Guam" ) ); |
294 | cmbCountry->insertItem( tr ( "Guatemala" ) ); | 297 | cmbCountry->insertItem( tr ( "Guatemala" ) ); |
295 | cmbCountry->insertItem( tr ( "Guinea" ) ); | 298 | cmbCountry->insertItem( tr ( "Guinea" ) ); |
296 | cmbCountry->insertItem( tr ( "Guinea-bissau" ) ); | 299 | cmbCountry->insertItem( tr ( "Guinea-bissau" ) ); |
297 | cmbCountry->insertItem( tr ( "Guyana" ) ); | 300 | cmbCountry->insertItem( tr ( "Guyana" ) ); |
298 | cmbCountry->insertItem( tr ( "Haiti" ) ); | 301 | cmbCountry->insertItem( tr ( "Haiti" ) ); |
299 | cmbCountry->insertItem( tr ( "Holy See" ) ); | 302 | cmbCountry->insertItem( tr ( "Holy See" ) ); |
300 | cmbCountry->insertItem( tr ( "Honduras" ) ); | 303 | cmbCountry->insertItem( tr ( "Honduras" ) ); |
301 | cmbCountry->insertItem( tr ( "Hong Kong" ) ); | 304 | cmbCountry->insertItem( tr ( "Hong Kong" ) ); |
302 | cmbCountry->insertItem( tr ( "Hungary" ) ); | 305 | cmbCountry->insertItem( tr ( "Hungary" ) ); |
303 | cmbCountry->insertItem( tr ( "Iceland" ) ); | 306 | cmbCountry->insertItem( tr ( "Iceland" ) ); |
304 | cmbCountry->insertItem( tr ( "India" ) ); | 307 | cmbCountry->insertItem( tr ( "India" ) ); |
305 | cmbCountry->insertItem( tr ( "Indonesia" ) ); | 308 | cmbCountry->insertItem( tr ( "Indonesia" ) ); |
306 | cmbCountry->insertItem( tr ( "Ireland" ) ); | 309 | cmbCountry->insertItem( tr ( "Ireland" ) ); |
307 | cmbCountry->insertItem( tr ( "Israel" ) ); | 310 | cmbCountry->insertItem( tr ( "Israel" ) ); |
308 | cmbCountry->insertItem( tr ( "Italy" ) ); | 311 | cmbCountry->insertItem( tr ( "Italy" ) ); |
309 | cmbCountry->insertItem( tr ( "Jamacia" ) ); | 312 | cmbCountry->insertItem( tr ( "Jamacia" ) ); |
310 | cmbCountry->insertItem( tr ( "Japan" ) ); | 313 | cmbCountry->insertItem( tr ( "Japan" ) ); |
311 | cmbCountry->insertItem( tr ( "Jordan" ) ); | 314 | cmbCountry->insertItem( tr ( "Jordan" ) ); |
312 | cmbCountry->insertItem( tr ( "Kazakhstan" ) ); | 315 | cmbCountry->insertItem( tr ( "Kazakhstan" ) ); |
313 | cmbCountry->insertItem( tr ( "Kenya" ) ); | 316 | cmbCountry->insertItem( tr ( "Kenya" ) ); |
314 | cmbCountry->insertItem( tr ( "Kribati" ) ); | 317 | cmbCountry->insertItem( tr ( "Kribati" ) ); |
315 | cmbCountry->insertItem( tr ( "Korea" ) ); | 318 | cmbCountry->insertItem( tr ( "Korea" ) ); |
316 | cmbCountry->insertItem( tr ( "Kuwait" ) ); | 319 | cmbCountry->insertItem( tr ( "Kuwait" ) ); |
317 | cmbCountry->insertItem( tr ( "Kyrgystan" ) ); | 320 | cmbCountry->insertItem( tr ( "Kyrgystan" ) ); |
318 | cmbCountry->insertItem( tr ( "Laos" ) ); | 321 | cmbCountry->insertItem( tr ( "Laos" ) ); |
319 | cmbCountry->insertItem( tr ( "Latvia" ) ); | 322 | cmbCountry->insertItem( tr ( "Latvia" ) ); |
320 | cmbCountry->insertItem( tr ( "Lebanon" ) ); | 323 | cmbCountry->insertItem( tr ( "Lebanon" ) ); |
321 | cmbCountry->insertItem( tr ( "Lesotho" ) ); | 324 | cmbCountry->insertItem( tr ( "Lesotho" ) ); |
322 | cmbCountry->insertItem( tr ( "Liberia" ) ); | 325 | cmbCountry->insertItem( tr ( "Liberia" ) ); |
323 | cmbCountry->insertItem( tr ( "Liechtenstein" ) ); | 326 | cmbCountry->insertItem( tr ( "Liechtenstein" ) ); |
324 | cmbCountry->insertItem( tr ( "Lithuania" ) ); | 327 | cmbCountry->insertItem( tr ( "Lithuania" ) ); |
325 | cmbCountry->insertItem( tr ( "Luxembourg" ) ); | 328 | cmbCountry->insertItem( tr ( "Luxembourg" ) ); |
326 | cmbCountry->insertItem( tr ( "Macau" ) ); | 329 | cmbCountry->insertItem( tr ( "Macau" ) ); |
327 | cmbCountry->insertItem( tr ( "Macedonia" ) ); | 330 | cmbCountry->insertItem( tr ( "Macedonia" ) ); |
328 | cmbCountry->insertItem( tr ( "Madagascar" ) ); | 331 | cmbCountry->insertItem( tr ( "Madagascar" ) ); |
329 | cmbCountry->insertItem( tr ( "Malawi" ) ); | 332 | cmbCountry->insertItem( tr ( "Malawi" ) ); |
330 | cmbCountry->insertItem( tr ( "Malaysia" ) ); | 333 | cmbCountry->insertItem( tr ( "Malaysia" ) ); |
331 | cmbCountry->insertItem( tr ( "Maldives" ) ); | 334 | cmbCountry->insertItem( tr ( "Maldives" ) ); |
332 | cmbCountry->insertItem( tr ( "Mali" ) ); | 335 | cmbCountry->insertItem( tr ( "Mali" ) ); |
333 | cmbCountry->insertItem( tr ( "Malta" ) ); | 336 | cmbCountry->insertItem( tr ( "Malta" ) ); |
334 | cmbCountry->insertItem( tr ( "Martinique" ) ); | 337 | cmbCountry->insertItem( tr ( "Martinique" ) ); |
335 | cmbCountry->insertItem( tr ( "Mauritania" ) ); | 338 | cmbCountry->insertItem( tr ( "Mauritania" ) ); |
336 | cmbCountry->insertItem( tr ( "Mauritius" ) ); | 339 | cmbCountry->insertItem( tr ( "Mauritius" ) ); |
337 | cmbCountry->insertItem( tr ( "Mayotte" ) ); | 340 | cmbCountry->insertItem( tr ( "Mayotte" ) ); |
338 | cmbCountry->insertItem( tr ( "Mexico" ) ); | 341 | cmbCountry->insertItem( tr ( "Mexico" ) ); |
339 | cmbCountry->insertItem( tr ( "Micronesia" ) ); | 342 | cmbCountry->insertItem( tr ( "Micronesia" ) ); |
340 | cmbCountry->insertItem( tr ( "Moldova" ) ); | 343 | cmbCountry->insertItem( tr ( "Moldova" ) ); |
341 | cmbCountry->insertItem( tr ( "Monaco" ) ); | 344 | cmbCountry->insertItem( tr ( "Monaco" ) ); |
342 | cmbCountry->insertItem( tr ( "Mongolia" ) ); | 345 | cmbCountry->insertItem( tr ( "Mongolia" ) ); |
343 | cmbCountry->insertItem( tr ( "Montserrat" ) ); | 346 | cmbCountry->insertItem( tr ( "Montserrat" ) ); |
344 | cmbCountry->insertItem( tr ( "Morocco" ) ); | 347 | cmbCountry->insertItem( tr ( "Morocco" ) ); |
345 | cmbCountry->insertItem( tr ( "Mozambique" ) ); | 348 | cmbCountry->insertItem( tr ( "Mozambique" ) ); |
346 | cmbCountry->insertItem( tr ( "Myanmar" ) ); | 349 | cmbCountry->insertItem( tr ( "Myanmar" ) ); |
347 | cmbCountry->insertItem( tr ( "Namibia" ) ); | 350 | cmbCountry->insertItem( tr ( "Namibia" ) ); |
348 | cmbCountry->insertItem( tr ( "Nauru" ) ); | 351 | cmbCountry->insertItem( tr ( "Nauru" ) ); |
349 | cmbCountry->insertItem( tr ( "Nepal" ) ); | 352 | cmbCountry->insertItem( tr ( "Nepal" ) ); |
350 | cmbCountry->insertItem( tr ( "Netherlands" ) ); | 353 | cmbCountry->insertItem( tr ( "Netherlands" ) ); |
351 | cmbCountry->insertItem( tr ( "New Caledonia" ) ); | 354 | cmbCountry->insertItem( tr ( "New Caledonia" ) ); |
352 | cmbCountry->insertItem( tr ( "New Zealand" ) ); | 355 | cmbCountry->insertItem( tr ( "New Zealand" ) ); |
353 | cmbCountry->insertItem( tr ( "Nicaragua" ) ); | 356 | cmbCountry->insertItem( tr ( "Nicaragua" ) ); |
354 | cmbCountry->insertItem( tr ( "Niger" ) ); | 357 | cmbCountry->insertItem( tr ( "Niger" ) ); |
355 | cmbCountry->insertItem( tr ( "Nigeria" ) ); | 358 | cmbCountry->insertItem( tr ( "Nigeria" ) ); |
356 | cmbCountry->insertItem( tr ( "Niue" ) ); | 359 | cmbCountry->insertItem( tr ( "Niue" ) ); |
357 | cmbCountry->insertItem( tr ( "Norway" ) ); | 360 | cmbCountry->insertItem( tr ( "Norway" ) ); |
358 | cmbCountry->insertItem( tr ( "Oman" ) ); | 361 | cmbCountry->insertItem( tr ( "Oman" ) ); |
359 | cmbCountry->insertItem( tr ( "Pakistan" ) ); | 362 | cmbCountry->insertItem( tr ( "Pakistan" ) ); |
360 | cmbCountry->insertItem( tr ( "Palau" ) ); | 363 | cmbCountry->insertItem( tr ( "Palau" ) ); |
361 | cmbCountry->insertItem( tr ( "Palestinian Territory" ) ); | 364 | cmbCountry->insertItem( tr ( "Palestinian Territory" ) ); |
362 | cmbCountry->insertItem( tr ( "Panama" ) ); | 365 | cmbCountry->insertItem( tr ( "Panama" ) ); |
363 | cmbCountry->insertItem( tr ( "Papua New Guinea" ) ); | 366 | cmbCountry->insertItem( tr ( "Papua New Guinea" ) ); |
364 | cmbCountry->insertItem( tr ( "Paraguay" ) ); | 367 | cmbCountry->insertItem( tr ( "Paraguay" ) ); |
365 | cmbCountry->insertItem( tr ( "Peru" ) ); | 368 | cmbCountry->insertItem( tr ( "Peru" ) ); |
366 | cmbCountry->insertItem( tr ( "Philippines" ) ); | 369 | cmbCountry->insertItem( tr ( "Philippines" ) ); |
367 | cmbCountry->insertItem( tr ( "Pitcairn" ) ); | 370 | cmbCountry->insertItem( tr ( "Pitcairn" ) ); |
368 | cmbCountry->insertItem( tr ( "Poland" ) ); | 371 | cmbCountry->insertItem( tr ( "Poland" ) ); |
369 | cmbCountry->insertItem( tr ( "Portugal" ) ); | 372 | cmbCountry->insertItem( tr ( "Portugal" ) ); |
370 | cmbCountry->insertItem( tr ( "Puerto Rico" ) ); | 373 | cmbCountry->insertItem( tr ( "Puerto Rico" ) ); |
371 | cmbCountry->insertItem( tr ( "Qatar" ) ); | 374 | cmbCountry->insertItem( tr ( "Qatar" ) ); |
372 | cmbCountry->insertItem( tr ( "Reunion" ) ); | 375 | cmbCountry->insertItem( tr ( "Reunion" ) ); |
373 | cmbCountry->insertItem( tr ( "Romania" ) ); | 376 | cmbCountry->insertItem( tr ( "Romania" ) ); |
374 | cmbCountry->insertItem( tr ( "Russia" ) ); | 377 | cmbCountry->insertItem( tr ( "Russia" ) ); |
375 | cmbCountry->insertItem( tr ( "Rwanda" ) ); | 378 | cmbCountry->insertItem( tr ( "Rwanda" ) ); |
376 | cmbCountry->insertItem( tr ( "Saint Lucia" ) ); | 379 | cmbCountry->insertItem( tr ( "Saint Lucia" ) ); |
377 | cmbCountry->insertItem( tr ( "Samoa" ) ); | 380 | cmbCountry->insertItem( tr ( "Samoa" ) ); |
378 | cmbCountry->insertItem( tr ( "San Marino" ) ); | 381 | cmbCountry->insertItem( tr ( "San Marino" ) ); |
379 | cmbCountry->insertItem( tr ( "Saudi Arabia" ) ); | 382 | cmbCountry->insertItem( tr ( "Saudi Arabia" ) ); |
380 | cmbCountry->insertItem( tr ( "Senegal" ) ); | 383 | cmbCountry->insertItem( tr ( "Senegal" ) ); |
381 | cmbCountry->insertItem( tr ( "Seychelles" ) ); | 384 | cmbCountry->insertItem( tr ( "Seychelles" ) ); |
382 | cmbCountry->insertItem( tr ( "Sierra Leone" ) ); | 385 | cmbCountry->insertItem( tr ( "Sierra Leone" ) ); |
383 | cmbCountry->insertItem( tr ( "Singapore" ) ); | 386 | cmbCountry->insertItem( tr ( "Singapore" ) ); |
384 | cmbCountry->insertItem( tr ( "Slovakia" ) ); | 387 | cmbCountry->insertItem( tr ( "Slovakia" ) ); |
385 | cmbCountry->insertItem( tr ( "Slovenia" ) ); | 388 | cmbCountry->insertItem( tr ( "Slovenia" ) ); |
386 | cmbCountry->insertItem( tr ( "Solomon Islands" ) ); | 389 | cmbCountry->insertItem( tr ( "Solomon Islands" ) ); |
387 | cmbCountry->insertItem( tr ( "Somalia" ) ); | 390 | cmbCountry->insertItem( tr ( "Somalia" ) ); |
388 | cmbCountry->insertItem( tr ( "South Africa" ) ); | 391 | cmbCountry->insertItem( tr ( "South Africa" ) ); |
389 | cmbCountry->insertItem( tr ( "Spain" ) ); | 392 | cmbCountry->insertItem( tr ( "Spain" ) ); |
390 | cmbCountry->insertItem( tr ( "Sri Lanka" ) ); | 393 | cmbCountry->insertItem( tr ( "Sri Lanka" ) ); |
391 | cmbCountry->insertItem( tr ( "St. Helena" ) ); | 394 | cmbCountry->insertItem( tr ( "St. Helena" ) ); |
392 | cmbCountry->insertItem( tr ( "Sudan" ) ); | 395 | cmbCountry->insertItem( tr ( "Sudan" ) ); |
393 | cmbCountry->insertItem( tr ( "Suriname" ) ); | 396 | cmbCountry->insertItem( tr ( "Suriname" ) ); |
394 | cmbCountry->insertItem( tr ( "Swaziland" ) ); | 397 | cmbCountry->insertItem( tr ( "Swaziland" ) ); |
395 | cmbCountry->insertItem( tr ( "Sweden" ) ); | 398 | cmbCountry->insertItem( tr ( "Sweden" ) ); |
396 | cmbCountry->insertItem( tr ( "Switzerland" ) ); | 399 | cmbCountry->insertItem( tr ( "Switzerland" ) ); |
397 | cmbCountry->insertItem( tr ( "Taiwan" ) ); | 400 | cmbCountry->insertItem( tr ( "Taiwan" ) ); |
398 | cmbCountry->insertItem( tr ( "Tajikistan" ) ); | 401 | cmbCountry->insertItem( tr ( "Tajikistan" ) ); |
399 | cmbCountry->insertItem( tr ( "Tanzania" ) ); | 402 | cmbCountry->insertItem( tr ( "Tanzania" ) ); |
400 | cmbCountry->insertItem( tr ( "Thailand" ) ); | 403 | cmbCountry->insertItem( tr ( "Thailand" ) ); |
401 | cmbCountry->insertItem( tr ( "Togo" ) ); | 404 | cmbCountry->insertItem( tr ( "Togo" ) ); |
402 | cmbCountry->insertItem( tr ( "Tokelau" ) ); | 405 | cmbCountry->insertItem( tr ( "Tokelau" ) ); |
403 | cmbCountry->insertItem( tr ( "Tonga" ) ); | 406 | cmbCountry->insertItem( tr ( "Tonga" ) ); |
404 | cmbCountry->insertItem( tr ( "Tunisia" ) ); | 407 | cmbCountry->insertItem( tr ( "Tunisia" ) ); |
405 | cmbCountry->insertItem( tr ( "Turkey" ) ); | 408 | cmbCountry->insertItem( tr ( "Turkey" ) ); |
406 | cmbCountry->insertItem( tr ( "Turkmenistan" ) ); | 409 | cmbCountry->insertItem( tr ( "Turkmenistan" ) ); |
407 | cmbCountry->insertItem( tr ( "Tuvalu" ) ); | 410 | cmbCountry->insertItem( tr ( "Tuvalu" ) ); |
408 | cmbCountry->insertItem( tr ( "Uganda" ) ); | 411 | cmbCountry->insertItem( tr ( "Uganda" ) ); |
409 | cmbCountry->insertItem( tr ( "Ukraine" ) ); | 412 | cmbCountry->insertItem( tr ( "Ukraine" ) ); |
410 | cmbCountry->insertItem( tr ( "Uruguay" ) ); | 413 | cmbCountry->insertItem( tr ( "Uruguay" ) ); |
411 | cmbCountry->insertItem( tr ( "Uzbekistan" ) ); | 414 | cmbCountry->insertItem( tr ( "Uzbekistan" ) ); |
412 | cmbCountry->insertItem( tr ( "Vanuatu" ) ); | 415 | cmbCountry->insertItem( tr ( "Vanuatu" ) ); |
413 | cmbCountry->insertItem( tr ( "Venezuela" ) ); | 416 | cmbCountry->insertItem( tr ( "Venezuela" ) ); |
414 | cmbCountry->insertItem( tr ( "Viet Nam" ) ); | 417 | cmbCountry->insertItem( tr ( "Viet Nam" ) ); |
415 | cmbCountry->insertItem( tr ( "Virgin Islands" ) ); | 418 | cmbCountry->insertItem( tr ( "Virgin Islands" ) ); |
416 | cmbCountry->insertItem( tr ( "Western Sahara" ) ); | 419 | cmbCountry->insertItem( tr ( "Western Sahara" ) ); |
417 | cmbCountry->insertItem( tr ( "Yemen" ) ); | 420 | cmbCountry->insertItem( tr ( "Yemen" ) ); |
418 | cmbCountry->insertItem( tr ( "Yugoslavia" ) ); | 421 | cmbCountry->insertItem( tr ( "Yugoslavia" ) ); |
419 | cmbCountry->insertItem( tr ( "Zambia" ) ); | 422 | cmbCountry->insertItem( tr ( "Zambia" ) ); |
420 | cmbCountry->insertItem( tr ( "Zimbabwe" ) ); | 423 | cmbCountry->insertItem( tr ( "Zimbabwe" ) ); |
421 | if (cmbCountry->listBox()!=0) | 424 | if (cmbCountry->listBox()!=0) |
422 | cmbCountry->listBox()->sort(); | 425 | cmbCountry->listBox()->sort(); |
423 | 426 | ||
424 | cmbCountry->setMaximumWidth( 135 ); | 427 | cmbCountry->setMaximumWidth( 135 ); |
425 | 428 | ||
426 | gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); | 429 | gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); |
427 | 430 | ||
428 | cmbChooserField4 = new QComboBox( FALSE, container ); | 431 | cmbChooserField4 = new QComboBox( FALSE, container ); |
429 | cmbChooserField4->setMaximumWidth( 90 ); | 432 | cmbChooserField4->setMaximumWidth( 90 ); |
430 | gl->addWidget( cmbChooserField4, 6, 0 ); | 433 | gl->addWidget( cmbChooserField4, 6, 0 ); |
431 | txtChooserField4 = new QLineEdit( container ); | 434 | txtChooserField4 = new QLineEdit( container ); |
432 | gl->addMultiCellWidget( txtChooserField4, 6, 6, 1, 2 ); | 435 | gl->addMultiCellWidget( txtChooserField4, 6, 6, 1, 2 ); |
433 | 436 | ||
434 | QSpacerItem *space = new QSpacerItem(1,1, | 437 | QSpacerItem *space = new QSpacerItem(1,1, |
435 | QSizePolicy::Maximum, | 438 | QSizePolicy::Maximum, |
436 | QSizePolicy::MinimumExpanding ); | 439 | QSizePolicy::MinimumExpanding ); |
437 | gl->addItem( space, 7, 0 ); | 440 | gl->addItem( space, 7, 0 ); |
438 | 441 | ||
439 | tabMain->insertTab( tabViewport, tr( "Address" ) ); | 442 | tabMain->insertTab( tabViewport, tr( "Address" ) ); |
440 | 443 | ||
441 | tabViewport = new QWidget ( tabMain ); | 444 | tabViewport = new QWidget ( tabMain ); |
442 | 445 | ||
443 | vb = new QVBoxLayout( tabViewport ); | 446 | vb = new QVBoxLayout( tabViewport ); |
444 | 447 | ||
445 | svDetails = new QScrollView( tabViewport ); | 448 | svDetails = new QScrollView( tabViewport ); |
446 | vb->addWidget( svDetails, 0, 0 ); | 449 | vb->addWidget( svDetails, 0, 0 ); |
447 | svDetails->setResizePolicy( QScrollView::AutoOneFit ); | 450 | svDetails->setResizePolicy( QScrollView::AutoOneFit ); |
448 | svDetails->setFrameStyle( QFrame::NoFrame ); | 451 | svDetails->setFrameStyle( QFrame::NoFrame ); |
449 | 452 | ||
450 | container = new QWidget( svDetails->viewport() ); | 453 | container = new QWidget( svDetails->viewport() ); |
451 | svDetails->addChild( container ); | 454 | svDetails->addChild( container ); |
452 | 455 | ||
453 | gl = new QGridLayout( container, 1, 2, 2, 4 ); | 456 | gl = new QGridLayout( container, 1, 2, 2, 4 ); |
454 | 457 | ||
455 | int counter = 0; | 458 | int counter = 0; |
456 | 459 | ||
457 | // Birthday | 460 | // Birthday |
458 | QHBox* hBox = new QHBox( container ); | 461 | QHBox* hBox = new QHBox( container ); |
459 | l = new QLabel( tr("Birthday"), container ); | 462 | l = new QLabel( tr("Birthday"), container ); |
460 | gl->addWidget( l, counter, 0 ); | 463 | gl->addWidget( l, counter, 0 ); |
461 | 464 | ||
462 | QPopupMenu* m1 = new QPopupMenu( container ); | 465 | QPopupMenu* m1 = new QPopupMenu( container ); |
463 | birthdayPicker = new DateBookMonth( m1, 0, TRUE ); | 466 | birthdayPicker = new DateBookMonth( m1, 0, TRUE ); |
464 | m1->insertItem( birthdayPicker ); | 467 | m1->insertItem( birthdayPicker ); |
465 | 468 | ||
466 | birthdayButton= new QToolButton( hBox, "buttonStart" ); | 469 | birthdayButton= new QToolButton( hBox, "buttonStart" ); |
467 | birthdayButton->setPopup( m1 ); | 470 | birthdayButton->setPopup( m1 ); |
468 | birthdayButton->setPopupDelay(0); | 471 | birthdayButton->setPopupDelay(0); |
469 | 472 | ||
470 | QPushButton* deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), | 473 | QPushButton* deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), |
471 | tr( "Delete" ), | 474 | tr( "Delete" ), |
472 | hBox, 0 ); | 475 | hBox, 0 ); |
473 | 476 | ||
474 | gl->addWidget( hBox, counter , 1 ); | 477 | gl->addWidget( hBox, counter , 1 ); |
475 | 478 | ||
476 | connect( birthdayPicker, SIGNAL( dateClicked( int, int, int ) ), | 479 | connect( birthdayPicker, SIGNAL( dateClicked( int, int, int ) ), |
477 | this, SLOT( slotBirthdayDateChanged( int, int, int ) ) ); | 480 | this, SLOT( slotBirthdayDateChanged( int, int, int ) ) ); |
478 | connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveBirthday() ) ); | 481 | connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveBirthday() ) ); |
479 | 482 | ||
480 | ++counter; | 483 | ++counter; |
481 | 484 | ||
482 | // Anniversary | 485 | // Anniversary |
483 | hBox = new QHBox( container ); | 486 | hBox = new QHBox( container ); |
484 | l = new QLabel( tr("Anniversary"), container ); | 487 | l = new QLabel( tr("Anniversary"), container ); |
485 | gl->addWidget( l, counter, 0 ); | 488 | gl->addWidget( l, counter, 0 ); |
486 | 489 | ||
487 | m1 = new QPopupMenu( container ); | 490 | m1 = new QPopupMenu( container ); |
488 | anniversaryPicker = new DateBookMonth( m1, 0, TRUE ); | 491 | anniversaryPicker = new DateBookMonth( m1, 0, TRUE ); |
489 | m1->insertItem( anniversaryPicker ); | 492 | m1->insertItem( anniversaryPicker ); |
490 | 493 | ||
491 | anniversaryButton= new QToolButton( hBox, "buttonStart" ); | 494 | anniversaryButton= new QToolButton( hBox, "buttonStart" ); |
492 | anniversaryButton->setPopup( m1 ); | 495 | anniversaryButton->setPopup( m1 ); |
493 | anniversaryButton->setPopupDelay(0); | 496 | anniversaryButton->setPopupDelay(0); |
494 | 497 | ||
495 | deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), | 498 | deleteButton = new QPushButton( QIconSet( Resource::loadPixmap( "trash" ) ), |
496 | tr( "Delete" ), | 499 | tr( "Delete" ), |
497 | hBox, 0 ); | 500 | hBox, 0 ); |
498 | gl->addWidget( hBox, counter , 1 ); | 501 | gl->addWidget( hBox, counter , 1 ); |
499 | 502 | ||
500 | connect( anniversaryPicker, SIGNAL( dateClicked( int, int, int ) ), | 503 | connect( anniversaryPicker, SIGNAL( dateClicked( int, int, int ) ), |
501 | this, SLOT( slotAnniversaryDateChanged( int, int, int ) ) ); | 504 | this, SLOT( slotAnniversaryDateChanged( int, int, int ) ) ); |
502 | connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveAnniversary() ) ); | 505 | connect( deleteButton, SIGNAL( clicked() ), this, SLOT( slotRemoveAnniversary() ) ); |
503 | 506 | ||
504 | ++counter; | 507 | ++counter; |
505 | 508 | ||
506 | // Gender | 509 | // Gender |
507 | l = new QLabel( tr("Gender"), container ); | 510 | l = new QLabel( tr("Gender"), container ); |
508 | gl->addWidget( l, counter, 0 ); | 511 | gl->addWidget( l, counter, 0 ); |
509 | cmbGender = new QComboBox( container ); | 512 | cmbGender = new QComboBox( container ); |
510 | cmbGender->insertItem( "", 0 ); | 513 | cmbGender->insertItem( "", 0 ); |
511 | cmbGender->insertItem( tr("Male"), 1); | 514 | cmbGender->insertItem( tr("Male"), 1); |
512 | cmbGender->insertItem( tr("Female"), 2); | 515 | cmbGender->insertItem( tr("Female"), 2); |
513 | gl->addWidget( cmbGender, counter, 1 ); | 516 | gl->addWidget( cmbGender, counter, 1 ); |
514 | 517 | ||
515 | ++counter; | 518 | ++counter; |
516 | 519 | ||
517 | // Create Labels and lineedit fields for every dynamic entry | 520 | // Create Labels and lineedit fields for every dynamic entry |
518 | QStringList::ConstIterator it = slDynamicEntries.begin(); | 521 | QStringList::ConstIterator it = slDynamicEntries.begin(); |
519 | QStringList::ConstIterator trit = trlDynamicEntries.begin(); | 522 | QStringList::ConstIterator trit = trlDynamicEntries.begin(); |
520 | for (i = counter; it != slDynamicEntries.end(); i++, ++it, ++trit) { | 523 | for (i = counter; it != slDynamicEntries.end(); i++, ++it, ++trit) { |
521 | 524 | ||
522 | if (((*it) == "Anniversary") || | 525 | if (((*it) == "Anniversary") || |
523 | ((*it) == "Birthday")|| ((*it) == "Gender")) continue; | 526 | ((*it) == "Birthday")|| ((*it) == "Gender")) continue; |
524 | 527 | ||
525 | l = new QLabel( (*it).utf8() , container ); | 528 | l = new QLabel( (*it).utf8() , container ); |
526 | listName.append( l ); | 529 | listName.append( l ); |
527 | gl->addWidget( l, i, 0 ); | 530 | gl->addWidget( l, i, 0 ); |
528 | QLineEdit *e = new QLineEdit( container ); | 531 | QLineEdit *e = new QLineEdit( container ); |
529 | listValue.append( e ); | 532 | listValue.append( e ); |
530 | gl->addWidget( e, i, 1); | 533 | gl->addWidget( e, i, 1); |
531 | } | 534 | } |
532 | // Fill labels with names.. | 535 | // Fill labels with names.. |
533 | //loadFields(); | 536 | //loadFields(); |
534 | 537 | ||
535 | 538 | ||
536 | tabMain->insertTab( tabViewport, tr( "Details" ) ); | 539 | tabMain->insertTab( tabViewport, tr( "Details" ) ); |
537 | 540 | ||
538 | dlgNote = new QDialog( this, "Note Dialog", TRUE ); | 541 | dlgNote = new QDialog( this, "Note Dialog", TRUE ); |
539 | dlgNote->setCaption( tr("Enter Note") ); | 542 | dlgNote->setCaption( tr("Enter Note") ); |
540 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); | 543 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); |
541 | txtNote = new QMultiLineEdit( dlgNote ); | 544 | txtNote = new QMultiLineEdit( dlgNote ); |
542 | vbNote->addWidget( txtNote ); | 545 | vbNote->addWidget( txtNote ); |
543 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); | 546 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); |
544 | 547 | ||
545 | dlgName = new QDialog( this, "Name Dialog", TRUE ); | 548 | dlgName = new QDialog( this, "Name Dialog", TRUE ); |
546 | dlgName->setCaption( tr("Edit Name") ); | 549 | dlgName->setCaption( tr("Edit Name") ); |
547 | gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); | 550 | gl = new QGridLayout( dlgName, 5, 2, 2, 3 ); |
548 | 551 | ||
549 | l = new QLabel( tr("First Name"), dlgName ); | 552 | l = new QLabel( tr("First Name"), dlgName ); |
550 | gl->addWidget( l, 0, 0 ); | 553 | gl->addWidget( l, 0, 0 ); |
551 | txtFirstName = new QLineEdit( dlgName ); | 554 | txtFirstName = new QLineEdit( dlgName ); |
552 | gl->addWidget( txtFirstName, 0, 1 ); | 555 | gl->addWidget( txtFirstName, 0, 1 ); |
553 | 556 | ||
554 | l = new QLabel( tr("Middle Name"), dlgName ); | 557 | l = new QLabel( tr("Middle Name"), dlgName ); |
555 | gl->addWidget( l, 1, 0 ); | 558 | gl->addWidget( l, 1, 0 ); |
556 | txtMiddleName = new QLineEdit( dlgName ); | 559 | txtMiddleName = new QLineEdit( dlgName ); |
557 | gl->addWidget( txtMiddleName, 1, 1 ); | 560 | gl->addWidget( txtMiddleName, 1, 1 ); |
558 | 561 | ||
559 | l = new QLabel( tr("Last Name"), dlgName ); | 562 | l = new QLabel( tr("Last Name"), dlgName ); |
560 | gl->addWidget( l, 2, 0 ); | 563 | gl->addWidget( l, 2, 0 ); |
561 | txtLastName = new QLineEdit( dlgName ); | 564 | txtLastName = new QLineEdit( dlgName ); |
562 | gl->addWidget( txtLastName, 2, 1 ); | 565 | gl->addWidget( txtLastName, 2, 1 ); |
563 | 566 | ||
564 | l = new QLabel( tr("Suffix"), dlgName ); | 567 | l = new QLabel( tr("Suffix"), dlgName ); |
565 | gl->addWidget( l, 3, 0 ); | 568 | gl->addWidget( l, 3, 0 ); |
566 | txtSuffix = new QLineEdit( dlgName ); | 569 | txtSuffix = new QLineEdit( dlgName ); |
567 | gl->addWidget( txtSuffix, 3, 1 ); | 570 | gl->addWidget( txtSuffix, 3, 1 ); |
568 | space = new QSpacerItem(1,1, | 571 | space = new QSpacerItem(1,1, |
569 | QSizePolicy::Maximum, | 572 | QSizePolicy::Maximum, |
570 | QSizePolicy::MinimumExpanding ); | 573 | QSizePolicy::MinimumExpanding ); |
571 | gl->addItem( space, 4, 0 ); | 574 | gl->addItem( space, 4, 0 ); |
572 | 575 | ||
573 | cmbChooserField1->insertStringList( trlChooserNames ); | 576 | cmbChooserField1->insertStringList( trlChooserNames ); |
574 | cmbChooserField2->insertStringList( trlChooserNames ); | 577 | cmbChooserField2->insertStringList( trlChooserNames ); |
575 | cmbChooserField3->insertStringList( trlChooserNames ); | 578 | cmbChooserField3->insertStringList( trlChooserNames ); |
576 | cmbChooserField4->insertStringList( trlChooserNames ); | 579 | cmbChooserField4->insertStringList( trlChooserNames ); |
577 | 580 | ||
578 | cmbChooserField1->setCurrentItem( 0 ); | 581 | cmbChooserField1->setCurrentItem( 0 ); |
579 | cmbChooserField2->setCurrentItem( 1 ); | 582 | cmbChooserField2->setCurrentItem( 1 ); |
580 | cmbChooserField3->setCurrentItem( 2 ); | 583 | cmbChooserField3->setCurrentItem( 2 ); |
581 | 584 | ||
582 | connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); | 585 | connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); |
583 | 586 | ||
584 | connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); | 587 | connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); |
585 | 588 | ||
586 | connect( txtChooserField1, SIGNAL(textChanged(const QString &)), | 589 | connect( txtChooserField1, SIGNAL(textChanged(const QString &)), |
587 | this, SLOT(slotChooser1Change(const QString &)) ); | 590 | this, SLOT(slotChooser1Change(const QString &)) ); |
588 | connect( txtChooserField2, SIGNAL(textChanged(const QString &)), | 591 | connect( txtChooserField2, SIGNAL(textChanged(const QString &)), |
589 | this, SLOT(slotChooser2Change(const QString &)) ); | 592 | this, SLOT(slotChooser2Change(const QString &)) ); |
590 | connect( txtChooserField3, SIGNAL(textChanged(const QString &)), | 593 | connect( txtChooserField3, SIGNAL(textChanged(const QString &)), |
591 | this, SLOT(slotChooser3Change(const QString &)) ); | 594 | this, SLOT(slotChooser3Change(const QString &)) ); |
592 | connect( txtChooserField4, SIGNAL(textChanged(const QString &)), | 595 | connect( txtChooserField4, SIGNAL(textChanged(const QString &)), |
593 | this, SLOT(slotChooser4Change(const QString &)) ); | 596 | this, SLOT(slotChooser4Change(const QString &)) ); |
594 | connect( txtAddress, SIGNAL(textChanged(const QString &)), | 597 | connect( txtAddress, SIGNAL(textChanged(const QString &)), |
595 | this, SLOT(slotAddressChange(const QString &)) ); | 598 | this, SLOT(slotAddressChange(const QString &)) ); |
596 | //connect( txtAddress2, SIGNAL(textChanged(const QString &)), this, SLOT(slotAddress2Change(const QString &)) ); | 599 | //connect( txtAddress2, SIGNAL(textChanged(const QString &)), this, SLOT(slotAddress2Change(const QString &)) ); |
597 | //connect( txtPOBox, SIGNAL(textChanged(const QString &)), this, SLOT(slotPOBoxChange(const QString &)) ); | 600 | //connect( txtPOBox, SIGNAL(textChanged(const QString &)), this, SLOT(slotPOBoxChange(const QString &)) ); |
598 | connect( txtCity, SIGNAL(textChanged(const QString &)), | 601 | connect( txtCity, SIGNAL(textChanged(const QString &)), |
599 | this, SLOT(slotCityChange(const QString &)) ); | 602 | this, SLOT(slotCityChange(const QString &)) ); |
600 | connect( txtState, SIGNAL(textChanged(const QString &)), | 603 | connect( txtState, SIGNAL(textChanged(const QString &)), |
601 | this, SLOT(slotStateChange(const QString &)) ); | 604 | this, SLOT(slotStateChange(const QString &)) ); |
602 | connect( txtZip, SIGNAL(textChanged(const QString &)), | 605 | connect( txtZip, SIGNAL(textChanged(const QString &)), |
603 | this, SLOT(slotZipChange(const QString &)) ); | 606 | this, SLOT(slotZipChange(const QString &)) ); |
604 | connect( cmbCountry, SIGNAL(textChanged(const QString &)), | 607 | connect( cmbCountry, SIGNAL(textChanged(const QString &)), |
605 | this, SLOT(slotCountryChange(const QString &)) ); | 608 | this, SLOT(slotCountryChange(const QString &)) ); |
606 | connect( cmbCountry, SIGNAL(activated(const QString &)), | 609 | connect( cmbCountry, SIGNAL(activated(const QString &)), |
607 | this, SLOT(slotCountryChange(const QString &)) ); | 610 | this, SLOT(slotCountryChange(const QString &)) ); |
608 | connect( cmbChooserField1, SIGNAL(activated(int)), | 611 | connect( cmbChooserField1, SIGNAL(activated(int)), |
609 | this, SLOT(slotCmbChooser1Change(int)) ); | 612 | this, SLOT(slotCmbChooser1Change(int)) ); |
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); |
659 | 662 | ||
660 | } | 663 | } |
661 | 664 | ||
662 | void ContactEditor::slotChooser3Change( const QString &textChanged ) { | 665 | void ContactEditor::slotChooser3Change( const QString &textChanged ) { |
663 | chooserChange( textChanged, cmbChooserField3->currentItem(), txtChooserField3); | 666 | chooserChange( textChanged, cmbChooserField3->currentItem(), txtChooserField3); |
664 | } | 667 | } |
665 | 668 | ||
666 | void ContactEditor::slotChooser4Change( const QString &textChanged ) { | 669 | void ContactEditor::slotChooser4Change( const QString &textChanged ) { |
667 | chooserChange( textChanged, cmbChooserField4->currentItem(), txtChooserField4); | 670 | chooserChange( textChanged, cmbChooserField4->currentItem(), txtChooserField4); |
668 | } | 671 | } |
669 | 672 | ||
670 | void ContactEditor::slotAddressChange( const QString &textChanged ) { | 673 | void ContactEditor::slotAddressChange( const QString &textChanged ) { |
671 | 674 | ||
672 | if ( cmbAddress->currentItem() == 0 ) { | 675 | if ( cmbAddress->currentItem() == 0 ) { |
673 | slBusinessAddress[0] = textChanged; | 676 | slBusinessAddress[0] = textChanged; |
674 | } else { | 677 | } else { |
675 | slHomeAddress[0] = textChanged; | 678 | slHomeAddress[0] = textChanged; |
676 | } | 679 | } |
677 | } | 680 | } |
678 | 681 | ||
679 | void ContactEditor::slotAddress2Change( const QString &textChanged ) { | 682 | void ContactEditor::slotAddress2Change( const QString &textChanged ) { |
680 | 683 | ||
681 | if ( cmbAddress->currentItem() == 0 ) { | 684 | if ( cmbAddress->currentItem() == 0 ) { |
682 | slBusinessAddress[1] = textChanged; | 685 | slBusinessAddress[1] = textChanged; |
683 | } else { | 686 | } else { |
684 | slHomeAddress[1] = textChanged; | 687 | slHomeAddress[1] = textChanged; |
685 | } | 688 | } |
686 | } | 689 | } |
687 | 690 | ||
688 | void ContactEditor::slotPOBoxChange( const QString &textChanged ) { | 691 | void ContactEditor::slotPOBoxChange( const QString &textChanged ) { |
689 | 692 | ||
690 | if ( cmbAddress->currentItem() == 0 ) { | 693 | if ( cmbAddress->currentItem() == 0 ) { |
691 | slBusinessAddress[2] = textChanged; | 694 | slBusinessAddress[2] = textChanged; |
692 | } else { | 695 | } else { |
693 | slHomeAddress[2] = textChanged; | 696 | slHomeAddress[2] = textChanged; |
694 | } | 697 | } |
695 | } | 698 | } |
696 | 699 | ||
697 | void ContactEditor::slotCityChange( const QString &textChanged ) { | 700 | void ContactEditor::slotCityChange( const QString &textChanged ) { |
698 | 701 | ||
699 | if ( cmbAddress->currentItem() == 0 ) { | 702 | if ( cmbAddress->currentItem() == 0 ) { |
700 | slBusinessAddress[3] = textChanged; | 703 | slBusinessAddress[3] = textChanged; |
701 | } else { | 704 | } else { |
702 | slHomeAddress[3] = textChanged; | 705 | slHomeAddress[3] = textChanged; |
703 | } | 706 | } |
704 | } | 707 | } |
705 | 708 | ||
706 | void ContactEditor::slotStateChange( const QString &textChanged ) { | 709 | void ContactEditor::slotStateChange( const QString &textChanged ) { |
707 | 710 | ||
708 | 711 | ||
709 | if ( cmbAddress->currentItem() == 0 ) { | 712 | if ( cmbAddress->currentItem() == 0 ) { |
710 | slBusinessAddress[4] = textChanged; | 713 | slBusinessAddress[4] = textChanged; |
711 | } else { | 714 | } else { |
712 | slHomeAddress[4] = textChanged; | 715 | slHomeAddress[4] = textChanged; |
713 | } | 716 | } |
714 | } | 717 | } |
715 | 718 | ||
716 | void ContactEditor::slotZipChange( const QString &textChanged ) { | 719 | void ContactEditor::slotZipChange( const QString &textChanged ) { |
717 | 720 | ||
718 | if ( cmbAddress->currentItem() == 0 ) { | 721 | if ( cmbAddress->currentItem() == 0 ) { |
719 | slBusinessAddress[5] = textChanged; | 722 | slBusinessAddress[5] = textChanged; |
720 | } else { | 723 | } else { |
721 | slHomeAddress[5] = textChanged; | 724 | slHomeAddress[5] = textChanged; |
722 | } | 725 | } |
723 | } | 726 | } |
724 | 727 | ||
725 | void ContactEditor::slotCountryChange( const QString &textChanged ) { | 728 | void ContactEditor::slotCountryChange( const QString &textChanged ) { |
726 | 729 | ||
727 | if ( cmbAddress->currentItem() == 0 ) { | 730 | if ( cmbAddress->currentItem() == 0 ) { |
728 | slBusinessAddress[6] = textChanged; | 731 | slBusinessAddress[6] = textChanged; |
729 | } else { | 732 | } else { |
730 | slHomeAddress[6] = textChanged; | 733 | slHomeAddress[6] = textChanged; |
731 | } | 734 | } |
732 | } | 735 | } |
733 | 736 | ||
734 | void ContactEditor::slotCmbChooser1Change( int index ) { | 737 | void ContactEditor::slotCmbChooser1Change( int index ) { |
735 | 738 | ||
736 | txtChooserField1->setText( slChooserValues[index] ); | 739 | txtChooserField1->setText( slChooserValues[index] ); |
737 | txtChooserField1->setFocus(); | 740 | txtChooserField1->setFocus(); |
738 | } | 741 | } |
739 | 742 | ||
740 | void ContactEditor::slotCmbChooser2Change( int index ) { | 743 | void ContactEditor::slotCmbChooser2Change( int index ) { |
741 | 744 | ||
742 | txtChooserField2->setText( slChooserValues[index] ); | 745 | txtChooserField2->setText( slChooserValues[index] ); |
743 | txtChooserField2->setFocus(); | 746 | txtChooserField2->setFocus(); |
744 | } | 747 | } |
745 | 748 | ||
746 | void ContactEditor::slotCmbChooser3Change( int index ) { | 749 | void ContactEditor::slotCmbChooser3Change( int index ) { |
747 | 750 | ||
748 | txtChooserField3->setText( slChooserValues[index] ); | 751 | txtChooserField3->setText( slChooserValues[index] ); |
749 | txtChooserField3->setFocus(); | 752 | txtChooserField3->setFocus(); |
750 | 753 | ||
751 | } | 754 | } |
752 | 755 | ||
753 | void ContactEditor::slotCmbChooser4Change( int index ) { | 756 | void ContactEditor::slotCmbChooser4Change( int index ) { |
754 | 757 | ||
755 | txtChooserField4->setText( slChooserValues[index] ); | 758 | txtChooserField4->setText( slChooserValues[index] ); |
756 | txtChooserField4->setFocus(); | 759 | txtChooserField4->setFocus(); |
757 | 760 | ||
758 | } | 761 | } |
759 | 762 | ||
760 | void ContactEditor::slotAddressTypeChange( int index ) { | 763 | void ContactEditor::slotAddressTypeChange( int index ) { |
761 | 764 | ||
762 | if ( index == 0 ) { | 765 | if ( index == 0 ) { |
763 | 766 | ||
764 | txtAddress->setText( slBusinessAddress[0] ); | 767 | txtAddress->setText( slBusinessAddress[0] ); |
765 | //txtAddress2->setText( (*slBusinessAddress)[1] ); | 768 | //txtAddress2->setText( (*slBusinessAddress)[1] ); |
766 | //txtPOBox->setText( (*slBusinessAddress)[2] ); | 769 | //txtPOBox->setText( (*slBusinessAddress)[2] ); |
767 | txtCity->setText( slBusinessAddress[3] ); | 770 | txtCity->setText( slBusinessAddress[3] ); |
768 | txtState->setText( slBusinessAddress[4] ); | 771 | txtState->setText( slBusinessAddress[4] ); |
769 | txtZip->setText( slBusinessAddress[5] ); | 772 | txtZip->setText( slBusinessAddress[5] ); |
770 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 773 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
771 | txtTmp->setText( slBusinessAddress[6] ); | 774 | txtTmp->setText( slBusinessAddress[6] ); |
772 | 775 | ||
773 | } else { | 776 | } else { |
774 | 777 | ||
775 | txtAddress->setText( slHomeAddress[0] ); | 778 | txtAddress->setText( slHomeAddress[0] ); |
776 | //txtAddress2->setText( (*slHomeAddress)[1] ); | 779 | //txtAddress2->setText( (*slHomeAddress)[1] ); |
777 | //txtPOBox->setText( (*slHomeAddress)[2] ); | 780 | //txtPOBox->setText( (*slHomeAddress)[2] ); |
778 | txtCity->setText( slHomeAddress[3] ); | 781 | txtCity->setText( slHomeAddress[3] ); |
779 | txtState->setText( slHomeAddress[4] ); | 782 | txtState->setText( slHomeAddress[4] ); |
780 | txtZip->setText( slHomeAddress[5] ); | 783 | txtZip->setText( slHomeAddress[5] ); |
781 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 784 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
782 | txtTmp->setText( slHomeAddress[6] ); | 785 | txtTmp->setText( slHomeAddress[6] ); |
783 | 786 | ||
784 | } | 787 | } |
785 | 788 | ||
786 | } | 789 | } |
787 | 790 | ||
788 | void ContactEditor::slotFullNameChange( const QString &textChanged ) { | 791 | void ContactEditor::slotFullNameChange( const QString &textChanged ) { |
789 | 792 | ||
790 | int index = cmbFileAs->currentItem(); | 793 | int index = cmbFileAs->currentItem(); |
791 | 794 | ||
792 | cmbFileAs->clear(); | 795 | cmbFileAs->clear(); |
793 | 796 | ||
794 | cmbFileAs->insertItem( parseName( textChanged, 0 ) ); | 797 | cmbFileAs->insertItem( parseName( textChanged, 0 ) ); |
795 | cmbFileAs->insertItem( parseName( textChanged, 1 ) ); | 798 | cmbFileAs->insertItem( parseName( textChanged, 1 ) ); |
796 | cmbFileAs->insertItem( parseName( textChanged, 2 ) ); | 799 | cmbFileAs->insertItem( parseName( textChanged, 2 ) ); |
797 | cmbFileAs->insertItem( parseName( textChanged, 3 ) ); | 800 | cmbFileAs->insertItem( parseName( textChanged, 3 ) ); |
798 | 801 | ||
799 | cmbFileAs->setCurrentItem( index ); | 802 | cmbFileAs->setCurrentItem( index ); |
800 | 803 | ||
801 | useFullName = true; | 804 | useFullName = true; |
802 | 805 | ||
803 | } | 806 | } |
804 | 807 | ||
805 | void ContactEditor::accept() { | 808 | void ContactEditor::accept() { |
806 | 809 | ||
807 | if ( isEmpty() ) { | 810 | if ( isEmpty() ) { |
808 | cleanupFields(); | 811 | cleanupFields(); |
809 | reject(); | 812 | reject(); |
810 | } else { | 813 | } else { |
811 | saveEntry(); | 814 | saveEntry(); |
812 | cleanupFields(); | 815 | cleanupFields(); |
813 | QDialog::accept(); | 816 | QDialog::accept(); |
814 | } | 817 | } |
815 | 818 | ||
816 | } | 819 | } |
817 | 820 | ||
818 | void ContactEditor::slotNote() { | 821 | void ContactEditor::slotNote() { |
819 | 822 | ||
820 | dlgNote->showMaximized(); | 823 | dlgNote->showMaximized(); |
821 | if ( !dlgNote->exec() ) { | 824 | if ( !dlgNote->exec() ) { |
822 | txtNote->setText( ent.notes() ); | 825 | txtNote->setText( ent.notes() ); |
823 | } | 826 | } |
824 | } | 827 | } |
825 | 828 | ||
826 | void ContactEditor::slotName() { | 829 | void ContactEditor::slotName() { |
827 | 830 | ||
828 | QString tmpName; | 831 | QString tmpName; |
829 | if (useFullName) { | 832 | if (useFullName) { |
830 | txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); | 833 | txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); |
831 | txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); | 834 | txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); |
832 | txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); | 835 | txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); |
833 | txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); | 836 | txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); |
834 | } | 837 | } |
835 | dlgName->showMaximized(); | 838 | dlgName->showMaximized(); |
836 | if ( dlgName->exec() ) { | 839 | if ( dlgName->exec() ) { |
837 | 840 | ||
838 | tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text() + " " + txtSuffix->text(); | 841 | tmpName = txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text() + " " + txtSuffix->text(); |
839 | txtFullName->setText( tmpName.simplifyWhiteSpace() ); | 842 | txtFullName->setText( tmpName.simplifyWhiteSpace() ); |
840 | slotFullNameChange( txtFullName->text() ); | 843 | slotFullNameChange( txtFullName->text() ); |
841 | useFullName = false; | 844 | useFullName = false; |
842 | } | 845 | } |
843 | 846 | ||
844 | } | 847 | } |
845 | 848 | ||
846 | void ContactEditor::setNameFocus() { | 849 | void ContactEditor::setNameFocus() { |
847 | 850 | ||
848 | txtFullName->setFocus(); | 851 | txtFullName->setFocus(); |
849 | 852 | ||
850 | } | 853 | } |
851 | 854 | ||
852 | bool ContactEditor::isEmpty() { | 855 | bool ContactEditor::isEmpty() { |
853 | // Test and see if the record should be saved. | 856 | // Test and see if the record should be saved. |
854 | // More strict than the original qtopia, needs name or fileas to save | 857 | // More strict than the original qtopia, needs name or fileas to save |
855 | 858 | ||
856 | QString t = txtFullName->text(); | 859 | QString t = txtFullName->text(); |
857 | if ( !t.isEmpty() && containsAlphaNum( t ) ) | 860 | if ( !t.isEmpty() && containsAlphaNum( t ) ) |
858 | return false; | 861 | return false; |
859 | 862 | ||
860 | t = cmbFileAs->currentText(); | 863 | t = cmbFileAs->currentText(); |
861 | if ( !t.isEmpty() && containsAlphaNum( t ) ) | 864 | if ( !t.isEmpty() && containsAlphaNum( t ) ) |
862 | return false; | 865 | return false; |
863 | 866 | ||
864 | return true; | 867 | return true; |
865 | 868 | ||
866 | } | 869 | } |
867 | 870 | ||
868 | QString ContactEditor::parseName( const QString fullName, int type ) { | 871 | QString ContactEditor::parseName( const QString fullName, int type ) { |
869 | 872 | ||
870 | QString simplifiedName( fullName.simplifyWhiteSpace() ); | 873 | QString simplifiedName( fullName.simplifyWhiteSpace() ); |
871 | QString strFirstName; | 874 | QString strFirstName; |
872 | QString strMiddleName; | 875 | QString strMiddleName; |
873 | QString strLastName; | 876 | QString strLastName; |
874 | QString strSuffix; | 877 | QString strSuffix; |
875 | QString strTitle; | 878 | QString strTitle; |
876 | int commapos; | 879 | int commapos; |
877 | int spCount; | 880 | int spCount; |
878 | int spPos; | 881 | int spPos; |
879 | int spPos2; | 882 | int spPos2; |
880 | 883 | ||
881 | 884 | ||
882 | commapos = simplifiedName.find( ',', 0, TRUE); | 885 | commapos = simplifiedName.find( ',', 0, TRUE); |
883 | spCount = simplifiedName.contains( ' ', TRUE ); | 886 | spCount = simplifiedName.contains( ' ', TRUE ); |
884 | 887 | ||
885 | if ( commapos == -1 ) { | 888 | if ( commapos == -1 ) { |
886 | 889 | ||
887 | switch (spCount) { | 890 | switch (spCount) { |
888 | case 0: | 891 | case 0: |
889 | //return simplifiedName; | 892 | //return simplifiedName; |
890 | if (txtLastName->text() != "") { | 893 | if (txtLastName->text() != "") { |
891 | strLastName = simplifiedName; | 894 | strLastName = simplifiedName; |
892 | break; | 895 | break; |
893 | } | 896 | } |
894 | if (txtMiddleName->text() != "") { | 897 | if (txtMiddleName->text() != "") { |
895 | strMiddleName = simplifiedName; | 898 | strMiddleName = simplifiedName; |
896 | break; | 899 | break; |
897 | } | 900 | } |
898 | if (txtSuffix->text() != "") { | 901 | if (txtSuffix->text() != "") { |
899 | strSuffix = simplifiedName; | 902 | strSuffix = simplifiedName; |
900 | break; | 903 | break; |
901 | } | 904 | } |
902 | strFirstName = simplifiedName; | 905 | strFirstName = simplifiedName; |
903 | break; | 906 | break; |
904 | 907 | ||
905 | case 1: | 908 | case 1: |
906 | spPos = simplifiedName.find( ' ', 0, TRUE ); | 909 | spPos = simplifiedName.find( ' ', 0, TRUE ); |
907 | strFirstName = simplifiedName.left( spPos ); | 910 | strFirstName = simplifiedName.left( spPos ); |
908 | strLastName = simplifiedName.mid( spPos + 1 ); | 911 | strLastName = simplifiedName.mid( spPos + 1 ); |
909 | break; | 912 | break; |
910 | 913 | ||
911 | case 2: | 914 | case 2: |
912 | spPos = simplifiedName.find( ' ', 0, TRUE ); | 915 | spPos = simplifiedName.find( ' ', 0, TRUE ); |
913 | strFirstName = simplifiedName.left( spPos ); | 916 | strFirstName = simplifiedName.left( spPos ); |
914 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 917 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
915 | strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 918 | strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
916 | strLastName = simplifiedName.mid( spPos2 + 1 ); | 919 | strLastName = simplifiedName.mid( spPos2 + 1 ); |
917 | break; | 920 | break; |
918 | 921 | ||
919 | case 3: | 922 | case 3: |
920 | spPos = simplifiedName.find( ' ', 0, TRUE ); | 923 | spPos = simplifiedName.find( ' ', 0, TRUE ); |
921 | strFirstName = simplifiedName.left( spPos ); | 924 | strFirstName = simplifiedName.left( spPos ); |
922 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 925 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
923 | strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 926 | strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
924 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); | 927 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); |
925 | strLastName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); | 928 | strLastName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); |
926 | strSuffix = simplifiedName.mid( spPos + 1 ); | 929 | strSuffix = simplifiedName.mid( spPos + 1 ); |
927 | break; | 930 | break; |
928 | 931 | ||
929 | case 4: | 932 | case 4: |
930 | spPos = simplifiedName.find( ' ', 0, TRUE ); | 933 | spPos = simplifiedName.find( ' ', 0, TRUE ); |
931 | strTitle = simplifiedName.left( spPos ); | 934 | strTitle = simplifiedName.left( spPos ); |
932 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 935 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
933 | strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 936 | strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
934 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); | 937 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); |
935 | strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); | 938 | strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); |
936 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 939 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
937 | strLastName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 940 | strLastName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
938 | strSuffix = simplifiedName.mid( spPos2 + 1 ); | 941 | strSuffix = simplifiedName.mid( spPos2 + 1 ); |
939 | break; | 942 | break; |
940 | 943 | ||
941 | default: | 944 | default: |
942 | spPos = simplifiedName.find( ' ', 0, TRUE ); | 945 | spPos = simplifiedName.find( ' ', 0, TRUE ); |
943 | strTitle = simplifiedName.left( spPos ); | 946 | strTitle = simplifiedName.left( spPos ); |
944 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 947 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
945 | strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 948 | strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
946 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); | 949 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); |
947 | strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); | 950 | strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); |
948 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 951 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
949 | strLastName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 952 | strLastName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
950 | strSuffix = simplifiedName.mid( spPos2 + 1 ); | 953 | strSuffix = simplifiedName.mid( spPos2 + 1 ); |
951 | break; | 954 | break; |
952 | } | 955 | } |
953 | } else { | 956 | } else { |
954 | simplifiedName.replace( commapos, 1, " " ); | 957 | simplifiedName.replace( commapos, 1, " " ); |
955 | simplifiedName = simplifiedName.simplifyWhiteSpace(); | 958 | simplifiedName = simplifiedName.simplifyWhiteSpace(); |
956 | 959 | ||
957 | switch (spCount) { | 960 | switch (spCount) { |
958 | case 0: | 961 | case 0: |
959 | //return simplifiedName; | 962 | //return simplifiedName; |
960 | if (txtLastName->text() != "") { | 963 | if (txtLastName->text() != "") { |
961 | strLastName = simplifiedName; | 964 | strLastName = simplifiedName; |
962 | break; | 965 | break; |
963 | } | 966 | } |
964 | if (txtMiddleName->text() != "") { | 967 | if (txtMiddleName->text() != "") { |
965 | strMiddleName = simplifiedName; | 968 | strMiddleName = simplifiedName; |
966 | break; | 969 | break; |
967 | } | 970 | } |
968 | if (txtSuffix->text() != "") { | 971 | if (txtSuffix->text() != "") { |
969 | strSuffix = simplifiedName; | 972 | strSuffix = simplifiedName; |
970 | break; | 973 | break; |
971 | } | 974 | } |
972 | strFirstName = simplifiedName; | 975 | strFirstName = simplifiedName; |
973 | break; | 976 | break; |
974 | 977 | ||
975 | case 1: | 978 | case 1: |
976 | spPos = simplifiedName.find( ' ', 0, TRUE ); | 979 | spPos = simplifiedName.find( ' ', 0, TRUE ); |
977 | strLastName = simplifiedName.left( spPos ); | 980 | strLastName = simplifiedName.left( spPos ); |
978 | strFirstName = simplifiedName.mid( spPos + 1 ); | 981 | strFirstName = simplifiedName.mid( spPos + 1 ); |
979 | break; | 982 | break; |
980 | 983 | ||
981 | case 2: | 984 | case 2: |
982 | spPos = simplifiedName.find( ' ', 0, TRUE ); | 985 | spPos = simplifiedName.find( ' ', 0, TRUE ); |
983 | strLastName = simplifiedName.left( spPos ); | 986 | strLastName = simplifiedName.left( spPos ); |
984 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 987 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
985 | strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 988 | strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
986 | strMiddleName = simplifiedName.mid( spPos2 + 1 ); | 989 | strMiddleName = simplifiedName.mid( spPos2 + 1 ); |
987 | break; | 990 | break; |
988 | 991 | ||
989 | case 3: | 992 | case 3: |
990 | spPos = simplifiedName.find( ' ', 0, TRUE ); | 993 | spPos = simplifiedName.find( ' ', 0, TRUE ); |
991 | strLastName = simplifiedName.left( spPos ); | 994 | strLastName = simplifiedName.left( spPos ); |
992 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 995 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
993 | strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 996 | strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
994 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); | 997 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); |
995 | strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); | 998 | strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); |
996 | strSuffix = simplifiedName.mid( spPos + 1 ); | 999 | strSuffix = simplifiedName.mid( spPos + 1 ); |
997 | break; | 1000 | break; |
998 | 1001 | ||
999 | case 4: | 1002 | case 4: |
1000 | spPos = simplifiedName.find( ' ', 0, TRUE ); | 1003 | spPos = simplifiedName.find( ' ', 0, TRUE ); |
1001 | strLastName = simplifiedName.left( spPos ); | 1004 | strLastName = simplifiedName.left( spPos ); |
1002 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 1005 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
1003 | strTitle = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 1006 | strTitle = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
1004 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); | 1007 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); |
1005 | strFirstName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); | 1008 | strFirstName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 ); |
1006 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 1009 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
1007 | strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 1010 | strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
1008 | strSuffix = simplifiedName.mid( spPos2 + 1 ); | 1011 | strSuffix = simplifiedName.mid( spPos2 + 1 ); |
1009 | break; | 1012 | break; |
1010 | 1013 | ||
1011 | default: | 1014 | default: |
1012 | spPos = simplifiedName.find( ' ', 0, TRUE ); | 1015 | spPos = simplifiedName.find( ' ', 0, TRUE ); |
1013 | strLastName = simplifiedName.left( spPos ); | 1016 | strLastName = simplifiedName.left( spPos ); |
1014 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 1017 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
1015 | strTitle = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 1018 | strTitle = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
1016 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); | 1019 | spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); |
1017 | strFirstName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos ); | 1020 | strFirstName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos ); |
1018 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); | 1021 | spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); |
1019 | strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); | 1022 | strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); |
1020 | strSuffix = simplifiedName.mid( spPos2 + 1 ); | 1023 | strSuffix = simplifiedName.mid( spPos2 + 1 ); |
1021 | break; | 1024 | break; |
1022 | } | 1025 | } |
1023 | } | 1026 | } |
1024 | switch (type) { | 1027 | switch (type) { |
1025 | case NAME_FL: | 1028 | case NAME_FL: |
1026 | return strFirstName + " " + strLastName; | 1029 | return strFirstName + " " + strLastName; |
1027 | 1030 | ||
1028 | case NAME_LF: | 1031 | case NAME_LF: |
1029 | return strLastName + ", " + strFirstName; | 1032 | return strLastName + ", " + strFirstName; |
1030 | 1033 | ||
1031 | case NAME_LFM: | 1034 | case NAME_LFM: |
1032 | return strLastName + ", " + strFirstName + " " + strMiddleName; | 1035 | return strLastName + ", " + strFirstName + " " + strMiddleName; |
1033 | 1036 | ||
1034 | case NAME_FMLS: | 1037 | case NAME_FMLS: |
1035 | return strFirstName + " " + strMiddleName + " " + strLastName + " " + strSuffix; | 1038 | return strFirstName + " " + strMiddleName + " " + strLastName + " " + strSuffix; |
1036 | 1039 | ||
1037 | case NAME_F: | 1040 | case NAME_F: |
1038 | return strFirstName; | 1041 | return strFirstName; |
1039 | 1042 | ||
1040 | case NAME_M: | 1043 | case NAME_M: |
1041 | return strMiddleName; | 1044 | return strMiddleName; |
1042 | 1045 | ||
1043 | case NAME_L: | 1046 | case NAME_L: |
1044 | return strLastName; | 1047 | return strLastName; |
1045 | 1048 | ||
1046 | case NAME_S: | 1049 | case NAME_S: |
1047 | return strSuffix; | 1050 | return strSuffix; |
1048 | 1051 | ||
1049 | } | 1052 | } |
1050 | return QString::null; | 1053 | return QString::null; |
1051 | } | 1054 | } |
1052 | 1055 | ||
1053 | void ContactEditor::cleanupFields() { | 1056 | void ContactEditor::cleanupFields() { |
1054 | QStringList::Iterator it = slChooserValues.begin(); | 1057 | QStringList::Iterator it = slChooserValues.begin(); |
1055 | for ( int i = 0; it != slChooserValues.end(); i++, ++it ) { | 1058 | for ( int i = 0; it != slChooserValues.end(); i++, ++it ) { |
1056 | (*it) = ""; | 1059 | (*it) = ""; |
1057 | } | 1060 | } |
1058 | 1061 | ||
1059 | for ( int i = 0; i < 7; i++ ) { | 1062 | for ( int i = 0; i < 7; i++ ) { |
1060 | slHomeAddress[i] = ""; | 1063 | slHomeAddress[i] = ""; |
1061 | slBusinessAddress[i] = ""; | 1064 | slBusinessAddress[i] = ""; |
1062 | } | 1065 | } |
1063 | 1066 | ||
1064 | QListIterator<QLineEdit> itLV( listValue ); | 1067 | QListIterator<QLineEdit> itLV( listValue ); |
1065 | for ( ; itLV.current(); ++itLV ) { | 1068 | for ( ; itLV.current(); ++itLV ) { |
1066 | (*itLV)->setText( "" ); | 1069 | (*itLV)->setText( "" ); |
1067 | } | 1070 | } |
1068 | 1071 | ||
1069 | txtFirstName->setText(""); | 1072 | txtFirstName->setText(""); |
1070 | txtMiddleName->setText(""); | 1073 | txtMiddleName->setText(""); |
1071 | txtLastName->setText(""); | 1074 | txtLastName->setText(""); |
1072 | txtSuffix->setText(""); | 1075 | txtSuffix->setText(""); |
1073 | txtNote->setText(""); | 1076 | txtNote->setText(""); |
1074 | txtFullName->setText(""); | 1077 | txtFullName->setText(""); |
1075 | txtJobTitle->setText(""); | 1078 | txtJobTitle->setText(""); |
1076 | txtOrganization->setText(""); | 1079 | txtOrganization->setText(""); |
1077 | txtChooserField1->setText(""); | 1080 | txtChooserField1->setText(""); |
1078 | txtChooserField2->setText(""); | 1081 | txtChooserField2->setText(""); |
1079 | txtChooserField3->setText(""); | 1082 | txtChooserField3->setText(""); |
1080 | txtAddress->setText(""); | 1083 | txtAddress->setText(""); |
1081 | txtCity->setText(""); | 1084 | txtCity->setText(""); |
1082 | txtState->setText(""); | 1085 | txtState->setText(""); |
1083 | txtZip->setText(""); | 1086 | txtZip->setText(""); |
1084 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 1087 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
1085 | txtTmp->setText(""); | 1088 | txtTmp->setText(""); |
1086 | txtTmp = cmbFileAs->lineEdit(); | 1089 | txtTmp = cmbFileAs->lineEdit(); |
1087 | txtTmp->setText(""); | 1090 | txtTmp->setText(""); |
1088 | 1091 | ||
1089 | } | 1092 | } |
1090 | 1093 | ||
1091 | void ContactEditor::setEntry( const OContact &entry ) { | 1094 | void ContactEditor::setEntry( const OContact &entry ) { |
1092 | 1095 | ||
1093 | cleanupFields(); | 1096 | cleanupFields(); |
1094 | 1097 | ||
1095 | ent = entry; | 1098 | ent = entry; |
1096 | 1099 | ||
1097 | useFullName = false; | 1100 | useFullName = false; |
1098 | txtFirstName->setText( ent.firstName() ); | 1101 | txtFirstName->setText( ent.firstName() ); |
1099 | txtMiddleName->setText( ent.middleName() ); | 1102 | txtMiddleName->setText( ent.middleName() ); |
1100 | txtLastName->setText( ent.lastName() ); | 1103 | txtLastName->setText( ent.lastName() ); |
1101 | txtSuffix->setText( ent.suffix() ); | 1104 | txtSuffix->setText( ent.suffix() ); |
1102 | 1105 | ||
1103 | QString *tmpString = new QString; | 1106 | QString *tmpString = new QString; |
1104 | *tmpString = ent.firstName() + " " + ent.middleName() + | 1107 | *tmpString = ent.firstName() + " " + ent.middleName() + |
1105 | + " " + ent.lastName() + " " + ent.suffix(); | 1108 | + " " + ent.lastName() + " " + ent.suffix(); |
1106 | 1109 | ||
1107 | txtFullName->setText( tmpString->simplifyWhiteSpace() ); | 1110 | txtFullName->setText( tmpString->simplifyWhiteSpace() ); |
1108 | 1111 | ||
1109 | cmbFileAs->setEditText( ent.fileAs() ); | 1112 | cmbFileAs->setEditText( ent.fileAs() ); |
1110 | 1113 | ||
1111 | //if (hasTitle) | 1114 | //if (hasTitle) |
1112 | txtJobTitle->setText( ent.jobTitle() ); | 1115 | txtJobTitle->setText( ent.jobTitle() ); |
1113 | 1116 | ||
1114 | //if (hasCompany) | 1117 | //if (hasCompany) |
1115 | txtOrganization->setText( ent.company() ); | 1118 | txtOrganization->setText( ent.company() ); |
1116 | 1119 | ||
1117 | //if (hasNotes) | 1120 | //if (hasNotes) |
1118 | txtNote->setText( ent.notes() ); | 1121 | txtNote->setText( ent.notes() ); |
1119 | 1122 | ||
1120 | //if (hasStreet) { | 1123 | //if (hasStreet) { |
1121 | slHomeAddress[0] = ent.homeStreet(); | 1124 | slHomeAddress[0] = ent.homeStreet(); |
1122 | slBusinessAddress[0] = ent.businessStreet(); | 1125 | slBusinessAddress[0] = ent.businessStreet(); |
1123 | //} | 1126 | //} |
1124 | 1127 | ||
1125 | //if (hasCity) { | 1128 | //if (hasCity) { |
1126 | slHomeAddress[3] = ent.homeCity(); | 1129 | slHomeAddress[3] = ent.homeCity(); |
1127 | slBusinessAddress[3] = ent.businessCity(); | 1130 | slBusinessAddress[3] = ent.businessCity(); |
1128 | //} | 1131 | //} |
1129 | 1132 | ||
1130 | //if (hasState) { | 1133 | //if (hasState) { |
1131 | slHomeAddress[4] = ent.homeState(); | 1134 | slHomeAddress[4] = ent.homeState(); |
1132 | slBusinessAddress[4] = ent.businessState(); | 1135 | slBusinessAddress[4] = ent.businessState(); |
1133 | //} | 1136 | //} |
1134 | 1137 | ||
1135 | //if (hasZip) { | 1138 | //if (hasZip) { |
1136 | slHomeAddress[5] = ent.homeZip(); | 1139 | slHomeAddress[5] = ent.homeZip(); |
1137 | slBusinessAddress[5] = ent.businessZip(); | 1140 | slBusinessAddress[5] = ent.businessZip(); |
1138 | //} | 1141 | //} |
1139 | 1142 | ||
1140 | //if (hasCountry) { | 1143 | //if (hasCountry) { |
1141 | slHomeAddress[6] = ent.homeCountry(); | 1144 | slHomeAddress[6] = ent.homeCountry(); |
1142 | slBusinessAddress[6] = ent.businessCountry(); | 1145 | slBusinessAddress[6] = ent.businessCountry(); |
1143 | //} | 1146 | //} |
1144 | 1147 | ||
1145 | QStringList::ConstIterator it; | 1148 | QStringList::ConstIterator it; |
1146 | QListIterator<QLineEdit> itLE( listValue ); | 1149 | QListIterator<QLineEdit> itLE( listValue ); |