-rw-r--r-- | core/pim/addressbook/contacteditor.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp index 0c90510..66e94ef 100644 --- a/core/pim/addressbook/contacteditor.cpp +++ b/core/pim/addressbook/contacteditor.cpp | |||
@@ -11,672 +11,672 @@ | |||
11 | #include <qtabwidget.h> | 11 | #include <qtabwidget.h> |
12 | #include <qlayout.h> | 12 | #include <qlayout.h> |
13 | #include <qlineedit.h> | 13 | #include <qlineedit.h> |
14 | #include <qmultilineedit.h> | 14 | #include <qmultilineedit.h> |
15 | #include <qscrollview.h> | 15 | #include <qscrollview.h> |
16 | #include <qtoolbutton.h> | 16 | #include <qtoolbutton.h> |
17 | #include <qpushbutton.h> | 17 | #include <qpushbutton.h> |
18 | #include <qmainwindow.h> | 18 | #include <qmainwindow.h> |
19 | #include <qvaluelist.h> | 19 | #include <qvaluelist.h> |
20 | 20 | ||
21 | static inline bool containsAlphaNum( const QString &str ); | 21 | static inline bool containsAlphaNum( const QString &str ); |
22 | static inline bool constainsWhiteSpace( const QString &str ); | 22 | static inline bool constainsWhiteSpace( const QString &str ); |
23 | 23 | ||
24 | // helper functions, convert our comma delimited list to proper | 24 | // helper functions, convert our comma delimited list to proper |
25 | // file format... | 25 | // file format... |
26 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, | 26 | void parseEmailFrom( const QString &txt, QString &strDefaultEmail, |
27 | QString &strAll ); | 27 | QString &strAll ); |
28 | 28 | ||
29 | // helper convert from file format to comma delimited... | 29 | // helper convert from file format to comma delimited... |
30 | void parseEmailTo( const QString &strDefaultEmail, | 30 | void parseEmailTo( const QString &strDefaultEmail, |
31 | const QString &strOtherEmail, QString &strBack ); | 31 | const QString &strOtherEmail, QString &strBack ); |
32 | 32 | ||
33 | ContactEditor::ContactEditor(const Contact &entry, | 33 | ContactEditor::ContactEditor(const Contact &entry, |
34 | const QValueList<int> *newOrderedValues, | 34 | const QValueList<int> *newOrderedValues, |
35 | QStringList *slNewOrdered, | 35 | QStringList *slNewOrdered, |
36 | QWidget *parent = 0, | 36 | QWidget *parent = 0, |
37 | const char *name = 0, | 37 | const char *name = 0, |
38 | WFlags fl = 0 ) | 38 | WFlags fl = 0 ) |
39 | : QDialog( parent, name, TRUE, fl ), | 39 | : QDialog( parent, name, TRUE, fl ), |
40 | orderedValues( newOrderedValues ), | 40 | orderedValues( newOrderedValues ), |
41 | slOrdered( slNewOrdered ) | 41 | slOrdered( slNewOrdered ) |
42 | { | 42 | { |
43 | 43 | ||
44 | init(); | 44 | init(); |
45 | initMap(); | 45 | initMap(); |
46 | setEntry( entry ); | 46 | setEntry( entry ); |
47 | qDebug("finish"); | 47 | qDebug("finish"); |
48 | } | 48 | } |
49 | 49 | ||
50 | ContactEditor::~ContactEditor() { | 50 | ContactEditor::~ContactEditor() { |
51 | } | 51 | } |
52 | 52 | ||
53 | void ContactEditor::init() { | 53 | void ContactEditor::init() { |
54 | 54 | ||
55 | useFullName = TRUE; | 55 | useFullName = TRUE; |
56 | 56 | ||
57 | int i = 0; | 57 | int i = 0; |
58 | 58 | ||
59 | slHomeAddress = new QStringList; | 59 | slHomeAddress = new QStringList; |
60 | slBusinessAddress = new QStringList; | 60 | slBusinessAddress = new QStringList; |
61 | slChooserNames = new QStringList; | 61 | slChooserNames = new QStringList; |
62 | slChooserValues = new QStringList; | 62 | slChooserValues = new QStringList; |
63 | 63 | ||
64 | slDynamicEntries = new QStringList; | 64 | slDynamicEntries = new QStringList; |
65 | 65 | ||
66 | //*slDynamicEntries = *slOrdered; | 66 | //*slDynamicEntries = *slOrdered; |
67 | 67 | ||
68 | for (i = 0; i <= 6; i++) { | 68 | for (i = 0; i <= 6; i++) { |
69 | slHomeAddress->append( "" ); | 69 | slHomeAddress->append( "" ); |
70 | slBusinessAddress->append( "" ); | 70 | slBusinessAddress->append( "" ); |
71 | } | 71 | } |
72 | 72 | ||
73 | { | 73 | { |
74 | hasGender = FALSE; | 74 | hasGender = FALSE; |
75 | hasTitle = FALSE; | 75 | hasTitle = FALSE; |
76 | hasCompany = FALSE; | 76 | hasCompany = FALSE; |
77 | hasNotes = FALSE; | 77 | hasNotes = FALSE; |
78 | hasStreet = FALSE; | 78 | hasStreet = FALSE; |
79 | hasStreet2 = FALSE; | 79 | hasStreet2 = FALSE; |
80 | hasPOBox = FALSE; | 80 | hasPOBox = FALSE; |
81 | hasCity = FALSE; | 81 | hasCity = FALSE; |
82 | hasState = FALSE; | 82 | hasState = FALSE; |
83 | hasZip = FALSE; | 83 | hasZip = FALSE; |
84 | hasCountry = FALSE; | 84 | hasCountry = FALSE; |
85 | 85 | ||
86 | QStringList::ConstIterator it = slOrdered->begin(); | 86 | QStringList::ConstIterator it = slOrdered->begin(); |
87 | for ( i = 0; it != slOrdered->end(); i++, ++it ) { | 87 | for ( i = 0; it != slOrdered->end(); i++, ++it ) { |
88 | 88 | ||
89 | if ( (*it).right( 3 ) == tr( "Fax" ) ) { | 89 | if ( (*it).right( 3 ) == tr( "Fax" ) ) { |
90 | slChooserNames->append( *it ); | 90 | slChooserNames->append( *it ); |
91 | slChooserValues->append( tr( "" ) ); | 91 | slChooserValues->append( tr( "" ) ); |
92 | //slDynamicEntries->remove( it ); | 92 | //slDynamicEntries->remove( it ); |
93 | continue; | 93 | continue; |
94 | } | 94 | } |
95 | 95 | ||
96 | if ( (*it).right( 5 ) == tr( "Phone" ) ) { | 96 | if ( (*it).right( 5 ) == tr( "Phone" ) ) { |
97 | slChooserNames->append( *it ); | 97 | slChooserNames->append( *it ); |
98 | slChooserValues->append( "" ); | 98 | slChooserValues->append( "" ); |
99 | //slDynamicEntries->remove( it ); | 99 | //slDynamicEntries->remove( it ); |
100 | continue; | 100 | continue; |
101 | } | 101 | } |
102 | 102 | ||
103 | if ( (*it).right( 2 ) == tr( "IM" ) ) { | 103 | if ( (*it).right( 2 ) == tr( "IM" ) ) { |
104 | slChooserNames->append( *it ); | 104 | slChooserNames->append( *it ); |
105 | slChooserValues->append( "" ); | 105 | slChooserValues->append( "" ); |
106 | //slDynamicEntries->remove( it ); | 106 | //slDynamicEntries->remove( it ); |
107 | continue; | 107 | continue; |
108 | } | 108 | } |
109 | 109 | ||
110 | if ( (*it).right( 6 ) == tr( "Mobile" ) ) { | 110 | if ( (*it).right( 6 ) == tr( "Mobile" ) ) { |
111 | slChooserNames->append( *it ); | 111 | slChooserNames->append( *it ); |
112 | slChooserValues->append( "" ); | 112 | slChooserValues->append( "" ); |
113 | //slDynamicEntries->remove( it ); | 113 | //slDynamicEntries->remove( it ); |
114 | continue; | 114 | continue; |
115 | } | 115 | } |
116 | 116 | ||
117 | if ( (*it).right( 4 ) == tr( "Page" ) ) { | 117 | if ( (*it).right( 4 ) == tr( "Page" ) ) { |
118 | slChooserNames->append( *it ); | 118 | slChooserNames->append( *it ); |
119 | slChooserValues->append( "" ); | 119 | slChooserValues->append( "" ); |
120 | //slDynamicEntries->remove( it ); | 120 | //slDynamicEntries->remove( it ); |
121 | continue; | 121 | continue; |
122 | } | 122 | } |
123 | 123 | ||
124 | if ( (*it).right( 5 ) == tr( "Pager" ) ) { | 124 | if ( (*it).right( 5 ) == tr( "Pager" ) ) { |
125 | slChooserNames->append( *it ); | 125 | slChooserNames->append( *it ); |
126 | slChooserValues->append( "" ); | 126 | slChooserValues->append( "" ); |
127 | //slDynamicEntries->remove( it ); | 127 | //slDynamicEntries->remove( it ); |
128 | continue; | 128 | continue; |
129 | } | 129 | } |
130 | 130 | ||
131 | if ( *it == tr( "Default Email" ) ) { | 131 | if ( *it == tr( "Default Email" ) ) { |
132 | slChooserNames->append( *it ); | 132 | slChooserNames->append( *it ); |
133 | slChooserValues->append( "" ); | 133 | slChooserValues->append( "" ); |
134 | //slDynamicEntries->remove( it ); | 134 | //slDynamicEntries->remove( it ); |
135 | continue; | 135 | continue; |
136 | } | 136 | } |
137 | 137 | ||
138 | if ( *it == tr( "Emails" ) ) { | 138 | if ( *it == tr( "Emails" ) ) { |
139 | slChooserNames->append( *it ); | 139 | slChooserNames->append( *it ); |
140 | slChooserValues->append( "" ); | 140 | slChooserValues->append( "" ); |
141 | //slDynamicEntries->remove( it ); | 141 | //slDynamicEntries->remove( it ); |
142 | continue; | 142 | continue; |
143 | } | 143 | } |
144 | 144 | ||
145 | if ( *it == tr( "Name Title" ) ) { | 145 | if ( *it == tr( "Name Title" ) ) { |
146 | //slDynamicEntries->remove( it ); | 146 | //slDynamicEntries->remove( it ); |
147 | continue; | 147 | continue; |
148 | } | 148 | } |
149 | 149 | ||
150 | if ( *it == tr( "First Name" ) ) { | 150 | if ( *it == tr( "First Name" ) ) { |
151 | //slDynamicEntries->remove( it ); | 151 | //slDynamicEntries->remove( it ); |
152 | continue; | 152 | continue; |
153 | } | 153 | } |
154 | 154 | ||
155 | if ( *it == tr( "Middle Name" ) ) { | 155 | if ( *it == tr( "Middle Name" ) ) { |
156 | //slDynamicEntries->remove( it ); | 156 | //slDynamicEntries->remove( it ); |
157 | continue; | 157 | continue; |
158 | } | 158 | } |
159 | 159 | ||
160 | if ( *it == tr( "Last Name" ) ) { | 160 | if ( *it == tr( "Last Name" ) ) { |
161 | //slDynamicEntries->remove( it ); | 161 | //slDynamicEntries->remove( it ); |
162 | continue; | 162 | continue; |
163 | } | 163 | } |
164 | 164 | ||
165 | if ( *it == tr( "Suffix" ) ) { | 165 | if ( *it == tr( "Suffix" ) ) { |
166 | //slDynamicEntries->remove( it ); | 166 | //slDynamicEntries->remove( it ); |
167 | continue; | 167 | continue; |
168 | } | 168 | } |
169 | 169 | ||
170 | if ( *it == tr( "File As" ) ) { | 170 | if ( *it == tr( "File As" ) ) { |
171 | //slDynamicEntries->remove( it ); | 171 | //slDynamicEntries->remove( it ); |
172 | continue; | 172 | continue; |
173 | } | 173 | } |
174 | 174 | ||
175 | if ( *it == tr( "Gender" ) ) { | 175 | if ( *it == tr( "Gender" ) ) { |
176 | hasGender = TRUE; | 176 | hasGender = TRUE; |
177 | //slDynamicEntries->remove( it ); | 177 | //slDynamicEntries->remove( it ); |
178 | continue; | 178 | continue; |
179 | } | 179 | } |
180 | 180 | ||
181 | if ( *it == tr( "Job Title" ) ) { | 181 | if ( *it == tr( "Job Title" ) ) { |
182 | hasTitle = TRUE; | 182 | hasTitle = TRUE; |
183 | //slDynamicEntries->remove( it ); | 183 | //slDynamicEntries->remove( it ); |
184 | continue; | 184 | continue; |
185 | } | 185 | } |
186 | 186 | ||
187 | if ( *it == tr( "Company" ) ) { | 187 | if ( *it == tr( "Company" ) ) { |
188 | hasCompany = TRUE; | 188 | hasCompany = TRUE; |
189 | //slDynamicEntries->remove( it ); | 189 | //slDynamicEntries->remove( it ); |
190 | continue; | 190 | continue; |
191 | } | 191 | } |
192 | 192 | ||
193 | if ( *it == tr( "Notes" ) ) { | 193 | if ( *it == tr( "Notes" ) ) { |
194 | hasNotes = TRUE; | 194 | hasNotes = TRUE; |
195 | //slDynamicEntries->remove( it ); | 195 | //slDynamicEntries->remove( it ); |
196 | continue; | 196 | continue; |
197 | } | 197 | } |
198 | 198 | ||
199 | if ( *it == tr( "Groups" ) ) { | 199 | if ( *it == tr( "Groups" ) ) { |
200 | //slDynamicEntries->remove( it ); | 200 | //slDynamicEntries->remove( it ); |
201 | continue; | 201 | continue; |
202 | } | 202 | } |
203 | 203 | ||
204 | if ( (*it).right( 6 ) == tr( "Street" ) ) { | 204 | if ( (*it).right( 6 ) == tr( "Street" ) ) { |
205 | hasStreet = TRUE; | 205 | hasStreet = TRUE; |
206 | //slDynamicEntries->remove( it ); | 206 | //slDynamicEntries->remove( it ); |
207 | continue; | 207 | continue; |
208 | } | 208 | } |
209 | 209 | ||
210 | if ( (*it).right( 8 ) == tr( "Street 2" ) ) { | 210 | if ( (*it).right( 8 ) == tr( "Street 2" ) ) { |
211 | hasStreet2 = TRUE; | 211 | hasStreet2 = TRUE; |
212 | //slDynamicEntries->remove( it ); | 212 | //slDynamicEntries->remove( it ); |
213 | continue; | 213 | continue; |
214 | } | 214 | } |
215 | 215 | ||
216 | if ( (*it).right( 8 ) == tr( "P.O. Box" ) ) { | 216 | if ( (*it).right( 8 ) == tr( "P.O. Box" ) ) { |
217 | hasPOBox = TRUE; | 217 | hasPOBox = TRUE; |
218 | //slDynamicEntries->remove( it ); | 218 | //slDynamicEntries->remove( it ); |
219 | continue; | 219 | continue; |
220 | } | 220 | } |
221 | 221 | ||
222 | if ( (*it).right( 4 ) == tr( "City" ) ) { | 222 | if ( (*it).right( 4 ) == tr( "City" ) ) { |
223 | hasCity = TRUE; | 223 | hasCity = TRUE; |
224 | //slDynamicEntries->remove( it ); | 224 | //slDynamicEntries->remove( it ); |
225 | continue; | 225 | continue; |
226 | } | 226 | } |
227 | 227 | ||
228 | if ( (*it).right( 5 ) == tr( "State" ) ) { | 228 | if ( (*it).right( 5 ) == tr( "State" ) ) { |
229 | hasState = TRUE; | 229 | hasState = TRUE; |
230 | //slDynamicEntries->remove( it ); | 230 | //slDynamicEntries->remove( it ); |
231 | continue; | 231 | continue; |
232 | } | 232 | } |
233 | 233 | ||
234 | if ( (*it).right( 3 ) == tr( "Zip" ) ) { | 234 | if ( (*it).right( 3 ) == tr( "Zip" ) ) { |
235 | hasZip = TRUE; | 235 | hasZip = TRUE; |
236 | //slDynamicEntries->remove( it ); | 236 | //slDynamicEntries->remove( it ); |
237 | continue; | 237 | continue; |
238 | } | 238 | } |
239 | 239 | ||
240 | if ( (*it).right( 7 ) == tr( "Country" ) ) { | 240 | if ( (*it).right( 7 ) == tr( "Country" ) ) { |
241 | hasCountry = TRUE; | 241 | hasCountry = TRUE; |
242 | //slDynamicEntries->remove( it ); | 242 | //slDynamicEntries->remove( it ); |
243 | continue; | 243 | continue; |
244 | } | 244 | } |
245 | 245 | ||
246 | slDynamicEntries->append( *it ); | 246 | slDynamicEntries->append( *it ); |
247 | } | 247 | } |
248 | } | 248 | } |
249 | 249 | ||
250 | QVBoxLayout *vb = new QVBoxLayout( this ); | 250 | QVBoxLayout *vb = new QVBoxLayout( this ); |
251 | 251 | ||
252 | tabMain = new QTabWidget( this ); | 252 | tabMain = new QTabWidget( this ); |
253 | vb->addWidget( tabMain ); | 253 | vb->addWidget( tabMain ); |
254 | 254 | ||
255 | QWidget *tabViewport = new QWidget ( tabMain ); | 255 | QWidget *tabViewport = new QWidget ( tabMain ); |
256 | 256 | ||
257 | vb = new QVBoxLayout( tabViewport ); | 257 | vb = new QVBoxLayout( tabViewport ); |
258 | 258 | ||
259 | svGeneral = new QScrollView( tabViewport ); | 259 | svGeneral = new QScrollView( tabViewport ); |
260 | vb->addWidget( svGeneral, 0, 0 ); | 260 | vb->addWidget( svGeneral, 0, 0 ); |
261 | svGeneral->setResizePolicy( QScrollView::AutoOneFit ); | 261 | svGeneral->setResizePolicy( QScrollView::AutoOneFit ); |
262 | svGeneral->setFrameStyle( QFrame::NoFrame ); | 262 | svGeneral->setFrameStyle( QFrame::NoFrame ); |
263 | 263 | ||
264 | QWidget *container = new QWidget( svGeneral->viewport() ); | 264 | QWidget *container = new QWidget( svGeneral->viewport() ); |
265 | svGeneral->addChild( container ); | 265 | svGeneral->addChild( container ); |
266 | 266 | ||
267 | QGridLayout *gl = new QGridLayout( container ); | 267 | QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 3 ); |
268 | gl->setResizeMode( QLayout::FreeResize ); | 268 | gl->setResizeMode( QLayout::FreeResize ); |
269 | 269 | ||
270 | btnFullName = new QPushButton( tr( "Full Name..." ), container ); | 270 | btnFullName = new QPushButton( tr( "Full Name..." ), container ); |
271 | gl->addWidget( btnFullName, 0, 0 ); | 271 | gl->addWidget( btnFullName, 0, 0 ); |
272 | txtFullName = new QLineEdit( container ); | 272 | txtFullName = new QLineEdit( container ); |
273 | gl->addWidget( txtFullName, 0, 1 ); | 273 | gl->addWidget( txtFullName, 0, 1 ); |
274 | 274 | ||
275 | QLabel *l = new QLabel( tr( "Job Title" ), container ); | 275 | QLabel *l = new QLabel( tr( "Job Title" ), container ); |
276 | gl->addWidget( l, 1, 0 ); | 276 | gl->addWidget( l, 1, 0 ); |
277 | txtJobTitle = new QLineEdit( container ); | 277 | txtJobTitle = new QLineEdit( container ); |
278 | gl->addWidget( txtJobTitle, 1, 1 ); | 278 | gl->addWidget( txtJobTitle, 1, 1 ); |
279 | 279 | ||
280 | l = new QLabel( tr( "Organization" ), container ); | 280 | l = new QLabel( tr( "Organization" ), container ); |
281 | gl->addWidget( l, 2, 0 ); | 281 | gl->addWidget( l, 2, 0 ); |
282 | txtOrganization = new QLineEdit( container ); | 282 | txtOrganization = new QLineEdit( container ); |
283 | gl->addWidget( txtOrganization, 2, 1 ); | 283 | gl->addWidget( txtOrganization, 2, 1 ); |
284 | 284 | ||
285 | cmbChooserField1 = new QComboBox( FALSE, container ); | 285 | cmbChooserField1 = new QComboBox( FALSE, container ); |
286 | cmbChooserField1->setMaximumWidth( 100 ); | 286 | cmbChooserField1->setMaximumWidth( 100 ); |
287 | gl->addWidget( cmbChooserField1, 3, 0 ); | 287 | gl->addWidget( cmbChooserField1, 3, 0 ); |
288 | txtChooserField1 = new QLineEdit( container ); | 288 | txtChooserField1 = new QLineEdit( container ); |
289 | gl->addWidget( txtChooserField1, 3, 1 ); | 289 | gl->addWidget( txtChooserField1, 3, 1 ); |
290 | 290 | ||
291 | cmbChooserField2 = new QComboBox( FALSE, container ); | 291 | cmbChooserField2 = new QComboBox( FALSE, container ); |
292 | cmbChooserField2->setMaximumWidth( 100 ); | 292 | cmbChooserField2->setMaximumWidth( 100 ); |
293 | gl->addWidget( cmbChooserField2, 4, 0 ); | 293 | gl->addWidget( cmbChooserField2, 4, 0 ); |
294 | txtChooserField2 = new QLineEdit( container ); | 294 | txtChooserField2 = new QLineEdit( container ); |
295 | gl->addWidget( txtChooserField2, 4, 1 ); | 295 | gl->addWidget( txtChooserField2, 4, 1 ); |
296 | 296 | ||
297 | cmbChooserField3 = new QComboBox( FALSE, container ); | 297 | cmbChooserField3 = new QComboBox( FALSE, container ); |
298 | cmbChooserField3->setMaximumWidth( 100 ); | 298 | cmbChooserField3->setMaximumWidth( 100 ); |
299 | gl->addWidget( cmbChooserField3, 5, 0 ); | 299 | gl->addWidget( cmbChooserField3, 5, 0 ); |
300 | txtChooserField3 = new QLineEdit( container ); | 300 | txtChooserField3 = new QLineEdit( container ); |
301 | gl->addWidget( txtChooserField3, 5, 1 ); | 301 | gl->addWidget( txtChooserField3, 5, 1 ); |
302 | 302 | ||
303 | l = new QLabel( tr( "File As" ), container ); | 303 | l = new QLabel( tr( "File As" ), container ); |
304 | gl->addWidget( l, 6, 0 ); | 304 | gl->addWidget( l, 6, 0 ); |
305 | cmbFileAs = new QComboBox( TRUE, container ); | 305 | cmbFileAs = new QComboBox( TRUE, container ); |
306 | gl->addWidget( cmbFileAs, 6, 1 ); | 306 | gl->addWidget( cmbFileAs, 6, 1 ); |
307 | 307 | ||
308 | l = new QLabel( tr( "Category" ), container ); | 308 | l = new QLabel( tr( "Category" ), container ); |
309 | gl->addWidget( l, 7, 0 ); | 309 | gl->addWidget( l, 7, 0 ); |
310 | cmbCat = new CategorySelect( container ); | 310 | cmbCat = new CategorySelect( container ); |
311 | gl->addWidget( cmbCat, 7, 1 ); | 311 | gl->addWidget( cmbCat, 7, 1 ); |
312 | 312 | ||
313 | btnNote = new QPushButton( tr( "Notes..." ), container ); | 313 | btnNote = new QPushButton( tr( "Notes..." ), container ); |
314 | gl->addWidget( btnNote, 8, 1 ); | 314 | gl->addWidget( btnNote, 8, 1 ); |
315 | 315 | ||
316 | tabMain->insertTab( tabViewport, tr( "General" ) ); | 316 | tabMain->insertTab( tabViewport, tr( "General" ) ); |
317 | 317 | ||
318 | tabViewport = new QWidget ( tabMain ); | 318 | tabViewport = new QWidget ( tabMain ); |
319 | 319 | ||
320 | vb = new QVBoxLayout( tabViewport ); | 320 | vb = new QVBoxLayout( tabViewport ); |
321 | 321 | ||
322 | svAddress = new QScrollView( tabViewport ); | 322 | svAddress = new QScrollView( tabViewport ); |
323 | vb->addWidget( svAddress, 0, 0 ); | 323 | vb->addWidget( svAddress, 0, 0 ); |
324 | svAddress->setResizePolicy( QScrollView::AutoOneFit ); | 324 | svAddress->setResizePolicy( QScrollView::AutoOneFit ); |
325 | svAddress->setFrameStyle( QFrame::NoFrame ); | 325 | svAddress->setFrameStyle( QFrame::NoFrame ); |
326 | 326 | ||
327 | container = new QWidget( svAddress->viewport() ); | 327 | container = new QWidget( svAddress->viewport() ); |
328 | svAddress->addChild( container ); | 328 | svAddress->addChild( container ); |
329 | 329 | ||
330 | gl = new QGridLayout( container, 5, 3, 0, 1 ); | 330 | gl = new QGridLayout( container, 5, 3, 2, 3 ); |
331 | 331 | ||
332 | cmbAddress = new QComboBox( FALSE, container ); | 332 | cmbAddress = new QComboBox( FALSE, container ); |
333 | cmbAddress->insertItem( tr( "Business" ) ); | 333 | cmbAddress->insertItem( tr( "Business" ) ); |
334 | cmbAddress->insertItem( tr( "Home" ) ); | 334 | cmbAddress->insertItem( tr( "Home" ) ); |
335 | gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 ); | 335 | gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 ); |
336 | 336 | ||
337 | l = new QLabel( tr( "Address" ), container ); | 337 | l = new QLabel( tr( "Address" ), container ); |
338 | gl->addWidget( l, 1, 0 ); | 338 | gl->addWidget( l, 1, 0 ); |
339 | txtAddress = new QLineEdit( container ); | 339 | txtAddress = new QLineEdit( container ); |
340 | gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 ); | 340 | gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 ); |
341 | /* | 341 | /* |
342 | l = new QLabel( tr( "Address 2" ), container ); | 342 | l = new QLabel( tr( "Address 2" ), container ); |
343 | gl->addWidget( l, 2, 0 ); | 343 | gl->addWidget( l, 2, 0 ); |
344 | txtAddress2 = new QLineEdit( container ); | 344 | txtAddress2 = new QLineEdit( container ); |
345 | gl->addMultiCellWidget( txtAddress2, 2, 2, 1, 2 ); | 345 | gl->addMultiCellWidget( txtAddress2, 2, 2, 1, 2 ); |
346 | 346 | ||
347 | l = new QLabel( tr( "P.O. Box" ), container ); | 347 | l = new QLabel( tr( "P.O. Box" ), container ); |
348 | gl->addWidget( l, 3, 0 ); | 348 | gl->addWidget( l, 3, 0 ); |
349 | txtPOBox = new QLineEdit( container ); | 349 | txtPOBox = new QLineEdit( container ); |
350 | gl->addMultiCellWidget( txtPOBox, 3, 3, 1, 2 ); | 350 | gl->addMultiCellWidget( txtPOBox, 3, 3, 1, 2 ); |
351 | */ | 351 | */ |
352 | l = new QLabel( tr( "City" ), container ); | 352 | l = new QLabel( tr( "City" ), container ); |
353 | gl->addWidget( l, 2, 0 ); | 353 | gl->addWidget( l, 2, 0 ); |
354 | txtCity = new QLineEdit( container ); | 354 | txtCity = new QLineEdit( container ); |
355 | gl->addMultiCellWidget( txtCity, 2, 2, 1, 2 ); | 355 | gl->addMultiCellWidget( txtCity, 2, 2, 1, 2 ); |
356 | 356 | ||
357 | l = new QLabel( tr( "State" ), container ); | 357 | l = new QLabel( tr( "State" ), container ); |
358 | gl->addWidget( l, 3, 0 ); | 358 | gl->addWidget( l, 3, 0 ); |
359 | txtState = new QLineEdit( container ); | 359 | txtState = new QLineEdit( container ); |
360 | gl->addMultiCellWidget( txtState, 3, 3, 1, 2 ); | 360 | gl->addMultiCellWidget( txtState, 3, 3, 1, 2 ); |
361 | 361 | ||
362 | l = new QLabel( tr( "Zip Code" ), container ); | 362 | l = new QLabel( tr( "Zip Code" ), container ); |
363 | gl->addWidget( l, 4, 0 ); | 363 | gl->addWidget( l, 4, 0 ); |
364 | txtZip = new QLineEdit( container ); | 364 | txtZip = new QLineEdit( container ); |
365 | gl->addMultiCellWidget( txtZip, 4, 4, 1, 2 ); | 365 | gl->addMultiCellWidget( txtZip, 4, 4, 1, 2 ); |
366 | 366 | ||
367 | l = new QLabel( tr( "Country" ), container ); | 367 | l = new QLabel( tr( "Country" ), container ); |
368 | gl->addWidget( l, 5, 0 ); | 368 | gl->addWidget( l, 5, 0 ); |
369 | cmbCountry = new QComboBox( TRUE, container ); | 369 | cmbCountry = new QComboBox( TRUE, container ); |
370 | cmbCountry->insertItem( tr( "" ) ); | 370 | cmbCountry->insertItem( tr( "" ) ); |
371 | cmbCountry->insertItem( tr( "United States" ) ); | 371 | cmbCountry->insertItem( tr( "United States" ) ); |
372 | cmbCountry->insertItem( tr( "United Kingdom" ) ); | 372 | cmbCountry->insertItem( tr( "United Kingdom" ) ); |
373 | cmbCountry->insertItem( tr( "Japan" ) ); | 373 | cmbCountry->insertItem( tr( "Japan" ) ); |
374 | cmbCountry->insertItem( tr( "France" ) ); | 374 | cmbCountry->insertItem( tr( "France" ) ); |
375 | cmbCountry->insertItem( tr( "Germany" ) ); | 375 | cmbCountry->insertItem( tr( "Germany" ) ); |
376 | cmbCountry->insertItem( tr( "Norway" ) ); | 376 | cmbCountry->insertItem( tr( "Norway" ) ); |
377 | cmbCountry->insertItem( tr( "Canada" ) ); | 377 | cmbCountry->insertItem( tr( "Canada" ) ); |
378 | 378 | ||
379 | gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); | 379 | gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); |
380 | 380 | ||
381 | tabMain->insertTab( tabViewport, tr( "Address" ) ); | 381 | tabMain->insertTab( tabViewport, tr( "Address" ) ); |
382 | 382 | ||
383 | tabViewport = new QWidget ( tabMain ); | 383 | tabViewport = new QWidget ( tabMain ); |
384 | 384 | ||
385 | vb = new QVBoxLayout( tabViewport ); | 385 | vb = new QVBoxLayout( tabViewport ); |
386 | 386 | ||
387 | svDetails = new QScrollView( tabViewport ); | 387 | svDetails = new QScrollView( tabViewport ); |
388 | vb->addWidget( svDetails, 0, 0 ); | 388 | vb->addWidget( svDetails, 0, 0 ); |
389 | svDetails->setResizePolicy( QScrollView::AutoOneFit ); | 389 | svDetails->setResizePolicy( QScrollView::AutoOneFit ); |
390 | svDetails->setFrameStyle( QFrame::NoFrame ); | 390 | svDetails->setFrameStyle( QFrame::NoFrame ); |
391 | 391 | ||
392 | container = new QWidget( svDetails->viewport() ); | 392 | container = new QWidget( svDetails->viewport() ); |
393 | svDetails->addChild( container ); | 393 | svDetails->addChild( container ); |
394 | 394 | ||
395 | gl = new QGridLayout( container, 1, 2, 0, 1 ); | 395 | gl = new QGridLayout( container, 1, 2, 2, 3 ); |
396 | 396 | ||
397 | QStringList::ConstIterator it = slDynamicEntries->begin(); | 397 | QStringList::ConstIterator it = slDynamicEntries->begin(); |
398 | for (i = 0; it != slDynamicEntries->end(); i++, ++it) { | 398 | for (i = 0; it != slDynamicEntries->end(); i++, ++it) { |
399 | l = new QLabel( *it, container ); | 399 | l = new QLabel( *it, container ); |
400 | listName.append( l ); | 400 | listName.append( l ); |
401 | gl->addWidget( l, i, 0 ); | 401 | gl->addWidget( l, i, 0 ); |
402 | QLineEdit *e = new QLineEdit( container ); | 402 | QLineEdit *e = new QLineEdit( container ); |
403 | listValue.append( e ); | 403 | listValue.append( e ); |
404 | gl->addWidget( e, i, 1); | 404 | gl->addWidget( e, i, 1); |
405 | } | 405 | } |
406 | 406 | ||
407 | l = new QLabel( tr("Gender"), container ); | 407 | l = new QLabel( tr("Gender"), container ); |
408 | gl->addWidget( l, slDynamicEntries->count(), 0 ); | 408 | gl->addWidget( l, slDynamicEntries->count(), 0 ); |
409 | cmbGender = new QComboBox( container ); | 409 | cmbGender = new QComboBox( container ); |
410 | cmbGender->insertItem( "", 0 ); | 410 | cmbGender->insertItem( "", 0 ); |
411 | cmbGender->insertItem( tr("Male"), 1); | 411 | cmbGender->insertItem( tr("Male"), 1); |
412 | cmbGender->insertItem( tr("Female"), 2); | 412 | cmbGender->insertItem( tr("Female"), 2); |
413 | gl->addWidget( cmbGender, slDynamicEntries->count(), 1 ); | 413 | gl->addWidget( cmbGender, slDynamicEntries->count(), 1 ); |
414 | 414 | ||
415 | tabMain->insertTab( tabViewport, tr( "Details" ) ); | 415 | tabMain->insertTab( tabViewport, tr( "Details" ) ); |
416 | 416 | ||
417 | dlgNote = new QDialog( this, "Note Dialog", TRUE ); | 417 | dlgNote = new QDialog( this, "Note Dialog", TRUE ); |
418 | dlgNote->setCaption( tr("Enter Note") ); | 418 | dlgNote->setCaption( tr("Enter Note") ); |
419 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); | 419 | QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); |
420 | txtNote = new QMultiLineEdit( dlgNote ); | 420 | txtNote = new QMultiLineEdit( dlgNote ); |
421 | vbNote->addWidget( txtNote ); | 421 | vbNote->addWidget( txtNote ); |
422 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); | 422 | connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); |
423 | 423 | ||
424 | dlgName = new QDialog( this, "Name Dialog", TRUE ); | 424 | dlgName = new QDialog( this, "Name Dialog", TRUE ); |
425 | dlgName->setCaption( tr("Edit Name") ); | 425 | dlgName->setCaption( tr("Edit Name") ); |
426 | gl = new QGridLayout( dlgName, 4, 2, 0, 1 ); | 426 | gl = new QGridLayout( dlgName, 4, 2, 2, 3 ); |
427 | 427 | ||
428 | l = new QLabel( tr("First Name"), dlgName ); | 428 | l = new QLabel( tr("First Name"), dlgName ); |
429 | gl->addWidget( l, 0, 0 ); | 429 | gl->addWidget( l, 0, 0 ); |
430 | txtFirstName = new QLineEdit( dlgName ); | 430 | txtFirstName = new QLineEdit( dlgName ); |
431 | gl->addWidget( txtFirstName, 0, 1 ); | 431 | gl->addWidget( txtFirstName, 0, 1 ); |
432 | 432 | ||
433 | l = new QLabel( tr("Middle Name"), dlgName ); | 433 | l = new QLabel( tr("Middle Name"), dlgName ); |
434 | gl->addWidget( l, 1, 0 ); | 434 | gl->addWidget( l, 1, 0 ); |
435 | txtMiddleName = new QLineEdit( dlgName ); | 435 | txtMiddleName = new QLineEdit( dlgName ); |
436 | gl->addWidget( txtMiddleName, 1, 1 ); | 436 | gl->addWidget( txtMiddleName, 1, 1 ); |
437 | 437 | ||
438 | l = new QLabel( tr("Last Name"), dlgName ); | 438 | l = new QLabel( tr("Last Name"), dlgName ); |
439 | gl->addWidget( l, 2, 0 ); | 439 | gl->addWidget( l, 2, 0 ); |
440 | txtLastName = new QLineEdit( dlgName ); | 440 | txtLastName = new QLineEdit( dlgName ); |
441 | gl->addWidget( txtLastName, 2, 1 ); | 441 | gl->addWidget( txtLastName, 2, 1 ); |
442 | 442 | ||
443 | l = new QLabel( tr("Suffix"), dlgName ); | 443 | l = new QLabel( tr("Suffix"), dlgName ); |
444 | gl->addWidget( l, 3, 0 ); | 444 | gl->addWidget( l, 3, 0 ); |
445 | txtSuffix = new QLineEdit( dlgName ); | 445 | txtSuffix = new QLineEdit( dlgName ); |
446 | gl->addWidget( txtSuffix, 3, 1 ); | 446 | gl->addWidget( txtSuffix, 3, 1 ); |
447 | 447 | ||
448 | cmbChooserField1->insertStringList( *slChooserNames ); | 448 | cmbChooserField1->insertStringList( *slChooserNames ); |
449 | cmbChooserField2->insertStringList( *slChooserNames ); | 449 | cmbChooserField2->insertStringList( *slChooserNames ); |
450 | cmbChooserField3->insertStringList( *slChooserNames ); | 450 | cmbChooserField3->insertStringList( *slChooserNames ); |
451 | 451 | ||
452 | cmbChooserField1->setCurrentItem( 1 ); | 452 | cmbChooserField1->setCurrentItem( 1 ); |
453 | cmbChooserField2->setCurrentItem( 2 ); | 453 | cmbChooserField2->setCurrentItem( 2 ); |
454 | cmbChooserField3->setCurrentItem( 3 ); | 454 | cmbChooserField3->setCurrentItem( 3 ); |
455 | 455 | ||
456 | connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); | 456 | connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); |
457 | 457 | ||
458 | connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); | 458 | connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); |
459 | 459 | ||
460 | connect( txtChooserField1, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser1Change(const QString &)) ); | 460 | connect( txtChooserField1, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser1Change(const QString &)) ); |
461 | connect( txtChooserField2, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser2Change(const QString &)) ); | 461 | connect( txtChooserField2, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser2Change(const QString &)) ); |
462 | connect( txtChooserField3, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser3Change(const QString &)) ); | 462 | connect( txtChooserField3, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser3Change(const QString &)) ); |
463 | connect( txtAddress, SIGNAL(textChanged(const QString &)), this, SLOT(slotAddressChange(const QString &)) ); | 463 | connect( txtAddress, SIGNAL(textChanged(const QString &)), this, SLOT(slotAddressChange(const QString &)) ); |
464 | //connect( txtAddress2, SIGNAL(textChanged(const QString &)), this, SLOT(slotAddress2Change(const QString &)) ); | 464 | //connect( txtAddress2, SIGNAL(textChanged(const QString &)), this, SLOT(slotAddress2Change(const QString &)) ); |
465 | //connect( txtPOBox, SIGNAL(textChanged(const QString &)), this, SLOT(slotPOBoxChange(const QString &)) ); | 465 | //connect( txtPOBox, SIGNAL(textChanged(const QString &)), this, SLOT(slotPOBoxChange(const QString &)) ); |
466 | connect( txtCity, SIGNAL(textChanged(const QString &)), this, SLOT(slotCityChange(const QString &)) ); | 466 | connect( txtCity, SIGNAL(textChanged(const QString &)), this, SLOT(slotCityChange(const QString &)) ); |
467 | connect( txtState, SIGNAL(textChanged(const QString &)), this, SLOT(slotStateChange(const QString &)) ); | 467 | connect( txtState, SIGNAL(textChanged(const QString &)), this, SLOT(slotStateChange(const QString &)) ); |
468 | connect( txtZip, SIGNAL(textChanged(const QString &)), this, SLOT(slotZipChange(const QString &)) ); | 468 | connect( txtZip, SIGNAL(textChanged(const QString &)), this, SLOT(slotZipChange(const QString &)) ); |
469 | connect( cmbCountry, SIGNAL(textChanged(const QString &)), this, SLOT(slotCountryChange(const QString &)) ); | 469 | connect( cmbCountry, SIGNAL(textChanged(const QString &)), this, SLOT(slotCountryChange(const QString &)) ); |
470 | connect( cmbCountry, SIGNAL(activated(const QString &)), this, SLOT(slotCountryChange(const QString &)) ); | 470 | connect( cmbCountry, SIGNAL(activated(const QString &)), this, SLOT(slotCountryChange(const QString &)) ); |
471 | connect( cmbChooserField1, SIGNAL(activated(int)), this, SLOT(slotCmbChooser1Change(int)) ); | 471 | connect( cmbChooserField1, SIGNAL(activated(int)), this, SLOT(slotCmbChooser1Change(int)) ); |
472 | connect( cmbChooserField2, SIGNAL(activated(int)), this, SLOT(slotCmbChooser2Change(int)) ); | 472 | connect( cmbChooserField2, SIGNAL(activated(int)), this, SLOT(slotCmbChooser2Change(int)) ); |
473 | connect( cmbChooserField3, SIGNAL(activated(int)), this, SLOT(slotCmbChooser3Change(int)) ); | 473 | connect( cmbChooserField3, SIGNAL(activated(int)), this, SLOT(slotCmbChooser3Change(int)) ); |
474 | connect( cmbAddress, SIGNAL(activated(int)), this, SLOT(slotAddressTypeChange(int)) ); | 474 | connect( cmbAddress, SIGNAL(activated(int)), this, SLOT(slotAddressTypeChange(int)) ); |
475 | new QPEDialogListener(this); | 475 | new QPEDialogListener(this); |
476 | } | 476 | } |
477 | 477 | ||
478 | void ContactEditor::initMap() | 478 | void ContactEditor::initMap() |
479 | { | 479 | { |
480 | /* | 480 | /* |
481 | // since the fields and the XML fields exist, create a map | 481 | // since the fields and the XML fields exist, create a map |
482 | // between them... | 482 | // between them... |
483 | Config cfg1( "AddressBook" ); | 483 | Config cfg1( "AddressBook" ); |
484 | Config cfg2( "AddressBook" ); | 484 | Config cfg2( "AddressBook" ); |
485 | QString strCfg1, | 485 | QString strCfg1, |
486 | strCfg2; | 486 | strCfg2; |
487 | int i; | 487 | int i; |
488 | 488 | ||
489 | // This stuff better exist... | 489 | // This stuff better exist... |
490 | cfg1.setGroup( "AddressFields" ); | 490 | cfg1.setGroup( "AddressFields" ); |
491 | o cfg2.setGroup( "XMLFields" ); | 491 | o cfg2.setGroup( "XMLFields" ); |
492 | i = 0; | 492 | i = 0; |
493 | strCfg1 = cfg1.readEntry( "Field" + QString::number(i), QString::null ); | 493 | strCfg1 = cfg1.readEntry( "Field" + QString::number(i), QString::null ); |
494 | strCfg2 = cfg2.readEntry( "XMLField" + QString::number(i++), | 494 | strCfg2 = cfg2.readEntry( "XMLField" + QString::number(i++), |
495 | QString::null ); | 495 | QString::null ); |
496 | while ( !strCfg1.isNull() && !strCfg2.isNull() ) { | 496 | while ( !strCfg1.isNull() && !strCfg2.isNull() ) { |
497 | mapField.insert( strCfg1, strCfg2 ); | 497 | mapField.insert( strCfg1, strCfg2 ); |
498 | strCfg1 = cfg1.readEntry( "Field" + QString::number(i), | 498 | strCfg1 = cfg1.readEntry( "Field" + QString::number(i), |
499 | QString::null ); | 499 | QString::null ); |
500 | strCfg2 = cfg2.readEntry( "XMLField" + QString::number(i++), | 500 | strCfg2 = cfg2.readEntry( "XMLField" + QString::number(i++), |
501 | QString::null ); | 501 | QString::null ); |
502 | } | 502 | } |
503 | */ | 503 | */ |
504 | } | 504 | } |
505 | 505 | ||
506 | void ContactEditor::slotChooser1Change( const QString &textChanged ) { | 506 | void ContactEditor::slotChooser1Change( const QString &textChanged ) { |
507 | 507 | ||
508 | int index = cmbChooserField1->currentItem(); | 508 | int index = cmbChooserField1->currentItem(); |
509 | 509 | ||
510 | (*slChooserValues)[index] = textChanged; | 510 | (*slChooserValues)[index] = textChanged; |
511 | 511 | ||
512 | } | 512 | } |
513 | 513 | ||
514 | void ContactEditor::slotChooser2Change( const QString &textChanged ) { | 514 | void ContactEditor::slotChooser2Change( const QString &textChanged ) { |
515 | 515 | ||
516 | int index = cmbChooserField2->currentItem(); | 516 | int index = cmbChooserField2->currentItem(); |
517 | 517 | ||
518 | (*slChooserValues)[index] = textChanged; | 518 | (*slChooserValues)[index] = textChanged; |
519 | 519 | ||
520 | } | 520 | } |
521 | 521 | ||
522 | void ContactEditor::slotChooser3Change( const QString &textChanged ) { | 522 | void ContactEditor::slotChooser3Change( const QString &textChanged ) { |
523 | 523 | ||
524 | int index = cmbChooserField3->currentItem(); | 524 | int index = cmbChooserField3->currentItem(); |
525 | 525 | ||
526 | (*slChooserValues)[index] = textChanged; | 526 | (*slChooserValues)[index] = textChanged; |
527 | 527 | ||
528 | } | 528 | } |
529 | 529 | ||
530 | void ContactEditor::slotAddressChange( const QString &textChanged ) { | 530 | void ContactEditor::slotAddressChange( const QString &textChanged ) { |
531 | 531 | ||
532 | qDebug((*slBusinessAddress)[0]); | 532 | qDebug((*slBusinessAddress)[0]); |
533 | qDebug((*slHomeAddress)[0]); | 533 | qDebug((*slHomeAddress)[0]); |
534 | qDebug(textChanged); | 534 | qDebug(textChanged); |
535 | if ( cmbAddress->currentItem() == 0 ) { | 535 | if ( cmbAddress->currentItem() == 0 ) { |
536 | (*slBusinessAddress)[0] = textChanged; | 536 | (*slBusinessAddress)[0] = textChanged; |
537 | } else { | 537 | } else { |
538 | (*slHomeAddress)[0] = textChanged; | 538 | (*slHomeAddress)[0] = textChanged; |
539 | } | 539 | } |
540 | } | 540 | } |
541 | 541 | ||
542 | void ContactEditor::slotAddress2Change( const QString &textChanged ) { | 542 | void ContactEditor::slotAddress2Change( const QString &textChanged ) { |
543 | 543 | ||
544 | qDebug((*slBusinessAddress)[1]); | 544 | qDebug((*slBusinessAddress)[1]); |
545 | qDebug((*slHomeAddress)[1]); | 545 | qDebug((*slHomeAddress)[1]); |
546 | qDebug(textChanged); | 546 | qDebug(textChanged); |
547 | 547 | ||
548 | if ( cmbAddress->currentItem() == 0 ) { | 548 | if ( cmbAddress->currentItem() == 0 ) { |
549 | (*slBusinessAddress)[1] = textChanged; | 549 | (*slBusinessAddress)[1] = textChanged; |
550 | } else { | 550 | } else { |
551 | (*slHomeAddress)[1] = textChanged; | 551 | (*slHomeAddress)[1] = textChanged; |
552 | } | 552 | } |
553 | } | 553 | } |
554 | 554 | ||
555 | void ContactEditor::slotPOBoxChange( const QString &textChanged ) { | 555 | void ContactEditor::slotPOBoxChange( const QString &textChanged ) { |
556 | 556 | ||
557 | qDebug((*slBusinessAddress)[2]); | 557 | qDebug((*slBusinessAddress)[2]); |
558 | qDebug((*slHomeAddress)[2]); | 558 | qDebug((*slHomeAddress)[2]); |
559 | qDebug(textChanged); | 559 | qDebug(textChanged); |
560 | if ( cmbAddress->currentItem() == 0 ) { | 560 | if ( cmbAddress->currentItem() == 0 ) { |
561 | (*slBusinessAddress)[2] = textChanged; | 561 | (*slBusinessAddress)[2] = textChanged; |
562 | } else { | 562 | } else { |
563 | (*slHomeAddress)[2] = textChanged; | 563 | (*slHomeAddress)[2] = textChanged; |
564 | } | 564 | } |
565 | } | 565 | } |
566 | 566 | ||
567 | void ContactEditor::slotCityChange( const QString &textChanged ) { | 567 | void ContactEditor::slotCityChange( const QString &textChanged ) { |
568 | 568 | ||
569 | qDebug((*slBusinessAddress)[3]); | 569 | qDebug((*slBusinessAddress)[3]); |
570 | qDebug((*slHomeAddress)[3]); | 570 | qDebug((*slHomeAddress)[3]); |
571 | qDebug(textChanged); | 571 | qDebug(textChanged); |
572 | if ( cmbAddress->currentItem() == 0 ) { | 572 | if ( cmbAddress->currentItem() == 0 ) { |
573 | (*slBusinessAddress)[3] = textChanged; | 573 | (*slBusinessAddress)[3] = textChanged; |
574 | } else { | 574 | } else { |
575 | (*slHomeAddress)[3] = textChanged; | 575 | (*slHomeAddress)[3] = textChanged; |
576 | } | 576 | } |
577 | } | 577 | } |
578 | 578 | ||
579 | void ContactEditor::slotStateChange( const QString &textChanged ) { | 579 | void ContactEditor::slotStateChange( const QString &textChanged ) { |
580 | 580 | ||
581 | 581 | ||
582 | qDebug((*slBusinessAddress)[4]); | 582 | qDebug((*slBusinessAddress)[4]); |
583 | qDebug((*slHomeAddress)[4]); | 583 | qDebug((*slHomeAddress)[4]); |
584 | qDebug(textChanged); | 584 | qDebug(textChanged); |
585 | if ( cmbAddress->currentItem() == 0 ) { | 585 | if ( cmbAddress->currentItem() == 0 ) { |
586 | (*slBusinessAddress)[4] = textChanged; | 586 | (*slBusinessAddress)[4] = textChanged; |
587 | } else { | 587 | } else { |
588 | (*slHomeAddress)[4] = textChanged; | 588 | (*slHomeAddress)[4] = textChanged; |
589 | } | 589 | } |
590 | } | 590 | } |
591 | 591 | ||
592 | void ContactEditor::slotZipChange( const QString &textChanged ) { | 592 | void ContactEditor::slotZipChange( const QString &textChanged ) { |
593 | 593 | ||
594 | qDebug((*slBusinessAddress)[5]); | 594 | qDebug((*slBusinessAddress)[5]); |
595 | qDebug((*slHomeAddress)[5]); | 595 | qDebug((*slHomeAddress)[5]); |
596 | qDebug(textChanged); | 596 | qDebug(textChanged); |
597 | if ( cmbAddress->currentItem() == 0 ) { | 597 | if ( cmbAddress->currentItem() == 0 ) { |
598 | (*slBusinessAddress)[5] = textChanged; | 598 | (*slBusinessAddress)[5] = textChanged; |
599 | } else { | 599 | } else { |
600 | (*slHomeAddress)[5] = textChanged; | 600 | (*slHomeAddress)[5] = textChanged; |
601 | } | 601 | } |
602 | } | 602 | } |
603 | 603 | ||
604 | void ContactEditor::slotCountryChange( const QString &textChanged ) { | 604 | void ContactEditor::slotCountryChange( const QString &textChanged ) { |
605 | 605 | ||
606 | qDebug((*slBusinessAddress)[6]); | 606 | qDebug((*slBusinessAddress)[6]); |
607 | qDebug((*slHomeAddress)[6]); | 607 | qDebug((*slHomeAddress)[6]); |
608 | qDebug(textChanged); | 608 | qDebug(textChanged); |
609 | if ( cmbAddress->currentItem() == 0 ) { | 609 | if ( cmbAddress->currentItem() == 0 ) { |
610 | (*slBusinessAddress)[6] = textChanged; | 610 | (*slBusinessAddress)[6] = textChanged; |
611 | } else { | 611 | } else { |
612 | (*slHomeAddress)[6] = textChanged; | 612 | (*slHomeAddress)[6] = textChanged; |
613 | } | 613 | } |
614 | } | 614 | } |
615 | 615 | ||
616 | void ContactEditor::slotCmbChooser1Change( int index ) { | 616 | void ContactEditor::slotCmbChooser1Change( int index ) { |
617 | 617 | ||
618 | txtChooserField1->setText( (*slChooserValues)[index] ); | 618 | txtChooserField1->setText( (*slChooserValues)[index] ); |
619 | 619 | ||
620 | } | 620 | } |
621 | 621 | ||
622 | void ContactEditor::slotCmbChooser2Change( int index ) { | 622 | void ContactEditor::slotCmbChooser2Change( int index ) { |
623 | 623 | ||
624 | txtChooserField2->setText( (*slChooserValues)[index] ); | 624 | txtChooserField2->setText( (*slChooserValues)[index] ); |
625 | 625 | ||
626 | } | 626 | } |
627 | 627 | ||
628 | void ContactEditor::slotCmbChooser3Change( int index ) { | 628 | void ContactEditor::slotCmbChooser3Change( int index ) { |
629 | 629 | ||
630 | txtChooserField3->setText( (*slChooserValues)[index] ); | 630 | txtChooserField3->setText( (*slChooserValues)[index] ); |
631 | 631 | ||
632 | } | 632 | } |
633 | 633 | ||
634 | void ContactEditor::slotAddressTypeChange( int index ) { | 634 | void ContactEditor::slotAddressTypeChange( int index ) { |
635 | 635 | ||
636 | qDebug((*slBusinessAddress)[0]); | 636 | qDebug((*slBusinessAddress)[0]); |
637 | qDebug((*slBusinessAddress)[1]); | 637 | qDebug((*slBusinessAddress)[1]); |
638 | qDebug((*slBusinessAddress)[2]); | 638 | qDebug((*slBusinessAddress)[2]); |
639 | qDebug((*slBusinessAddress)[3]); | 639 | qDebug((*slBusinessAddress)[3]); |
640 | qDebug((*slBusinessAddress)[4]); | 640 | qDebug((*slBusinessAddress)[4]); |
641 | qDebug((*slBusinessAddress)[5]); | 641 | qDebug((*slBusinessAddress)[5]); |
642 | qDebug((*slBusinessAddress)[6]); | 642 | qDebug((*slBusinessAddress)[6]); |
643 | 643 | ||
644 | 644 | ||
645 | 645 | ||
646 | if ( index == 0 ) { | 646 | if ( index == 0 ) { |
647 | 647 | ||
648 | txtAddress->setText( (*slBusinessAddress)[0] ); | 648 | txtAddress->setText( (*slBusinessAddress)[0] ); |
649 | //txtAddress2->setText( (*slBusinessAddress)[1] ); | 649 | //txtAddress2->setText( (*slBusinessAddress)[1] ); |
650 | //txtPOBox->setText( (*slBusinessAddress)[2] ); | 650 | //txtPOBox->setText( (*slBusinessAddress)[2] ); |
651 | txtCity->setText( (*slBusinessAddress)[3] ); | 651 | txtCity->setText( (*slBusinessAddress)[3] ); |
652 | txtState->setText( (*slBusinessAddress)[4] ); | 652 | txtState->setText( (*slBusinessAddress)[4] ); |
653 | txtZip->setText( (*slBusinessAddress)[5] ); | 653 | txtZip->setText( (*slBusinessAddress)[5] ); |
654 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 654 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
655 | txtTmp->setText( (*slBusinessAddress)[6] ); | 655 | txtTmp->setText( (*slBusinessAddress)[6] ); |
656 | 656 | ||
657 | } else { | 657 | } else { |
658 | 658 | ||
659 | txtAddress->setText( (*slHomeAddress)[0] ); | 659 | txtAddress->setText( (*slHomeAddress)[0] ); |
660 | //txtAddress2->setText( (*slHomeAddress)[1] ); | 660 | //txtAddress2->setText( (*slHomeAddress)[1] ); |
661 | //txtPOBox->setText( (*slHomeAddress)[2] ); | 661 | //txtPOBox->setText( (*slHomeAddress)[2] ); |
662 | txtCity->setText( (*slHomeAddress)[3] ); | 662 | txtCity->setText( (*slHomeAddress)[3] ); |
663 | txtState->setText( (*slHomeAddress)[4] ); | 663 | txtState->setText( (*slHomeAddress)[4] ); |
664 | txtZip->setText( (*slHomeAddress)[5] ); | 664 | txtZip->setText( (*slHomeAddress)[5] ); |
665 | QLineEdit *txtTmp = cmbCountry->lineEdit(); | 665 | QLineEdit *txtTmp = cmbCountry->lineEdit(); |
666 | txtTmp->setText( (*slHomeAddress)[6] ); | 666 | txtTmp->setText( (*slHomeAddress)[6] ); |
667 | 667 | ||
668 | } | 668 | } |
669 | 669 | ||
670 | } | 670 | } |
671 | 671 | ||
672 | void ContactEditor::slotFullNameChange( const QString &textChanged ) { | 672 | void ContactEditor::slotFullNameChange( const QString &textChanged ) { |
673 | 673 | ||
674 | int index = cmbFileAs->currentItem(); | 674 | int index = cmbFileAs->currentItem(); |
675 | 675 | ||
676 | cmbFileAs->clear(); | 676 | cmbFileAs->clear(); |
677 | 677 | ||
678 | cmbFileAs->insertItem( parseName( textChanged, 0 ) ); | 678 | cmbFileAs->insertItem( parseName( textChanged, 0 ) ); |
679 | cmbFileAs->insertItem( parseName( textChanged, 1 ) ); | 679 | cmbFileAs->insertItem( parseName( textChanged, 1 ) ); |
680 | cmbFileAs->insertItem( parseName( textChanged, 2 ) ); | 680 | cmbFileAs->insertItem( parseName( textChanged, 2 ) ); |
681 | cmbFileAs->insertItem( parseName( textChanged, 3 ) ); | 681 | cmbFileAs->insertItem( parseName( textChanged, 3 ) ); |
682 | 682 | ||