summaryrefslogtreecommitdiff
authortux_mike <tux_mike>2002-04-18 20:07:11 (UTC)
committer tux_mike <tux_mike>2002-04-18 20:07:11 (UTC)
commit56c20411484700350362b5041e3c9db030084caf (patch) (unidiff)
tree4779dffaf8a4b54312f63a103c01b5042f9c876c
parent706686e0ee82390b85bd4e3ba2813251cae5ea0d (diff)
downloadopie-56c20411484700350362b5041e3c9db030084caf.zip
opie-56c20411484700350362b5041e3c9db030084caf.tar.gz
opie-56c20411484700350362b5041e3c9db030084caf.tar.bz2
Fixed a bug with Suffixes due to a missing 2
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/contacteditor.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp
index cbcd11f..adea1a1 100644
--- a/core/pim/addressbook/contacteditor.cpp
+++ b/core/pim/addressbook/contacteditor.cpp
@@ -248,1386 +248,1387 @@ void ContactEditor::init() {
248 hasState = TRUE; 248 hasState = TRUE;
249 //slDynamicEntries->remove( it ); 249 //slDynamicEntries->remove( it );
250 continue; 250 continue;
251 } 251 }
252 252
253 if ( (*it).right( 3 ) == tr( "Zip" ) ) { 253 if ( (*it).right( 3 ) == tr( "Zip" ) ) {
254 hasZip = TRUE; 254 hasZip = TRUE;
255 //slDynamicEntries->remove( it ); 255 //slDynamicEntries->remove( it );
256 continue; 256 continue;
257 } 257 }
258 258
259 if ( (*it).right( 7 ) == tr( "Country" ) ) { 259 if ( (*it).right( 7 ) == tr( "Country" ) ) {
260 hasCountry = TRUE; 260 hasCountry = TRUE;
261 //slDynamicEntries->remove( it ); 261 //slDynamicEntries->remove( it );
262 continue; 262 continue;
263 } 263 }
264 264
265 slDynamicEntries->append( *it ); 265 slDynamicEntries->append( *it );
266 } 266 }
267 } 267 }
268 268
269 QVBoxLayout *vb = new QVBoxLayout( this ); 269 QVBoxLayout *vb = new QVBoxLayout( this );
270 270
271 tabMain = new QTabWidget( this ); 271 tabMain = new QTabWidget( this );
272 vb->addWidget( tabMain ); 272 vb->addWidget( tabMain );
273 273
274 QWidget *tabViewport = new QWidget ( tabMain ); 274 QWidget *tabViewport = new QWidget ( tabMain );
275 275
276 vb = new QVBoxLayout( tabViewport ); 276 vb = new QVBoxLayout( tabViewport );
277 277
278 svGeneral = new QScrollView( tabViewport ); 278 svGeneral = new QScrollView( tabViewport );
279 vb->addWidget( svGeneral, 0, 0 ); 279 vb->addWidget( svGeneral, 0, 0 );
280 svGeneral->setResizePolicy( QScrollView::AutoOneFit ); 280 svGeneral->setResizePolicy( QScrollView::AutoOneFit );
281 svGeneral->setFrameStyle( QFrame::NoFrame ); 281 svGeneral->setFrameStyle( QFrame::NoFrame );
282 282
283 QWidget *container = new QWidget( svGeneral->viewport() ); 283 QWidget *container = new QWidget( svGeneral->viewport() );
284 svGeneral->addChild( container ); 284 svGeneral->addChild( container );
285 285
286 QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 ); 286 QGridLayout *gl = new QGridLayout( container, 1, 1, 2, 4 );
287 gl->setResizeMode( QLayout::FreeResize ); 287 gl->setResizeMode( QLayout::FreeResize );
288 288
289 btnFullName = new QPushButton( tr( "Full Name..." ), container ); 289 btnFullName = new QPushButton( tr( "Full Name..." ), container );
290 gl->addWidget( btnFullName, 0, 0 ); 290 gl->addWidget( btnFullName, 0, 0 );
291 txtFullName = new QLineEdit( container ); 291 txtFullName = new QLineEdit( container );
292 gl->addWidget( txtFullName, 0, 1 ); 292 gl->addWidget( txtFullName, 0, 1 );
293 293
294 QLabel *l = new QLabel( tr( "Job Title" ), container ); 294 QLabel *l = new QLabel( tr( "Job Title" ), container );
295 gl->addWidget( l, 1, 0 ); 295 gl->addWidget( l, 1, 0 );
296 txtJobTitle = new QLineEdit( container ); 296 txtJobTitle = new QLineEdit( container );
297 gl->addWidget( txtJobTitle, 1, 1 ); 297 gl->addWidget( txtJobTitle, 1, 1 );
298 298
299 l = new QLabel( tr( "Organization" ), container ); 299 l = new QLabel( tr( "Organization" ), container );
300 gl->addWidget( l, 2, 0 ); 300 gl->addWidget( l, 2, 0 );
301 txtOrganization = new QLineEdit( container ); 301 txtOrganization = new QLineEdit( container );
302 gl->addWidget( txtOrganization, 2, 1 ); 302 gl->addWidget( txtOrganization, 2, 1 );
303 303
304 cmbChooserField1 = new QComboBox( FALSE, container ); 304 cmbChooserField1 = new QComboBox( FALSE, container );
305 cmbChooserField1->setMaximumWidth( 90 ); 305 cmbChooserField1->setMaximumWidth( 90 );
306 gl->addWidget( cmbChooserField1, 3, 0 ); 306 gl->addWidget( cmbChooserField1, 3, 0 );
307 txtChooserField1 = new QLineEdit( container ); 307 txtChooserField1 = new QLineEdit( container );
308 gl->addWidget( txtChooserField1, 3, 1 ); 308 gl->addWidget( txtChooserField1, 3, 1 );
309 309
310 cmbChooserField2 = new QComboBox( FALSE, container ); 310 cmbChooserField2 = new QComboBox( FALSE, container );
311 cmbChooserField2->setMaximumWidth( 90 ); 311 cmbChooserField2->setMaximumWidth( 90 );
312 gl->addWidget( cmbChooserField2, 4, 0 ); 312 gl->addWidget( cmbChooserField2, 4, 0 );
313 txtChooserField2 = new QLineEdit( container ); 313 txtChooserField2 = new QLineEdit( container );
314 gl->addWidget( txtChooserField2, 4, 1 ); 314 gl->addWidget( txtChooserField2, 4, 1 );
315 315
316 cmbChooserField3 = new QComboBox( FALSE, container ); 316 cmbChooserField3 = new QComboBox( FALSE, container );
317 cmbChooserField3->setMaximumWidth( 90 ); 317 cmbChooserField3->setMaximumWidth( 90 );
318 gl->addWidget( cmbChooserField3, 5, 0 ); 318 gl->addWidget( cmbChooserField3, 5, 0 );
319 txtChooserField3 = new QLineEdit( container ); 319 txtChooserField3 = new QLineEdit( container );
320 gl->addWidget( txtChooserField3, 5, 1 ); 320 gl->addWidget( txtChooserField3, 5, 1 );
321 321
322 l = new QLabel( tr( "File As" ), container ); 322 l = new QLabel( tr( "File As" ), container );
323 gl->addWidget( l, 6, 0 ); 323 gl->addWidget( l, 6, 0 );
324 cmbFileAs = new QComboBox( TRUE, container ); 324 cmbFileAs = new QComboBox( TRUE, container );
325 gl->addWidget( cmbFileAs, 6, 1 ); 325 gl->addWidget( cmbFileAs, 6, 1 );
326 326
327 l = new QLabel( tr( "Category" ), container ); 327 l = new QLabel( tr( "Category" ), container );
328 gl->addWidget( l, 7, 0 ); 328 gl->addWidget( l, 7, 0 );
329 cmbCat = new CategorySelect( container ); 329 cmbCat = new CategorySelect( container );
330 gl->addWidget( cmbCat, 7, 1 ); 330 gl->addWidget( cmbCat, 7, 1 );
331 331
332 btnNote = new QPushButton( tr( "Notes..." ), container ); 332 btnNote = new QPushButton( tr( "Notes..." ), container );
333 gl->addWidget( btnNote, 8, 1 ); 333 gl->addWidget( btnNote, 8, 1 );
334 334
335 tabMain->insertTab( tabViewport, tr( "General" ) ); 335 tabMain->insertTab( tabViewport, tr( "General" ) );
336 336
337 tabViewport = new QWidget ( tabMain ); 337 tabViewport = new QWidget ( tabMain );
338 338
339 vb = new QVBoxLayout( tabViewport ); 339 vb = new QVBoxLayout( tabViewport );
340 340
341 svAddress = new QScrollView( tabViewport ); 341 svAddress = new QScrollView( tabViewport );
342 vb->addWidget( svAddress, 0, 0 ); 342 vb->addWidget( svAddress, 0, 0 );
343 svAddress->setResizePolicy( QScrollView::AutoOneFit ); 343 svAddress->setResizePolicy( QScrollView::AutoOneFit );
344 svAddress->setFrameStyle( QFrame::NoFrame ); 344 svAddress->setFrameStyle( QFrame::NoFrame );
345 345
346 container = new QWidget( svAddress->viewport() ); 346 container = new QWidget( svAddress->viewport() );
347 svAddress->addChild( container ); 347 svAddress->addChild( container );
348 348
349 gl = new QGridLayout( container, 6, 3, 2, 4 ); 349 gl = new QGridLayout( container, 6, 3, 2, 4 );
350 350
351 cmbAddress = new QComboBox( FALSE, container ); 351 cmbAddress = new QComboBox( FALSE, container );
352 cmbAddress->insertItem( tr( "Business" ) ); 352 cmbAddress->insertItem( tr( "Business" ) );
353 cmbAddress->insertItem( tr( "Home" ) ); 353 cmbAddress->insertItem( tr( "Home" ) );
354 gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 ); 354 gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 );
355 355
356 l = new QLabel( tr( "Address" ), container ); 356 l = new QLabel( tr( "Address" ), container );
357 gl->addWidget( l, 1, 0 ); 357 gl->addWidget( l, 1, 0 );
358 txtAddress = new QLineEdit( container ); 358 txtAddress = new QLineEdit( container );
359 gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 ); 359 gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 );
360/* 360/*
361 l = new QLabel( tr( "Address 2" ), container ); 361 l = new QLabel( tr( "Address 2" ), container );
362 gl->addWidget( l, 2, 0 ); 362 gl->addWidget( l, 2, 0 );
363 txtAddress2 = new QLineEdit( container ); 363 txtAddress2 = new QLineEdit( container );
364 gl->addMultiCellWidget( txtAddress2, 2, 2, 1, 2 ); 364 gl->addMultiCellWidget( txtAddress2, 2, 2, 1, 2 );
365 365
366 l = new QLabel( tr( "P.O. Box" ), container ); 366 l = new QLabel( tr( "P.O. Box" ), container );
367 gl->addWidget( l, 3, 0 ); 367 gl->addWidget( l, 3, 0 );
368 txtPOBox = new QLineEdit( container ); 368 txtPOBox = new QLineEdit( container );
369 gl->addMultiCellWidget( txtPOBox, 3, 3, 1, 2 ); 369 gl->addMultiCellWidget( txtPOBox, 3, 3, 1, 2 );
370*/ 370*/
371 l = new QLabel( tr( "City" ), container ); 371 l = new QLabel( tr( "City" ), container );
372 gl->addWidget( l, 2, 0 ); 372 gl->addWidget( l, 2, 0 );
373 txtCity = new QLineEdit( container ); 373 txtCity = new QLineEdit( container );
374 gl->addMultiCellWidget( txtCity, 2, 2, 1, 2 ); 374 gl->addMultiCellWidget( txtCity, 2, 2, 1, 2 );
375 375
376 l = new QLabel( tr( "State" ), container ); 376 l = new QLabel( tr( "State" ), container );
377 gl->addWidget( l, 3, 0 ); 377 gl->addWidget( l, 3, 0 );
378 txtState = new QLineEdit( container ); 378 txtState = new QLineEdit( container );
379 gl->addMultiCellWidget( txtState, 3, 3, 1, 2 ); 379 gl->addMultiCellWidget( txtState, 3, 3, 1, 2 );
380 380
381 l = new QLabel( tr( "Zip Code" ), container ); 381 l = new QLabel( tr( "Zip Code" ), container );
382 gl->addWidget( l, 4, 0 ); 382 gl->addWidget( l, 4, 0 );
383 txtZip = new QLineEdit( container ); 383 txtZip = new QLineEdit( container );
384 gl->addMultiCellWidget( txtZip, 4, 4, 1, 2 ); 384 gl->addMultiCellWidget( txtZip, 4, 4, 1, 2 );
385 385
386 l = new QLabel( tr( "Country" ), container ); 386 l = new QLabel( tr( "Country" ), container );
387 gl->addWidget( l, 5, 0 ); 387 gl->addWidget( l, 5, 0 );
388 cmbCountry = new QComboBox( TRUE, container ); 388 cmbCountry = new QComboBox( TRUE, container );
389 cmbCountry->insertItem( tr( "" ) ); 389 cmbCountry->insertItem( tr( "" ) );
390 cmbCountry->insertItem( tr ( "United States" ) ); 390 cmbCountry->insertItem( tr ( "United States" ) );
391 cmbCountry->insertItem( tr ( "United Kingdom" ) ); 391 cmbCountry->insertItem( tr ( "United Kingdom" ) );
392 cmbCountry->insertItem( tr ( "Afganistan" ) ); 392 cmbCountry->insertItem( tr ( "Afganistan" ) );
393 cmbCountry->insertItem( tr ( "Albania" ) ); 393 cmbCountry->insertItem( tr ( "Albania" ) );
394 cmbCountry->insertItem( tr ( "Algeria" ) ); 394 cmbCountry->insertItem( tr ( "Algeria" ) );
395 cmbCountry->insertItem( tr ( "American Samoa" ) ); 395 cmbCountry->insertItem( tr ( "American Samoa" ) );
396 cmbCountry->insertItem( tr ( "Andorra" ) ); 396 cmbCountry->insertItem( tr ( "Andorra" ) );
397 cmbCountry->insertItem( tr ( "Angola" ) ); 397 cmbCountry->insertItem( tr ( "Angola" ) );
398 cmbCountry->insertItem( tr ( "Anguilla" ) ); 398 cmbCountry->insertItem( tr ( "Anguilla" ) );
399 cmbCountry->insertItem( tr ( "Antartica" ) ); 399 cmbCountry->insertItem( tr ( "Antartica" ) );
400 cmbCountry->insertItem( tr ( "Argentina" ) ); 400 cmbCountry->insertItem( tr ( "Argentina" ) );
401 cmbCountry->insertItem( tr ( "Armania" ) ); 401 cmbCountry->insertItem( tr ( "Armania" ) );
402 cmbCountry->insertItem( tr ( "Aruba" ) ); 402 cmbCountry->insertItem( tr ( "Aruba" ) );
403 cmbCountry->insertItem( tr ( "Australia" ) ); 403 cmbCountry->insertItem( tr ( "Australia" ) );
404 cmbCountry->insertItem( tr ( "Austria" ) ); 404 cmbCountry->insertItem( tr ( "Austria" ) );
405 cmbCountry->insertItem( tr ( "Azerbaijan" ) ); 405 cmbCountry->insertItem( tr ( "Azerbaijan" ) );
406 cmbCountry->insertItem( tr ( "Bahamas" ) ); 406 cmbCountry->insertItem( tr ( "Bahamas" ) );
407 cmbCountry->insertItem( tr ( "Bahrain" ) ); 407 cmbCountry->insertItem( tr ( "Bahrain" ) );
408 cmbCountry->insertItem( tr ( "Bangladesh" ) ); 408 cmbCountry->insertItem( tr ( "Bangladesh" ) );
409 cmbCountry->insertItem( tr ( "Barbados" ) ); 409 cmbCountry->insertItem( tr ( "Barbados" ) );
410 cmbCountry->insertItem( tr ( "Belarus" ) ); 410 cmbCountry->insertItem( tr ( "Belarus" ) );
411 cmbCountry->insertItem( tr ( "Belgium" ) ); 411 cmbCountry->insertItem( tr ( "Belgium" ) );
412 cmbCountry->insertItem( tr ( "Belize" ) ); 412 cmbCountry->insertItem( tr ( "Belize" ) );
413 cmbCountry->insertItem( tr ( "Benin" ) ); 413 cmbCountry->insertItem( tr ( "Benin" ) );
414 cmbCountry->insertItem( tr ( "Bermuda" ) ); 414 cmbCountry->insertItem( tr ( "Bermuda" ) );
415 cmbCountry->insertItem( tr ( "Bhutan" ) ); 415 cmbCountry->insertItem( tr ( "Bhutan" ) );
416 cmbCountry->insertItem( tr ( "Boliva" ) ); 416 cmbCountry->insertItem( tr ( "Boliva" ) );
417 cmbCountry->insertItem( tr ( "Botswana" ) ); 417 cmbCountry->insertItem( tr ( "Botswana" ) );
418 cmbCountry->insertItem( tr ( "Bouvet Island" ) ); 418 cmbCountry->insertItem( tr ( "Bouvet Island" ) );
419 cmbCountry->insertItem( tr ( "Brazil" ) ); 419 cmbCountry->insertItem( tr ( "Brazil" ) );
420 cmbCountry->insertItem( tr ( "Brunei Darussalam" ) ); 420 cmbCountry->insertItem( tr ( "Brunei Darussalam" ) );
421 cmbCountry->insertItem( tr ( "Bulgaria" ) ); 421 cmbCountry->insertItem( tr ( "Bulgaria" ) );
422 cmbCountry->insertItem( tr ( "Burkina Faso" ) ); 422 cmbCountry->insertItem( tr ( "Burkina Faso" ) );
423 cmbCountry->insertItem( tr ( "Burundi" ) ); 423 cmbCountry->insertItem( tr ( "Burundi" ) );
424 cmbCountry->insertItem( tr ( "Cambodia" ) ); 424 cmbCountry->insertItem( tr ( "Cambodia" ) );
425 cmbCountry->insertItem( tr ( "Camaroon" ) ); 425 cmbCountry->insertItem( tr ( "Camaroon" ) );
426 cmbCountry->insertItem( tr ( "Canada" ) ); 426 cmbCountry->insertItem( tr ( "Canada" ) );
427 cmbCountry->insertItem( tr ( "Cape Verde" ) ); 427 cmbCountry->insertItem( tr ( "Cape Verde" ) );
428 cmbCountry->insertItem( tr ( "Cayman Islands" ) ); 428 cmbCountry->insertItem( tr ( "Cayman Islands" ) );
429 cmbCountry->insertItem( tr ( "Chad" ) ); 429 cmbCountry->insertItem( tr ( "Chad" ) );
430 cmbCountry->insertItem( tr ( "Chile" ) ); 430 cmbCountry->insertItem( tr ( "Chile" ) );
431 cmbCountry->insertItem( tr ( "China" ) ); 431 cmbCountry->insertItem( tr ( "China" ) );
432 cmbCountry->insertItem( tr ( "Christmas Island" ) ); 432 cmbCountry->insertItem( tr ( "Christmas Island" ) );
433 cmbCountry->insertItem( tr ( "Colombia" ) ); 433 cmbCountry->insertItem( tr ( "Colombia" ) );
434 cmbCountry->insertItem( tr ( "Comoros" ) ); 434 cmbCountry->insertItem( tr ( "Comoros" ) );
435 cmbCountry->insertItem( tr ( "Congo" ) ); 435 cmbCountry->insertItem( tr ( "Congo" ) );
436 cmbCountry->insertItem( tr ( "Cook Island" ) ); 436 cmbCountry->insertItem( tr ( "Cook Island" ) );
437 cmbCountry->insertItem( tr ( "Costa Rica" ) ); 437 cmbCountry->insertItem( tr ( "Costa Rica" ) );
438 cmbCountry->insertItem( tr ( "Cote d'Ivoire" ) ); 438 cmbCountry->insertItem( tr ( "Cote d'Ivoire" ) );
439 cmbCountry->insertItem( tr ( "Croatia" ) ); 439 cmbCountry->insertItem( tr ( "Croatia" ) );
440 cmbCountry->insertItem( tr ( "Cuba" ) ); 440 cmbCountry->insertItem( tr ( "Cuba" ) );
441 cmbCountry->insertItem( tr ( "Cyprus" ) ); 441 cmbCountry->insertItem( tr ( "Cyprus" ) );
442 cmbCountry->insertItem( tr ( "Czech Republic" ) ); 442 cmbCountry->insertItem( tr ( "Czech Republic" ) );
443 cmbCountry->insertItem( tr ( "Denmark" ) ); 443 cmbCountry->insertItem( tr ( "Denmark" ) );
444 cmbCountry->insertItem( tr ( "Djibouti" ) ); 444 cmbCountry->insertItem( tr ( "Djibouti" ) );
445 cmbCountry->insertItem( tr ( "Dominica" ) ); 445 cmbCountry->insertItem( tr ( "Dominica" ) );
446 cmbCountry->insertItem( tr ( "Dominican Republic" ) ); 446 cmbCountry->insertItem( tr ( "Dominican Republic" ) );
447 cmbCountry->insertItem( tr ( "East Timor" ) ); 447 cmbCountry->insertItem( tr ( "East Timor" ) );
448 cmbCountry->insertItem( tr ( "Ecuador" ) ); 448 cmbCountry->insertItem( tr ( "Ecuador" ) );
449 cmbCountry->insertItem( tr ( "Egypt" ) ); 449 cmbCountry->insertItem( tr ( "Egypt" ) );
450 cmbCountry->insertItem( tr ( "El Salvador" ) ); 450 cmbCountry->insertItem( tr ( "El Salvador" ) );
451 cmbCountry->insertItem( tr ( "Equatorial Guinea" ) ); 451 cmbCountry->insertItem( tr ( "Equatorial Guinea" ) );
452 cmbCountry->insertItem( tr ( "Eritrea" ) ); 452 cmbCountry->insertItem( tr ( "Eritrea" ) );
453 cmbCountry->insertItem( tr ( "Estonia" ) ); 453 cmbCountry->insertItem( tr ( "Estonia" ) );
454 cmbCountry->insertItem( tr ( "Ethiopia" ) ); 454 cmbCountry->insertItem( tr ( "Ethiopia" ) );
455 cmbCountry->insertItem( tr ( "Falkland Islands" ) ); 455 cmbCountry->insertItem( tr ( "Falkland Islands" ) );
456 cmbCountry->insertItem( tr ( "Faroe Islands" ) ); 456 cmbCountry->insertItem( tr ( "Faroe Islands" ) );
457 cmbCountry->insertItem( tr ( "Fiji" ) ); 457 cmbCountry->insertItem( tr ( "Fiji" ) );
458 cmbCountry->insertItem( tr ( "Finland" ) ); 458 cmbCountry->insertItem( tr ( "Finland" ) );
459 cmbCountry->insertItem( tr ( "France" ) ); 459 cmbCountry->insertItem( tr ( "France" ) );
460 cmbCountry->insertItem( tr ( "French Guiana" ) ); 460 cmbCountry->insertItem( tr ( "French Guiana" ) );
461 cmbCountry->insertItem( tr ( "French Polynesia" ) ); 461 cmbCountry->insertItem( tr ( "French Polynesia" ) );
462 cmbCountry->insertItem( tr ( "Gabon" ) ); 462 cmbCountry->insertItem( tr ( "Gabon" ) );
463 cmbCountry->insertItem( tr ( "Gambia" ) ); 463 cmbCountry->insertItem( tr ( "Gambia" ) );
464 cmbCountry->insertItem( tr ( "Georgia" ) ); 464 cmbCountry->insertItem( tr ( "Georgia" ) );
465 cmbCountry->insertItem( tr ( "Germany" ) ); 465 cmbCountry->insertItem( tr ( "Germany" ) );
466 cmbCountry->insertItem( tr ( "Gahna" ) ); 466 cmbCountry->insertItem( tr ( "Gahna" ) );
467 cmbCountry->insertItem( tr ( "Gibraltar" ) ); 467 cmbCountry->insertItem( tr ( "Gibraltar" ) );
468 cmbCountry->insertItem( tr ( "Greece" ) ); 468 cmbCountry->insertItem( tr ( "Greece" ) );
469 cmbCountry->insertItem( tr ( "Greenland" ) ); 469 cmbCountry->insertItem( tr ( "Greenland" ) );
470 cmbCountry->insertItem( tr ( "Grenada" ) ); 470 cmbCountry->insertItem( tr ( "Grenada" ) );
471 cmbCountry->insertItem( tr ( "Guadelupe" ) ); 471 cmbCountry->insertItem( tr ( "Guadelupe" ) );
472 cmbCountry->insertItem( tr ( "Guam" ) ); 472 cmbCountry->insertItem( tr ( "Guam" ) );
473 cmbCountry->insertItem( tr ( "Guatemala" ) ); 473 cmbCountry->insertItem( tr ( "Guatemala" ) );
474 cmbCountry->insertItem( tr ( "Guinea" ) ); 474 cmbCountry->insertItem( tr ( "Guinea" ) );
475 cmbCountry->insertItem( tr ( "Guinea-bissau" ) ); 475 cmbCountry->insertItem( tr ( "Guinea-bissau" ) );
476 cmbCountry->insertItem( tr ( "Guyana" ) ); 476 cmbCountry->insertItem( tr ( "Guyana" ) );
477 cmbCountry->insertItem( tr ( "Haiti" ) ); 477 cmbCountry->insertItem( tr ( "Haiti" ) );
478 cmbCountry->insertItem( tr ( "Holy See" ) ); 478 cmbCountry->insertItem( tr ( "Holy See" ) );
479 cmbCountry->insertItem( tr ( "Honduras" ) ); 479 cmbCountry->insertItem( tr ( "Honduras" ) );
480 cmbCountry->insertItem( tr ( "Hong Kong" ) ); 480 cmbCountry->insertItem( tr ( "Hong Kong" ) );
481 cmbCountry->insertItem( tr ( "Hungary" ) ); 481 cmbCountry->insertItem( tr ( "Hungary" ) );
482 cmbCountry->insertItem( tr ( "Iceland" ) ); 482 cmbCountry->insertItem( tr ( "Iceland" ) );
483 cmbCountry->insertItem( tr ( "India" ) ); 483 cmbCountry->insertItem( tr ( "India" ) );
484 cmbCountry->insertItem( tr ( "Indonesia" ) ); 484 cmbCountry->insertItem( tr ( "Indonesia" ) );
485 cmbCountry->insertItem( tr ( "Ireland" ) ); 485 cmbCountry->insertItem( tr ( "Ireland" ) );
486 cmbCountry->insertItem( tr ( "Israel" ) ); 486 cmbCountry->insertItem( tr ( "Israel" ) );
487 cmbCountry->insertItem( tr ( "Italy" ) ); 487 cmbCountry->insertItem( tr ( "Italy" ) );
488 cmbCountry->insertItem( tr ( "Jamacia" ) ); 488 cmbCountry->insertItem( tr ( "Jamacia" ) );
489 cmbCountry->insertItem( tr ( "Japan" ) ); 489 cmbCountry->insertItem( tr ( "Japan" ) );
490 cmbCountry->insertItem( tr ( "Jordan" ) ); 490 cmbCountry->insertItem( tr ( "Jordan" ) );
491 cmbCountry->insertItem( tr ( "Kazakhstan" ) ); 491 cmbCountry->insertItem( tr ( "Kazakhstan" ) );
492 cmbCountry->insertItem( tr ( "Kenya" ) ); 492 cmbCountry->insertItem( tr ( "Kenya" ) );
493 cmbCountry->insertItem( tr ( "Kribati" ) ); 493 cmbCountry->insertItem( tr ( "Kribati" ) );
494 cmbCountry->insertItem( tr ( "Korea" ) ); 494 cmbCountry->insertItem( tr ( "Korea" ) );
495 cmbCountry->insertItem( tr ( "Kuait" ) ); 495 cmbCountry->insertItem( tr ( "Kuait" ) );
496 cmbCountry->insertItem( tr ( "Kyrgyztan" ) ); 496 cmbCountry->insertItem( tr ( "Kyrgyztan" ) );
497 cmbCountry->insertItem( tr ( "Laos" ) ); 497 cmbCountry->insertItem( tr ( "Laos" ) );
498 cmbCountry->insertItem( tr ( "Latvia" ) ); 498 cmbCountry->insertItem( tr ( "Latvia" ) );
499 cmbCountry->insertItem( tr ( "Lebanon" ) ); 499 cmbCountry->insertItem( tr ( "Lebanon" ) );
500 cmbCountry->insertItem( tr ( "Lesotho" ) ); 500 cmbCountry->insertItem( tr ( "Lesotho" ) );
501 cmbCountry->insertItem( tr ( "Liberia" ) ); 501 cmbCountry->insertItem( tr ( "Liberia" ) );
502 cmbCountry->insertItem( tr ( "Liechtenstein" ) ); 502 cmbCountry->insertItem( tr ( "Liechtenstein" ) );
503 cmbCountry->insertItem( tr ( "Lithuania" ) ); 503 cmbCountry->insertItem( tr ( "Lithuania" ) );
504 cmbCountry->insertItem( tr ( "Luxembourg" ) ); 504 cmbCountry->insertItem( tr ( "Luxembourg" ) );
505 cmbCountry->insertItem( tr ( "Macau" ) ); 505 cmbCountry->insertItem( tr ( "Macau" ) );
506 cmbCountry->insertItem( tr ( "Macedonia" ) ); 506 cmbCountry->insertItem( tr ( "Macedonia" ) );
507 cmbCountry->insertItem( tr ( "Madagascar" ) ); 507 cmbCountry->insertItem( tr ( "Madagascar" ) );
508 cmbCountry->insertItem( tr ( "Malawi" ) ); 508 cmbCountry->insertItem( tr ( "Malawi" ) );
509 cmbCountry->insertItem( tr ( "Malaysia" ) ); 509 cmbCountry->insertItem( tr ( "Malaysia" ) );
510 cmbCountry->insertItem( tr ( "Maldives" ) ); 510 cmbCountry->insertItem( tr ( "Maldives" ) );
511 cmbCountry->insertItem( tr ( "Mali" ) ); 511 cmbCountry->insertItem( tr ( "Mali" ) );
512 cmbCountry->insertItem( tr ( "Malta" ) ); 512 cmbCountry->insertItem( tr ( "Malta" ) );
513 cmbCountry->insertItem( tr ( "Martinique" ) ); 513 cmbCountry->insertItem( tr ( "Martinique" ) );
514 cmbCountry->insertItem( tr ( "Mauritania" ) ); 514 cmbCountry->insertItem( tr ( "Mauritania" ) );
515 cmbCountry->insertItem( tr ( "Mauritius" ) ); 515 cmbCountry->insertItem( tr ( "Mauritius" ) );
516 cmbCountry->insertItem( tr ( "Mayotte" ) ); 516 cmbCountry->insertItem( tr ( "Mayotte" ) );
517 cmbCountry->insertItem( tr ( "Mexico" ) ); 517 cmbCountry->insertItem( tr ( "Mexico" ) );
518 cmbCountry->insertItem( tr ( "Micronesia" ) ); 518 cmbCountry->insertItem( tr ( "Micronesia" ) );
519 cmbCountry->insertItem( tr ( "Moldova" ) ); 519 cmbCountry->insertItem( tr ( "Moldova" ) );
520 cmbCountry->insertItem( tr ( "Monaco" ) ); 520 cmbCountry->insertItem( tr ( "Monaco" ) );
521 cmbCountry->insertItem( tr ( "Mongolia" ) ); 521 cmbCountry->insertItem( tr ( "Mongolia" ) );
522 cmbCountry->insertItem( tr ( "Montserrat" ) ); 522 cmbCountry->insertItem( tr ( "Montserrat" ) );
523 cmbCountry->insertItem( tr ( "Morocco" ) ); 523 cmbCountry->insertItem( tr ( "Morocco" ) );
524 cmbCountry->insertItem( tr ( "Mozambique" ) ); 524 cmbCountry->insertItem( tr ( "Mozambique" ) );
525 cmbCountry->insertItem( tr ( "Myanmar" ) ); 525 cmbCountry->insertItem( tr ( "Myanmar" ) );
526 cmbCountry->insertItem( tr ( "Namibia" ) ); 526 cmbCountry->insertItem( tr ( "Namibia" ) );
527 cmbCountry->insertItem( tr ( "Nauru" ) ); 527 cmbCountry->insertItem( tr ( "Nauru" ) );
528 cmbCountry->insertItem( tr ( "Nepal" ) ); 528 cmbCountry->insertItem( tr ( "Nepal" ) );
529 cmbCountry->insertItem( tr ( "Netherlands" ) ); 529 cmbCountry->insertItem( tr ( "Netherlands" ) );
530 cmbCountry->insertItem( tr ( "New Caledonia" ) ); 530 cmbCountry->insertItem( tr ( "New Caledonia" ) );
531 cmbCountry->insertItem( tr ( "New Zealand" ) ); 531 cmbCountry->insertItem( tr ( "New Zealand" ) );
532 cmbCountry->insertItem( tr ( "Nicaragua" ) ); 532 cmbCountry->insertItem( tr ( "Nicaragua" ) );
533 cmbCountry->insertItem( tr ( "Niger" ) ); 533 cmbCountry->insertItem( tr ( "Niger" ) );
534 cmbCountry->insertItem( tr ( "Nigeria" ) ); 534 cmbCountry->insertItem( tr ( "Nigeria" ) );
535 cmbCountry->insertItem( tr ( "Niue" ) ); 535 cmbCountry->insertItem( tr ( "Niue" ) );
536 cmbCountry->insertItem( tr ( "Norway" ) ); 536 cmbCountry->insertItem( tr ( "Norway" ) );
537 cmbCountry->insertItem( tr ( "Oman" ) ); 537 cmbCountry->insertItem( tr ( "Oman" ) );
538 cmbCountry->insertItem( tr ( "Pakistan" ) ); 538 cmbCountry->insertItem( tr ( "Pakistan" ) );
539 cmbCountry->insertItem( tr ( "Palau" ) ); 539 cmbCountry->insertItem( tr ( "Palau" ) );
540 cmbCountry->insertItem( tr ( "Palestinian Territory" ) ); 540 cmbCountry->insertItem( tr ( "Palestinian Territory" ) );
541 cmbCountry->insertItem( tr ( "Panama" ) ); 541 cmbCountry->insertItem( tr ( "Panama" ) );
542 cmbCountry->insertItem( tr ( "Papua New Guinea" ) ); 542 cmbCountry->insertItem( tr ( "Papua New Guinea" ) );
543 cmbCountry->insertItem( tr ( "Paraguay" ) ); 543 cmbCountry->insertItem( tr ( "Paraguay" ) );
544 cmbCountry->insertItem( tr ( "Peru" ) ); 544 cmbCountry->insertItem( tr ( "Peru" ) );
545 cmbCountry->insertItem( tr ( "Philippines" ) ); 545 cmbCountry->insertItem( tr ( "Philippines" ) );
546 cmbCountry->insertItem( tr ( "Pitcairn" ) ); 546 cmbCountry->insertItem( tr ( "Pitcairn" ) );
547 cmbCountry->insertItem( tr ( "Poland" ) ); 547 cmbCountry->insertItem( tr ( "Poland" ) );
548 cmbCountry->insertItem( tr ( "Portugal" ) ); 548 cmbCountry->insertItem( tr ( "Portugal" ) );
549 cmbCountry->insertItem( tr ( "Puerto Rico" ) ); 549 cmbCountry->insertItem( tr ( "Puerto Rico" ) );
550 cmbCountry->insertItem( tr ( "Qatar" ) ); 550 cmbCountry->insertItem( tr ( "Qatar" ) );
551 cmbCountry->insertItem( tr ( "Reunion" ) ); 551 cmbCountry->insertItem( tr ( "Reunion" ) );
552 cmbCountry->insertItem( tr ( "Romania" ) ); 552 cmbCountry->insertItem( tr ( "Romania" ) );
553 cmbCountry->insertItem( tr ( "Russia" ) ); 553 cmbCountry->insertItem( tr ( "Russia" ) );
554 cmbCountry->insertItem( tr ( "Rwanda" ) ); 554 cmbCountry->insertItem( tr ( "Rwanda" ) );
555 cmbCountry->insertItem( tr ( "Saint Lucia" ) ); 555 cmbCountry->insertItem( tr ( "Saint Lucia" ) );
556 cmbCountry->insertItem( tr ( "Samoa" ) ); 556 cmbCountry->insertItem( tr ( "Samoa" ) );
557 cmbCountry->insertItem( tr ( "San Marino" ) ); 557 cmbCountry->insertItem( tr ( "San Marino" ) );
558 cmbCountry->insertItem( tr ( "Saudi Arabia" ) ); 558 cmbCountry->insertItem( tr ( "Saudi Arabia" ) );
559 cmbCountry->insertItem( tr ( "Senegal" ) ); 559 cmbCountry->insertItem( tr ( "Senegal" ) );
560 cmbCountry->insertItem( tr ( "Seychelles" ) ); 560 cmbCountry->insertItem( tr ( "Seychelles" ) );
561 cmbCountry->insertItem( tr ( "Sierra Leone" ) ); 561 cmbCountry->insertItem( tr ( "Sierra Leone" ) );
562 cmbCountry->insertItem( tr ( "Singapore" ) ); 562 cmbCountry->insertItem( tr ( "Singapore" ) );
563 cmbCountry->insertItem( tr ( "Slovakia" ) ); 563 cmbCountry->insertItem( tr ( "Slovakia" ) );
564 cmbCountry->insertItem( tr ( "Slovenia" ) ); 564 cmbCountry->insertItem( tr ( "Slovenia" ) );
565 cmbCountry->insertItem( tr ( "Solomon Islands" ) ); 565 cmbCountry->insertItem( tr ( "Solomon Islands" ) );
566 cmbCountry->insertItem( tr ( "Somalia" ) ); 566 cmbCountry->insertItem( tr ( "Somalia" ) );
567 cmbCountry->insertItem( tr ( "South Africa" ) ); 567 cmbCountry->insertItem( tr ( "South Africa" ) );
568 cmbCountry->insertItem( tr ( "Spain" ) ); 568 cmbCountry->insertItem( tr ( "Spain" ) );
569 cmbCountry->insertItem( tr ( "Sri Lanka" ) ); 569 cmbCountry->insertItem( tr ( "Sri Lanka" ) );
570 cmbCountry->insertItem( tr ( "St. Helena" ) ); 570 cmbCountry->insertItem( tr ( "St. Helena" ) );
571 cmbCountry->insertItem( tr ( "Sudan" ) ); 571 cmbCountry->insertItem( tr ( "Sudan" ) );
572 cmbCountry->insertItem( tr ( "Suriname" ) ); 572 cmbCountry->insertItem( tr ( "Suriname" ) );
573 cmbCountry->insertItem( tr ( "Swaziland" ) ); 573 cmbCountry->insertItem( tr ( "Swaziland" ) );
574 cmbCountry->insertItem( tr ( "Sweden" ) ); 574 cmbCountry->insertItem( tr ( "Sweden" ) );
575 cmbCountry->insertItem( tr ( "Switzerland" ) ); 575 cmbCountry->insertItem( tr ( "Switzerland" ) );
576 cmbCountry->insertItem( tr ( "Taiwan" ) ); 576 cmbCountry->insertItem( tr ( "Taiwan" ) );
577 cmbCountry->insertItem( tr ( "Tajikistan" ) ); 577 cmbCountry->insertItem( tr ( "Tajikistan" ) );
578 cmbCountry->insertItem( tr ( "Tanzania" ) ); 578 cmbCountry->insertItem( tr ( "Tanzania" ) );
579 cmbCountry->insertItem( tr ( "Thailand" ) ); 579 cmbCountry->insertItem( tr ( "Thailand" ) );
580 cmbCountry->insertItem( tr ( "Togo" ) ); 580 cmbCountry->insertItem( tr ( "Togo" ) );
581 cmbCountry->insertItem( tr ( "Tokelau" ) ); 581 cmbCountry->insertItem( tr ( "Tokelau" ) );
582 cmbCountry->insertItem( tr ( "Tonga" ) ); 582 cmbCountry->insertItem( tr ( "Tonga" ) );
583 cmbCountry->insertItem( tr ( "Tunisia" ) ); 583 cmbCountry->insertItem( tr ( "Tunisia" ) );
584 cmbCountry->insertItem( tr ( "Turkey" ) ); 584 cmbCountry->insertItem( tr ( "Turkey" ) );
585 cmbCountry->insertItem( tr ( "Turkmenistan" ) ); 585 cmbCountry->insertItem( tr ( "Turkmenistan" ) );
586 cmbCountry->insertItem( tr ( "Tuvalu" ) ); 586 cmbCountry->insertItem( tr ( "Tuvalu" ) );
587 cmbCountry->insertItem( tr ( "Uganda" ) ); 587 cmbCountry->insertItem( tr ( "Uganda" ) );
588 cmbCountry->insertItem( tr ( "Ukraine" ) ); 588 cmbCountry->insertItem( tr ( "Ukraine" ) );
589 cmbCountry->insertItem( tr ( "Uruguay" ) ); 589 cmbCountry->insertItem( tr ( "Uruguay" ) );
590 cmbCountry->insertItem( tr ( "Uzbekistan" ) ); 590 cmbCountry->insertItem( tr ( "Uzbekistan" ) );
591 cmbCountry->insertItem( tr ( "Vanuatu" ) ); 591 cmbCountry->insertItem( tr ( "Vanuatu" ) );
592 cmbCountry->insertItem( tr ( "Venezuela" ) ); 592 cmbCountry->insertItem( tr ( "Venezuela" ) );
593 cmbCountry->insertItem( tr ( "Viet Nam" ) ); 593 cmbCountry->insertItem( tr ( "Viet Nam" ) );
594 cmbCountry->insertItem( tr ( "Virgin Islands" ) ); 594 cmbCountry->insertItem( tr ( "Virgin Islands" ) );
595 cmbCountry->insertItem( tr ( "Western Sahara" ) ); 595 cmbCountry->insertItem( tr ( "Western Sahara" ) );
596 cmbCountry->insertItem( tr ( "Yemen" ) ); 596 cmbCountry->insertItem( tr ( "Yemen" ) );
597 cmbCountry->insertItem( tr ( "Yugoslavia" ) ); 597 cmbCountry->insertItem( tr ( "Yugoslavia" ) );
598 cmbCountry->insertItem( tr ( "Zambia" ) ); 598 cmbCountry->insertItem( tr ( "Zambia" ) );
599 cmbCountry->insertItem( tr ( "Zimbabwe" ) ); 599 cmbCountry->insertItem( tr ( "Zimbabwe" ) );
600 600
601 cmbCountry->setMaximumWidth( 135 ); 601 cmbCountry->setMaximumWidth( 135 );
602 602
603 gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 ); 603 gl->addMultiCellWidget( cmbCountry, 5, 5, 1, 2 );
604 604
605 cmbChooserField4 = new QComboBox( FALSE, container ); 605 cmbChooserField4 = new QComboBox( FALSE, container );
606 cmbChooserField4->setMaximumWidth( 90 ); 606 cmbChooserField4->setMaximumWidth( 90 );
607 gl->addWidget( cmbChooserField4, 6, 0 ); 607 gl->addWidget( cmbChooserField4, 6, 0 );
608 txtChooserField4 = new QLineEdit( container ); 608 txtChooserField4 = new QLineEdit( container );
609 gl->addMultiCellWidget( txtChooserField4, 6, 6, 1, 2 ); 609 gl->addMultiCellWidget( txtChooserField4, 6, 6, 1, 2 );
610 tabMain->insertTab( tabViewport, tr( "Address" ) ); 610 tabMain->insertTab( tabViewport, tr( "Address" ) );
611 611
612 tabViewport = new QWidget ( tabMain ); 612 tabViewport = new QWidget ( tabMain );
613 613
614 vb = new QVBoxLayout( tabViewport ); 614 vb = new QVBoxLayout( tabViewport );
615 615
616 svDetails = new QScrollView( tabViewport ); 616 svDetails = new QScrollView( tabViewport );
617 vb->addWidget( svDetails, 0, 0 ); 617 vb->addWidget( svDetails, 0, 0 );
618 svDetails->setResizePolicy( QScrollView::AutoOneFit ); 618 svDetails->setResizePolicy( QScrollView::AutoOneFit );
619 svDetails->setFrameStyle( QFrame::NoFrame ); 619 svDetails->setFrameStyle( QFrame::NoFrame );
620 620
621 container = new QWidget( svDetails->viewport() ); 621 container = new QWidget( svDetails->viewport() );
622 svDetails->addChild( container ); 622 svDetails->addChild( container );
623 623
624 gl = new QGridLayout( container, 1, 2, 2, 4 ); 624 gl = new QGridLayout( container, 1, 2, 2, 4 );
625 625
626 QStringList::ConstIterator it = slDynamicEntries->begin(); 626 QStringList::ConstIterator it = slDynamicEntries->begin();
627 for (i = 0; it != slDynamicEntries->end(); i++, ++it) { 627 for (i = 0; it != slDynamicEntries->end(); i++, ++it) {
628 l = new QLabel( *it, container ); 628 l = new QLabel( *it, container );
629 listName.append( l ); 629 listName.append( l );
630 gl->addWidget( l, i, 0 ); 630 gl->addWidget( l, i, 0 );
631 QLineEdit *e = new QLineEdit( container ); 631 QLineEdit *e = new QLineEdit( container );
632 listValue.append( e ); 632 listValue.append( e );
633 gl->addWidget( e, i, 1); 633 gl->addWidget( e, i, 1);
634 } 634 }
635 635
636 l = new QLabel( tr("Gender"), container ); 636 l = new QLabel( tr("Gender"), container );
637 gl->addWidget( l, slDynamicEntries->count(), 0 ); 637 gl->addWidget( l, slDynamicEntries->count(), 0 );
638 cmbGender = new QComboBox( container ); 638 cmbGender = new QComboBox( container );
639 cmbGender->insertItem( "", 0 ); 639 cmbGender->insertItem( "", 0 );
640 cmbGender->insertItem( tr("Male"), 1); 640 cmbGender->insertItem( tr("Male"), 1);
641 cmbGender->insertItem( tr("Female"), 2); 641 cmbGender->insertItem( tr("Female"), 2);
642 gl->addWidget( cmbGender, slDynamicEntries->count(), 1 ); 642 gl->addWidget( cmbGender, slDynamicEntries->count(), 1 );
643 643
644 tabMain->insertTab( tabViewport, tr( "Details" ) ); 644 tabMain->insertTab( tabViewport, tr( "Details" ) );
645 645
646 dlgNote = new QDialog( this, "Note Dialog", TRUE ); 646 dlgNote = new QDialog( this, "Note Dialog", TRUE );
647 dlgNote->setCaption( tr("Enter Note") ); 647 dlgNote->setCaption( tr("Enter Note") );
648 QVBoxLayout *vbNote = new QVBoxLayout( dlgNote ); 648 QVBoxLayout *vbNote = new QVBoxLayout( dlgNote );
649 txtNote = new QMultiLineEdit( dlgNote ); 649 txtNote = new QMultiLineEdit( dlgNote );
650 vbNote->addWidget( txtNote ); 650 vbNote->addWidget( txtNote );
651 connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) ); 651 connect( btnNote, SIGNAL(clicked()), this, SLOT(slotNote()) );
652 652
653 dlgName = new QDialog( this, "Name Dialog", TRUE ); 653 dlgName = new QDialog( this, "Name Dialog", TRUE );
654 dlgName->setCaption( tr("Edit Name") ); 654 dlgName->setCaption( tr("Edit Name") );
655 gl = new QGridLayout( dlgName, 4, 2, 2, 3 ); 655 gl = new QGridLayout( dlgName, 4, 2, 2, 3 );
656 656
657 l = new QLabel( tr("First Name"), dlgName ); 657 l = new QLabel( tr("First Name"), dlgName );
658 gl->addWidget( l, 0, 0 ); 658 gl->addWidget( l, 0, 0 );
659 txtFirstName = new QLineEdit( dlgName ); 659 txtFirstName = new QLineEdit( dlgName );
660 gl->addWidget( txtFirstName, 0, 1 ); 660 gl->addWidget( txtFirstName, 0, 1 );
661 661
662 l = new QLabel( tr("Middle Name"), dlgName ); 662 l = new QLabel( tr("Middle Name"), dlgName );
663 gl->addWidget( l, 1, 0 ); 663 gl->addWidget( l, 1, 0 );
664 txtMiddleName = new QLineEdit( dlgName ); 664 txtMiddleName = new QLineEdit( dlgName );
665 gl->addWidget( txtMiddleName, 1, 1 ); 665 gl->addWidget( txtMiddleName, 1, 1 );
666 666
667 l = new QLabel( tr("Last Name"), dlgName ); 667 l = new QLabel( tr("Last Name"), dlgName );
668 gl->addWidget( l, 2, 0 ); 668 gl->addWidget( l, 2, 0 );
669 txtLastName = new QLineEdit( dlgName ); 669 txtLastName = new QLineEdit( dlgName );
670 gl->addWidget( txtLastName, 2, 1 ); 670 gl->addWidget( txtLastName, 2, 1 );
671 671
672 l = new QLabel( tr("Suffix"), dlgName ); 672 l = new QLabel( tr("Suffix"), dlgName );
673 gl->addWidget( l, 3, 0 ); 673 gl->addWidget( l, 3, 0 );
674 txtSuffix = new QLineEdit( dlgName ); 674 txtSuffix = new QLineEdit( dlgName );
675 gl->addWidget( txtSuffix, 3, 1 ); 675 gl->addWidget( txtSuffix, 3, 1 );
676 676
677 cmbChooserField1->insertStringList( *slChooserNames ); 677 cmbChooserField1->insertStringList( *slChooserNames );
678 cmbChooserField2->insertStringList( *slChooserNames ); 678 cmbChooserField2->insertStringList( *slChooserNames );
679 cmbChooserField3->insertStringList( *slChooserNames ); 679 cmbChooserField3->insertStringList( *slChooserNames );
680 cmbChooserField4->insertStringList( *slChooserNames ); 680 cmbChooserField4->insertStringList( *slChooserNames );
681 681
682 cmbChooserField1->setCurrentItem( 0 ); 682 cmbChooserField1->setCurrentItem( 0 );
683 cmbChooserField2->setCurrentItem( 1 ); 683 cmbChooserField2->setCurrentItem( 1 );
684 cmbChooserField3->setCurrentItem( 2 ); 684 cmbChooserField3->setCurrentItem( 2 );
685 685
686 connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) ); 686 connect( btnFullName, SIGNAL(clicked()), this, SLOT(slotName()) );
687 687
688 connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) ); 688 connect( txtFullName, SIGNAL(textChanged(const QString &)), this, SLOT(slotFullNameChange(const QString &)) );
689 689
690 connect( txtChooserField1, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser1Change(const QString &)) ); 690 connect( txtChooserField1, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser1Change(const QString &)) );
691 connect( txtChooserField2, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser2Change(const QString &)) ); 691 connect( txtChooserField2, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser2Change(const QString &)) );
692 connect( txtChooserField3, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser3Change(const QString &)) ); 692 connect( txtChooserField3, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser3Change(const QString &)) );
693 connect( txtChooserField4, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser4Change(const QString &)) ); 693 connect( txtChooserField4, SIGNAL(textChanged(const QString &)), this, SLOT(slotChooser4Change(const QString &)) );
694 connect( txtAddress, SIGNAL(textChanged(const QString &)), this, SLOT(slotAddressChange(const QString &)) ); 694 connect( txtAddress, SIGNAL(textChanged(const QString &)), this, SLOT(slotAddressChange(const QString &)) );
695 //connect( txtAddress2, SIGNAL(textChanged(const QString &)), this, SLOT(slotAddress2Change(const QString &)) ); 695 //connect( txtAddress2, SIGNAL(textChanged(const QString &)), this, SLOT(slotAddress2Change(const QString &)) );
696 //connect( txtPOBox, SIGNAL(textChanged(const QString &)), this, SLOT(slotPOBoxChange(const QString &)) ); 696 //connect( txtPOBox, SIGNAL(textChanged(const QString &)), this, SLOT(slotPOBoxChange(const QString &)) );
697 connect( txtCity, SIGNAL(textChanged(const QString &)), this, SLOT(slotCityChange(const QString &)) ); 697 connect( txtCity, SIGNAL(textChanged(const QString &)), this, SLOT(slotCityChange(const QString &)) );
698 connect( txtState, SIGNAL(textChanged(const QString &)), this, SLOT(slotStateChange(const QString &)) ); 698 connect( txtState, SIGNAL(textChanged(const QString &)), this, SLOT(slotStateChange(const QString &)) );
699 connect( txtZip, SIGNAL(textChanged(const QString &)), this, SLOT(slotZipChange(const QString &)) ); 699 connect( txtZip, SIGNAL(textChanged(const QString &)), this, SLOT(slotZipChange(const QString &)) );
700 connect( cmbCountry, SIGNAL(textChanged(const QString &)), this, SLOT(slotCountryChange(const QString &)) ); 700 connect( cmbCountry, SIGNAL(textChanged(const QString &)), this, SLOT(slotCountryChange(const QString &)) );
701 connect( cmbCountry, SIGNAL(activated(const QString &)), this, SLOT(slotCountryChange(const QString &)) ); 701 connect( cmbCountry, SIGNAL(activated(const QString &)), this, SLOT(slotCountryChange(const QString &)) );
702 connect( cmbChooserField1, SIGNAL(activated(int)), this, SLOT(slotCmbChooser1Change(int)) ); 702 connect( cmbChooserField1, SIGNAL(activated(int)), this, SLOT(slotCmbChooser1Change(int)) );
703 connect( cmbChooserField2, SIGNAL(activated(int)), this, SLOT(slotCmbChooser2Change(int)) ); 703 connect( cmbChooserField2, SIGNAL(activated(int)), this, SLOT(slotCmbChooser2Change(int)) );
704 connect( cmbChooserField3, SIGNAL(activated(int)), this, SLOT(slotCmbChooser3Change(int)) ); 704 connect( cmbChooserField3, SIGNAL(activated(int)), this, SLOT(slotCmbChooser3Change(int)) );
705 connect( cmbChooserField4, SIGNAL(activated(int)), this, SLOT(slotCmbChooser4Change(int)) ); 705 connect( cmbChooserField4, SIGNAL(activated(int)), this, SLOT(slotCmbChooser4Change(int)) );
706 connect( cmbAddress, SIGNAL(activated(int)), this, SLOT(slotAddressTypeChange(int)) ); 706 connect( cmbAddress, SIGNAL(activated(int)), this, SLOT(slotAddressTypeChange(int)) );
707 new QPEDialogListener(this); 707 new QPEDialogListener(this);
708} 708}
709 709
710void ContactEditor::initMap() 710void ContactEditor::initMap()
711{ 711{
712 /* 712 /*
713 // since the fields and the XML fields exist, create a map 713 // since the fields and the XML fields exist, create a map
714 // between them... 714 // between them...
715 Config cfg1( "AddressBook" ); 715 Config cfg1( "AddressBook" );
716 Config cfg2( "AddressBook" ); 716 Config cfg2( "AddressBook" );
717 QString strCfg1, 717 QString strCfg1,
718 strCfg2; 718 strCfg2;
719 int i; 719 int i;
720 720
721 // This stuff better exist... 721 // This stuff better exist...
722 cfg1.setGroup( "AddressFields" ); 722 cfg1.setGroup( "AddressFields" );
723o cfg2.setGroup( "XMLFields" ); 723o cfg2.setGroup( "XMLFields" );
724 i = 0; 724 i = 0;
725 strCfg1 = cfg1.readEntry( "Field" + QString::number(i), QString::null ); 725 strCfg1 = cfg1.readEntry( "Field" + QString::number(i), QString::null );
726 strCfg2 = cfg2.readEntry( "XMLField" + QString::number(i++), 726 strCfg2 = cfg2.readEntry( "XMLField" + QString::number(i++),
727 QString::null ); 727 QString::null );
728 while ( !strCfg1.isNull() && !strCfg2.isNull() ) { 728 while ( !strCfg1.isNull() && !strCfg2.isNull() ) {
729 mapField.insert( strCfg1, strCfg2 ); 729 mapField.insert( strCfg1, strCfg2 );
730 strCfg1 = cfg1.readEntry( "Field" + QString::number(i), 730 strCfg1 = cfg1.readEntry( "Field" + QString::number(i),
731 QString::null ); 731 QString::null );
732 strCfg2 = cfg2.readEntry( "XMLField" + QString::number(i++), 732 strCfg2 = cfg2.readEntry( "XMLField" + QString::number(i++),
733 QString::null ); 733 QString::null );
734 } 734 }
735 */ 735 */
736} 736}
737 737
738void ContactEditor::slotChooser1Change( const QString &textChanged ) { 738void ContactEditor::slotChooser1Change( const QString &textChanged ) {
739 739
740 int index = cmbChooserField1->currentItem(); 740 int index = cmbChooserField1->currentItem();
741 741
742 (*slChooserValues)[index] = textChanged; 742 (*slChooserValues)[index] = textChanged;
743 743
744} 744}
745 745
746void ContactEditor::slotChooser2Change( const QString &textChanged ) { 746void ContactEditor::slotChooser2Change( const QString &textChanged ) {
747 747
748 int index = cmbChooserField2->currentItem(); 748 int index = cmbChooserField2->currentItem();
749 749
750 (*slChooserValues)[index] = textChanged; 750 (*slChooserValues)[index] = textChanged;
751 751
752} 752}
753 753
754void ContactEditor::slotChooser3Change( const QString &textChanged ) { 754void ContactEditor::slotChooser3Change( const QString &textChanged ) {
755 755
756 int index = cmbChooserField3->currentItem(); 756 int index = cmbChooserField3->currentItem();
757 757
758 (*slChooserValues)[index] = textChanged; 758 (*slChooserValues)[index] = textChanged;
759 759
760} 760}
761 761
762void ContactEditor::slotChooser4Change( const QString &textChanged ) { 762void ContactEditor::slotChooser4Change( const QString &textChanged ) {
763 763
764 int index = cmbChooserField4->currentItem(); 764 int index = cmbChooserField4->currentItem();
765 765
766 (*slChooserValues)[index] = textChanged; 766 (*slChooserValues)[index] = textChanged;
767 767
768} 768}
769 769
770void ContactEditor::slotAddressChange( const QString &textChanged ) { 770void ContactEditor::slotAddressChange( const QString &textChanged ) {
771 771
772 if ( cmbAddress->currentItem() == 0 ) { 772 if ( cmbAddress->currentItem() == 0 ) {
773 (*slBusinessAddress)[0] = textChanged; 773 (*slBusinessAddress)[0] = textChanged;
774 } else { 774 } else {
775 (*slHomeAddress)[0] = textChanged; 775 (*slHomeAddress)[0] = textChanged;
776 } 776 }
777} 777}
778 778
779void ContactEditor::slotAddress2Change( const QString &textChanged ) { 779void ContactEditor::slotAddress2Change( const QString &textChanged ) {
780 780
781 if ( cmbAddress->currentItem() == 0 ) { 781 if ( cmbAddress->currentItem() == 0 ) {
782 (*slBusinessAddress)[1] = textChanged; 782 (*slBusinessAddress)[1] = textChanged;
783 } else { 783 } else {
784 (*slHomeAddress)[1] = textChanged; 784 (*slHomeAddress)[1] = textChanged;
785 } 785 }
786} 786}
787 787
788void ContactEditor::slotPOBoxChange( const QString &textChanged ) { 788void ContactEditor::slotPOBoxChange( const QString &textChanged ) {
789 789
790 if ( cmbAddress->currentItem() == 0 ) { 790 if ( cmbAddress->currentItem() == 0 ) {
791 (*slBusinessAddress)[2] = textChanged; 791 (*slBusinessAddress)[2] = textChanged;
792 } else { 792 } else {
793 (*slHomeAddress)[2] = textChanged; 793 (*slHomeAddress)[2] = textChanged;
794 } 794 }
795} 795}
796 796
797void ContactEditor::slotCityChange( const QString &textChanged ) { 797void ContactEditor::slotCityChange( const QString &textChanged ) {
798 798
799 if ( cmbAddress->currentItem() == 0 ) { 799 if ( cmbAddress->currentItem() == 0 ) {
800 (*slBusinessAddress)[3] = textChanged; 800 (*slBusinessAddress)[3] = textChanged;
801 } else { 801 } else {
802 (*slHomeAddress)[3] = textChanged; 802 (*slHomeAddress)[3] = textChanged;
803 } 803 }
804} 804}
805 805
806void ContactEditor::slotStateChange( const QString &textChanged ) { 806void ContactEditor::slotStateChange( const QString &textChanged ) {
807 807
808 808
809 if ( cmbAddress->currentItem() == 0 ) { 809 if ( cmbAddress->currentItem() == 0 ) {
810 (*slBusinessAddress)[4] = textChanged; 810 (*slBusinessAddress)[4] = textChanged;
811 } else { 811 } else {
812 (*slHomeAddress)[4] = textChanged; 812 (*slHomeAddress)[4] = textChanged;
813 } 813 }
814} 814}
815 815
816void ContactEditor::slotZipChange( const QString &textChanged ) { 816void ContactEditor::slotZipChange( const QString &textChanged ) {
817 817
818 if ( cmbAddress->currentItem() == 0 ) { 818 if ( cmbAddress->currentItem() == 0 ) {
819 (*slBusinessAddress)[5] = textChanged; 819 (*slBusinessAddress)[5] = textChanged;
820 } else { 820 } else {
821 (*slHomeAddress)[5] = textChanged; 821 (*slHomeAddress)[5] = textChanged;
822 } 822 }
823} 823}
824 824
825void ContactEditor::slotCountryChange( const QString &textChanged ) { 825void ContactEditor::slotCountryChange( const QString &textChanged ) {
826 826
827 if ( cmbAddress->currentItem() == 0 ) { 827 if ( cmbAddress->currentItem() == 0 ) {
828 (*slBusinessAddress)[6] = textChanged; 828 (*slBusinessAddress)[6] = textChanged;
829 } else { 829 } else {
830 (*slHomeAddress)[6] = textChanged; 830 (*slHomeAddress)[6] = textChanged;
831 } 831 }
832} 832}
833 833
834void ContactEditor::slotCmbChooser1Change( int index ) { 834void ContactEditor::slotCmbChooser1Change( int index ) {
835 835
836 txtChooserField1->setText( (*slChooserValues)[index] ); 836 txtChooserField1->setText( (*slChooserValues)[index] );
837 837
838} 838}
839 839
840void ContactEditor::slotCmbChooser2Change( int index ) { 840void ContactEditor::slotCmbChooser2Change( int index ) {
841 841
842 txtChooserField2->setText( (*slChooserValues)[index] ); 842 txtChooserField2->setText( (*slChooserValues)[index] );
843 843
844} 844}
845 845
846void ContactEditor::slotCmbChooser3Change( int index ) { 846void ContactEditor::slotCmbChooser3Change( int index ) {
847 847
848 txtChooserField3->setText( (*slChooserValues)[index] ); 848 txtChooserField3->setText( (*slChooserValues)[index] );
849 849
850} 850}
851 851
852void ContactEditor::slotCmbChooser4Change( int index ) { 852void ContactEditor::slotCmbChooser4Change( int index ) {
853 853
854 txtChooserField4->setText( (*slChooserValues)[index] ); 854 txtChooserField4->setText( (*slChooserValues)[index] );
855 855
856} 856}
857 857
858void ContactEditor::slotAddressTypeChange( int index ) { 858void ContactEditor::slotAddressTypeChange( int index ) {
859 859
860 if ( index == 0 ) { 860 if ( index == 0 ) {
861 861
862 txtAddress->setText( (*slBusinessAddress)[0] ); 862 txtAddress->setText( (*slBusinessAddress)[0] );
863 //txtAddress2->setText( (*slBusinessAddress)[1] ); 863 //txtAddress2->setText( (*slBusinessAddress)[1] );
864 //txtPOBox->setText( (*slBusinessAddress)[2] ); 864 //txtPOBox->setText( (*slBusinessAddress)[2] );
865 txtCity->setText( (*slBusinessAddress)[3] ); 865 txtCity->setText( (*slBusinessAddress)[3] );
866 txtState->setText( (*slBusinessAddress)[4] ); 866 txtState->setText( (*slBusinessAddress)[4] );
867 txtZip->setText( (*slBusinessAddress)[5] ); 867 txtZip->setText( (*slBusinessAddress)[5] );
868 QLineEdit *txtTmp = cmbCountry->lineEdit(); 868 QLineEdit *txtTmp = cmbCountry->lineEdit();
869 txtTmp->setText( (*slBusinessAddress)[6] ); 869 txtTmp->setText( (*slBusinessAddress)[6] );
870 870
871 } else { 871 } else {
872 872
873 txtAddress->setText( (*slHomeAddress)[0] ); 873 txtAddress->setText( (*slHomeAddress)[0] );
874 //txtAddress2->setText( (*slHomeAddress)[1] ); 874 //txtAddress2->setText( (*slHomeAddress)[1] );
875 //txtPOBox->setText( (*slHomeAddress)[2] ); 875 //txtPOBox->setText( (*slHomeAddress)[2] );
876 txtCity->setText( (*slHomeAddress)[3] ); 876 txtCity->setText( (*slHomeAddress)[3] );
877 txtState->setText( (*slHomeAddress)[4] ); 877 txtState->setText( (*slHomeAddress)[4] );
878 txtZip->setText( (*slHomeAddress)[5] ); 878 txtZip->setText( (*slHomeAddress)[5] );
879 QLineEdit *txtTmp = cmbCountry->lineEdit(); 879 QLineEdit *txtTmp = cmbCountry->lineEdit();
880 txtTmp->setText( (*slHomeAddress)[6] ); 880 txtTmp->setText( (*slHomeAddress)[6] );
881 881
882 } 882 }
883 883
884} 884}
885 885
886void ContactEditor::slotFullNameChange( const QString &textChanged ) { 886void ContactEditor::slotFullNameChange( const QString &textChanged ) {
887 887
888 int index = cmbFileAs->currentItem(); 888 int index = cmbFileAs->currentItem();
889 889
890 cmbFileAs->clear(); 890 cmbFileAs->clear();
891 891
892 cmbFileAs->insertItem( parseName( textChanged, 0 ) ); 892 cmbFileAs->insertItem( parseName( textChanged, 0 ) );
893 cmbFileAs->insertItem( parseName( textChanged, 1 ) ); 893 cmbFileAs->insertItem( parseName( textChanged, 1 ) );
894 cmbFileAs->insertItem( parseName( textChanged, 2 ) ); 894 cmbFileAs->insertItem( parseName( textChanged, 2 ) );
895 cmbFileAs->insertItem( parseName( textChanged, 3 ) ); 895 cmbFileAs->insertItem( parseName( textChanged, 3 ) );
896 896
897 cmbFileAs->setCurrentItem( index ); 897 cmbFileAs->setCurrentItem( index );
898 898
899 useFullName = TRUE; 899 useFullName = TRUE;
900 900
901 } 901 }
902 902
903void ContactEditor::loadFields() { 903void ContactEditor::loadFields() {
904 904
905 QStringList::ConstIterator it; 905 QStringList::ConstIterator it;
906 QListIterator<QLabel> lit( listName ); 906 QListIterator<QLabel> lit( listName );
907 for ( it = slDynamicEntries->begin(); *lit; ++lit, ++it) { 907 for ( it = slDynamicEntries->begin(); *lit; ++lit, ++it) {
908 (*lit)->setText( *it ); 908 (*lit)->setText( *it );
909 } 909 }
910} 910}
911 911
912void ContactEditor::accept() { 912void ContactEditor::accept() {
913 913
914 if ( isEmpty() ) { 914 if ( isEmpty() ) {
915 cleanupFields(); 915 cleanupFields();
916 reject(); 916 reject();
917 } else { 917 } else {
918 saveEntry(); 918 saveEntry();
919 cleanupFields(); 919 cleanupFields();
920 QDialog::accept(); 920 QDialog::accept();
921 } 921 }
922 922
923} 923}
924 924
925void ContactEditor::slotNote() { 925void ContactEditor::slotNote() {
926 926
927 dlgNote->showMaximized(); 927 dlgNote->showMaximized();
928 if ( !dlgNote->exec() ) { 928 if ( !dlgNote->exec() ) {
929 txtNote->setText( ent.notes() ); 929 txtNote->setText( ent.notes() );
930 } 930 }
931} 931}
932 932
933void ContactEditor::slotName() { 933void ContactEditor::slotName() {
934 934
935 if (useFullName = TRUE) { 935 if (useFullName = TRUE) {
936 txtFirstName->setText( parseName(txtFullName->text(), NAME_F) ); 936 txtFirstName->setText( parseName(txtFullName->text(), NAME_F) );
937 txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) ); 937 txtMiddleName->setText( parseName(txtFullName->text(), NAME_M) );
938 txtLastName->setText( parseName(txtFullName->text(), NAME_L) ); 938 txtLastName->setText( parseName(txtFullName->text(), NAME_L) );
939 txtSuffix->setText( parseName(txtFullName->text(), NAME_S) ); 939 txtSuffix->setText( parseName(txtFullName->text(), NAME_S) );
940 } 940 }
941 941
942 dlgName->showMaximized(); 942 dlgName->showMaximized();
943 if ( dlgName->exec() ) { 943 if ( dlgName->exec() ) {
944 txtFullName->setText( txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text() + " " + txtSuffix->text() ); 944 txtFullName->setText( txtFirstName->text() + " " + txtMiddleName->text() + " " + txtLastName->text() + " " + txtSuffix->text() );
945 slotFullNameChange( txtFullName->text() ); 945 slotFullNameChange( txtFullName->text() );
946 useFullName = FALSE; 946 useFullName = FALSE;
947 } 947 }
948 948
949} 949}
950 950
951void ContactEditor::setNameFocus() { 951void ContactEditor::setNameFocus() {
952 952
953 txtFullName->setFocus(); 953 txtFullName->setFocus();
954 954
955} 955}
956 956
957bool ContactEditor::isEmpty() { 957bool ContactEditor::isEmpty() {
958 // Test and see if the record should be saved. 958 // Test and see if the record should be saved.
959 // More strict than the original qtopia, needs name or fileas to save 959 // More strict than the original qtopia, needs name or fileas to save
960 960
961 QString t = txtFullName->text(); 961 QString t = txtFullName->text();
962 if ( !t.isEmpty() && containsAlphaNum( t ) ) 962 if ( !t.isEmpty() && containsAlphaNum( t ) )
963 return false; 963 return false;
964 964
965 t = cmbFileAs->currentText(); 965 t = cmbFileAs->currentText();
966 if ( !t.isEmpty() && containsAlphaNum( t ) ) 966 if ( !t.isEmpty() && containsAlphaNum( t ) )
967 return false; 967 return false;
968 968
969 return true; 969 return true;
970 970
971} 971}
972 972
973QString ContactEditor::parseName( const QString fullName, int type ) { 973QString ContactEditor::parseName( const QString fullName, int type ) {
974 974
975 QString simplifiedName( fullName.simplifyWhiteSpace() ); 975 QString simplifiedName( fullName.simplifyWhiteSpace() );
976 QString strFirstName; 976 QString strFirstName;
977 QString strMiddleName; 977 QString strMiddleName;
978 QString strLastName; 978 QString strLastName;
979 QString strSuffix; 979 QString strSuffix;
980 QString strTitle; 980 QString strTitle;
981 int commapos; 981 int commapos;
982 int spCount; 982 int spCount;
983 int spPos; 983 int spPos;
984 int spPos2; 984 int spPos2;
985 985
986 986
987 commapos = simplifiedName.find( ',', 0, TRUE); 987 commapos = simplifiedName.find( ',', 0, TRUE);
988 spCount = simplifiedName.contains( ' ', TRUE ); 988 spCount = simplifiedName.contains( ' ', TRUE );
989 989
990 if ( commapos == -1 ) { 990 if ( commapos == -1 ) {
991 991
992 switch (spCount) { 992 switch (spCount) {
993 case 0: 993 case 0:
994 return simplifiedName; 994 return simplifiedName;
995 995
996 case 1: 996 case 1:
997 spPos = simplifiedName.find( ' ', 0, TRUE ); 997 spPos = simplifiedName.find( ' ', 0, TRUE );
998 strFirstName = simplifiedName.left( spPos ); 998 strFirstName = simplifiedName.left( spPos );
999 strLastName = simplifiedName.mid( spPos + 1 ); 999 strLastName = simplifiedName.mid( spPos + 1 );
1000 break; 1000 break;
1001 1001
1002 case 2: 1002 case 2:
1003 spPos = simplifiedName.find( ' ', 0, TRUE ); 1003 spPos = simplifiedName.find( ' ', 0, TRUE );
1004 strFirstName = simplifiedName.left( spPos ); 1004 strFirstName = simplifiedName.left( spPos );
1005 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1005 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1006 strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1006 strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1007 strLastName = simplifiedName.mid( spPos2 + 1 ); 1007 strLastName = simplifiedName.mid( spPos2 + 1 );
1008 break; 1008 break;
1009 1009
1010 case 3: 1010 case 3:
1011 spPos = simplifiedName.find( ' ', 0, TRUE ); 1011 spPos = simplifiedName.find( ' ', 0, TRUE );
1012 strFirstName = simplifiedName.left( spPos ); 1012 strFirstName = simplifiedName.left( spPos );
1013 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1013 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1014 strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1014 strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1015 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); 1015 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE );
1016 strLastName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos ); 1016 strLastName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 );
1017 strSuffix = simplifiedName.mid( spPos + 1 ); 1017 strSuffix = simplifiedName.mid( spPos + 1 );
1018 break; 1018 break;
1019 1019
1020 case 4: 1020 case 4:
1021 spPos = simplifiedName.find( ' ', 0, TRUE ); 1021 spPos = simplifiedName.find( ' ', 0, TRUE );
1022 strTitle = simplifiedName.left( spPos ); 1022 strTitle = simplifiedName.left( spPos );
1023 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1023 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1024 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1024 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1025 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); 1025 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE );
1026 strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos ); 1026 strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 );
1027 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1027 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1028 strLastName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1028 strLastName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1029 strSuffix = simplifiedName.mid( spPos2 + 1 ); 1029 strSuffix = simplifiedName.mid( spPos2 + 1 );
1030 break; 1030 break;
1031 1031
1032 default: 1032 default:
1033 spPos = simplifiedName.find( ' ', 0, TRUE ); 1033 spPos = simplifiedName.find( ' ', 0, TRUE );
1034 strTitle = simplifiedName.left( spPos ); 1034 strTitle = simplifiedName.left( spPos );
1035 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1035 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1036 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1036 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1037 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); 1037 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE );
1038 strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos ); 1038 strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 );
1039 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1039 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1040 strLastName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1040 strLastName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1041 strSuffix = simplifiedName.mid( spPos2 + 1 ); 1041 strSuffix = simplifiedName.mid( spPos2 + 1 );
1042 break; 1042 break;
1043 } 1043 }
1044 } else { 1044 } else {
1045 simplifiedName.replace( commapos, 1, " " ); 1045 simplifiedName.replace( commapos, 1, " " );
1046 simplifiedName = simplifiedName.simplifyWhiteSpace(); 1046 simplifiedName = simplifiedName.simplifyWhiteSpace();
1047 1047
1048 switch (spCount) { 1048 switch (spCount) {
1049 case 0: 1049 case 0:
1050 return simplifiedName; 1050 return simplifiedName;
1051 1051
1052 case 1: 1052 case 1:
1053 spPos = simplifiedName.find( ' ', 0, TRUE ); 1053 spPos = simplifiedName.find( ' ', 0, TRUE );
1054 strLastName = simplifiedName.left( spPos ); 1054 strLastName = simplifiedName.left( spPos );
1055 strFirstName = simplifiedName.mid( spPos + 1 ); 1055 strFirstName = simplifiedName.mid( spPos + 1 );
1056 break; 1056 break;
1057 1057
1058 case 2: 1058 case 2:
1059 spPos = simplifiedName.find( ' ', 0, TRUE ); 1059 spPos = simplifiedName.find( ' ', 0, TRUE );
1060 strLastName = simplifiedName.left( spPos ); 1060 strLastName = simplifiedName.left( spPos );
1061 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1061 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1062 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1062 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1063 strMiddleName = simplifiedName.mid( spPos2 + 1 ); 1063 strMiddleName = simplifiedName.mid( spPos2 + 1 );
1064 break; 1064 break;
1065 1065
1066 case 3: 1066 case 3:
1067 spPos = simplifiedName.find( ' ', 0, TRUE ); 1067 spPos = simplifiedName.find( ' ', 0, TRUE );
1068 strLastName = simplifiedName.left( spPos ); 1068 strLastName = simplifiedName.left( spPos );
1069 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1069 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1070 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1070 strFirstName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1071 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); 1071 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE );
1072 strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos ); 1072 strMiddleName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 );
1073 strSuffix = simplifiedName.mid( spPos + 1 ); 1073 strSuffix = simplifiedName.mid( spPos + 1 );
1074 break; 1074 break;
1075 1075
1076 case 4: 1076 case 4:
1077 spPos = simplifiedName.find( ' ', 0, TRUE ); 1077 spPos = simplifiedName.find( ' ', 0, TRUE );
1078 strLastName = simplifiedName.left( spPos ); 1078 strLastName = simplifiedName.left( spPos );
1079 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1079 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1080 strTitle = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1080 strTitle = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1081 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); 1081 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE );
1082 strFirstName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos ); 1082 strFirstName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos2 );
1083 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1083 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1084 strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1084 strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1085 strSuffix = simplifiedName.mid( spPos2 + 1 ); 1085 strSuffix = simplifiedName.mid( spPos2 + 1 );
1086 break; 1086 break;
1087 1087
1088 default: 1088 default:
1089 spPos = simplifiedName.find( ' ', 0, TRUE ); 1089 spPos = simplifiedName.find( ' ', 0, TRUE );
1090 strLastName = simplifiedName.left( spPos ); 1090 strLastName = simplifiedName.left( spPos );
1091 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1091 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1092 strTitle = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1092 strTitle = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1093 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE ); 1093 spPos = simplifiedName.find( ' ', spPos2 + 1, TRUE );
1094 strFirstName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos ); 1094 strFirstName = simplifiedName.mid( spPos2 + 1, (spPos - 1) - spPos );
1095 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE ); 1095 spPos2 = simplifiedName.find( ' ', spPos + 1, TRUE );
1096 strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos ); 1096 strMiddleName = simplifiedName.mid( spPos + 1, (spPos2 - 1) - spPos );
1097 strSuffix = simplifiedName.mid( spPos2 + 1 ); 1097 strSuffix = simplifiedName.mid( spPos2 + 1 );
1098 break; 1098 break;
1099 } 1099 }
1100 } 1100 }
1101 1101
1102 switch (type) { 1102 switch (type) {
1103 case NAME_FL: 1103 case NAME_FL:
1104 return strFirstName + " " + strLastName; 1104 return strFirstName + " " + strLastName;
1105 1105
1106 case NAME_LF: 1106 case NAME_LF:
1107 return strLastName + ", " + strFirstName; 1107 return strLastName + ", " + strFirstName;
1108 1108
1109 case NAME_LFM: 1109 case NAME_LFM:
1110 return strLastName + ", " + strFirstName + " " + strMiddleName; 1110 return strLastName + ", " + strFirstName + " " + strMiddleName;
1111 1111
1112 case NAME_FMLS: 1112 case NAME_FMLS:
1113 return strFirstName + " " + strMiddleName + " " + strLastName + " " + strSuffix; 1113 return strFirstName + " " + strMiddleName + " " + strLastName + " " + strSuffix;
1114 1114
1115 case NAME_F: 1115 case NAME_F:
1116 return strFirstName; 1116 return strFirstName;
1117 1117
1118 case NAME_M: 1118 case NAME_M:
1119 return strMiddleName; 1119 return strMiddleName;
1120 1120
1121 case NAME_L: 1121 case NAME_L:
1122 return strLastName; 1122 return strLastName;
1123 1123
1124 case NAME_S: 1124 case NAME_S:
1125 return strSuffix; 1125 return strSuffix;
1126 1126
1127 } 1127 }
1128} 1128}
1129 1129
1130void ContactEditor::cleanupFields() { 1130void ContactEditor::cleanupFields() {
1131 1131
1132 QStringList::Iterator it = slChooserValues->begin(); 1132 QStringList::Iterator it = slChooserValues->begin();
1133 for ( int i = 0; it != slChooserValues->end(); i++, ++it ) { 1133 for ( int i = 0; it != slChooserValues->end(); i++, ++it ) {
1134 (*it) = ""; 1134 (*it) = "";
1135 } 1135 }
1136 1136
1137 for ( int i = 0; i < 7; i++ ) { 1137 for ( int i = 0; i < 7; i++ ) {
1138 (*slHomeAddress)[i] = ""; 1138 (*slHomeAddress)[i] = "";
1139 (*slBusinessAddress)[i] = ""; 1139 (*slBusinessAddress)[i] = "";
1140 } 1140 }
1141 1141
1142 QStringList::ConstIterator cit; 1142 QStringList::ConstIterator cit;
1143 QListIterator<QLineEdit> itLE( listValue ); 1143 QListIterator<QLineEdit> itLE( listValue );
1144 for ( cit = slDynamicEntries->begin(); cit != slDynamicEntries->end(); ++cit, ++itLE) { 1144 for ( cit = slDynamicEntries->begin(); cit != slDynamicEntries->end(); ++cit, ++itLE) {
1145 (*itLE)->setText( "" ); 1145 (*itLE)->setText( "" );
1146 } 1146 }
1147 1147
1148 txtFirstName->setText(""); 1148 txtFirstName->setText("");
1149 txtMiddleName->setText(""); 1149 txtMiddleName->setText("");
1150 txtLastName->setText(""); 1150 txtLastName->setText("");
1151 txtSuffix->setText(""); 1151 txtSuffix->setText("");
1152 txtNote->setText(""); 1152 txtNote->setText("");
1153 txtFullName->setText(""); 1153 txtFullName->setText("");
1154 txtJobTitle->setText(""); 1154 txtJobTitle->setText("");
1155 txtOrganization->setText(""); 1155 txtOrganization->setText("");
1156 txtChooserField1->setText(""); 1156 txtChooserField1->setText("");
1157 txtChooserField2->setText(""); 1157 txtChooserField2->setText("");
1158 txtChooserField3->setText(""); 1158 txtChooserField3->setText("");
1159 txtAddress->setText(""); 1159 txtAddress->setText("");
1160 //txtAddress2->setText(""); 1160 //txtAddress2->setText("");
1161 txtCity->setText(""); 1161 txtCity->setText("");
1162 //txtPOBox->setText(""); 1162 //txtPOBox->setText("");
1163 txtState->setText(""); 1163 txtState->setText("");
1164 txtZip->setText(""); 1164 txtZip->setText("");
1165 QLineEdit *txtTmp = cmbCountry->lineEdit(); 1165 QLineEdit *txtTmp = cmbCountry->lineEdit();
1166 txtTmp->setText(""); 1166 txtTmp->setText("");
1167 txtTmp = cmbFileAs->lineEdit(); 1167 txtTmp = cmbFileAs->lineEdit();
1168 txtTmp->setText(""); 1168 txtTmp->setText("");
1169 1169
1170} 1170}
1171 1171
1172void ContactEditor::setEntry( const Contact &entry ) { 1172void ContactEditor::setEntry( const Contact &entry ) {
1173 1173
1174 cleanupFields(); 1174 cleanupFields();
1175 1175
1176 1176
1177 ent = entry; 1177 ent = entry;
1178 1178
1179 useFullName = FALSE; 1179 useFullName = FALSE;
1180 txtFirstName->setText( ent.firstName() ); 1180 txtFirstName->setText( ent.firstName() );
1181 txtMiddleName->setText( ent.middleName() ); 1181 txtMiddleName->setText( ent.middleName() );
1182 txtLastName->setText( ent.lastName() ); 1182 txtLastName->setText( ent.lastName() );
1183 txtSuffix->setText( ent.suffix() ); 1183 txtSuffix->setText( ent.suffix() );
1184 1184
1185 QString *tmpString = new QString; 1185 QString *tmpString = new QString;
1186 *tmpString = ent.firstName() + " " + ent.middleName() + 1186 *tmpString = ent.firstName() + " " + ent.middleName() +
1187 + " " + ent.lastName() + " " + ent.suffix(); 1187 + " " + ent.lastName() + " " + ent.suffix();
1188 1188
1189 txtFullName->setText( tmpString->simplifyWhiteSpace() ); 1189 txtFullName->setText( tmpString->simplifyWhiteSpace() );
1190 1190
1191 cmbFileAs->setEditText( ent.fileAs() ); 1191 cmbFileAs->setEditText( ent.fileAs() );
1192 1192
1193 if (hasTitle) 1193 if (hasTitle)
1194 txtJobTitle->setText( ent.jobTitle() ); 1194 txtJobTitle->setText( ent.jobTitle() );
1195 1195
1196 if (hasCompany) 1196 if (hasCompany)
1197 txtOrganization->setText( ent.company() ); 1197 txtOrganization->setText( ent.company() );
1198 1198
1199 if (hasNotes) 1199 if (hasNotes)
1200 txtNote->setText( ent.notes() ); 1200 txtNote->setText( ent.notes() );
1201 1201
1202 if (hasStreet) { 1202 if (hasStreet) {
1203 (*slHomeAddress)[0] = ent.homeStreet(); 1203 (*slHomeAddress)[0] = ent.homeStreet();
1204 (*slBusinessAddress)[0] = ent.businessStreet(); 1204 (*slBusinessAddress)[0] = ent.businessStreet();
1205 } 1205 }
1206/* 1206/*
1207 if (hasStreet2) { 1207 if (hasStreet2) {
1208 (*slHomeAddress)[1] = ent.homeStreet2(); 1208 (*slHomeAddress)[1] = ent.homeStreet2();
1209 (*slBusinessAddress)[1] = ent.businessStreet2(); 1209 (*slBusinessAddress)[1] = ent.businessStreet2();
1210 } 1210 }
1211 1211
1212 if (hasPOBox) { 1212 if (hasPOBox) {
1213 (*slHomeAddress)[2] = ent.homePOBox(); 1213 (*slHomeAddress)[2] = ent.homePOBox();
1214 (*slBusinessAddress)[2] = ent.businessPOBox(); 1214 (*slBusinessAddress)[2] = ent.businessPOBox();
1215 } 1215 }
1216*/ 1216*/
1217 if (hasCity) { 1217 if (hasCity) {
1218 (*slHomeAddress)[3] = ent.homeCity(); 1218 (*slHomeAddress)[3] = ent.homeCity();
1219 (*slBusinessAddress)[3] = ent.businessCity(); 1219 (*slBusinessAddress)[3] = ent.businessCity();
1220 } 1220 }
1221 1221
1222 if (hasState) { 1222 if (hasState) {
1223 (*slHomeAddress)[4] = ent.homeState(); 1223 (*slHomeAddress)[4] = ent.homeState();
1224 (*slBusinessAddress)[4] = ent.businessState(); 1224 (*slBusinessAddress)[4] = ent.businessState();
1225 } 1225 }
1226 1226
1227 if (hasZip) { 1227 if (hasZip) {
1228 (*slHomeAddress)[5] = ent.homeZip(); 1228 (*slHomeAddress)[5] = ent.homeZip();
1229 (*slBusinessAddress)[5] = ent.businessZip(); 1229 (*slBusinessAddress)[5] = ent.businessZip();
1230 } 1230 }
1231 1231
1232 if (hasCountry) { 1232 if (hasCountry) {
1233 (*slHomeAddress)[6] = ent.homeCountry(); 1233 (*slHomeAddress)[6] = ent.homeCountry();
1234 (*slBusinessAddress)[6] = ent.businessCountry(); 1234 (*slBusinessAddress)[6] = ent.businessCountry();
1235 } 1235 }
1236 1236
1237 QStringList::ConstIterator it; 1237 QStringList::ConstIterator it;
1238 QListIterator<QLineEdit> itLE( listValue ); 1238 QListIterator<QLineEdit> itLE( listValue );
1239 for ( it = slDynamicEntries->begin(); it != slDynamicEntries->end(); ++it, ++itLE) { 1239 for ( it = slDynamicEntries->begin(); it != slDynamicEntries->end(); ++it, ++itLE) {
1240 if ( *it == "Department" ) 1240 if ( *it == "Department" )
1241 (*itLE)->setText( ent.department() ); 1241 (*itLE)->setText( ent.department() );
1242 1242
1243 if ( *it == "Company" ) 1243 if ( *it == "Company" )
1244 (*itLE)->setText( ent.company() ); 1244 (*itLE)->setText( ent.company() );
1245 1245
1246 if ( *it == "Office" ) 1246 if ( *it == "Office" )
1247 (*itLE)->setText( ent.office() ); 1247 (*itLE)->setText( ent.office() );
1248 1248
1249 if ( *it == "Profession" ) 1249 if ( *it == "Profession" )
1250 (*itLE)->setText( ent.profession() ); 1250 (*itLE)->setText( ent.profession() );
1251 1251
1252 if ( *it == "Assistant" ) 1252 if ( *it == "Assistant" )
1253 (*itLE)->setText( ent.assistant() ); 1253 (*itLE)->setText( ent.assistant() );
1254 1254
1255 if ( *it == "Manager" ) 1255 if ( *it == "Manager" )
1256 (*itLE)->setText( ent.manager() ); 1256 (*itLE)->setText( ent.manager() );
1257 1257
1258 if ( *it == "Spouse" ) 1258 if ( *it == "Spouse" )
1259 (*itLE)->setText( ent.spouse() ); 1259 (*itLE)->setText( ent.spouse() );
1260 1260
1261 if ( *it == "Birthday" ) 1261 if ( *it == "Birthday" )
1262 (*itLE)->setText( ent.birthday() ); 1262 (*itLE)->setText( ent.birthday() );
1263 1263
1264 if ( *it == "Anniversary" ) 1264 if ( *it == "Anniversary" )
1265 (*itLE)->setText( ent.anniversary() ); 1265 (*itLE)->setText( ent.anniversary() );
1266 1266
1267 if ( *it == "Nickname" ) 1267 if ( *it == "Nickname" )
1268 (*itLE)->setText( ent.nickname() ); 1268 (*itLE)->setText( ent.nickname() );
1269 1269
1270 if ( *it == "Children" ) 1270 if ( *it == "Children" )
1271 (*itLE)->setText( ent.children() ); 1271 (*itLE)->setText( ent.children() );
1272 1272
1273 } 1273 }
1274 1274
1275 QStringList::Iterator itV; 1275 QStringList::Iterator itV;
1276 for ( it = slChooserNames->begin(), itV = slChooserValues->begin(); it != slChooserNames->end(); ++it, ++itV ) { 1276 for ( it = slChooserNames->begin(), itV = slChooserValues->begin(); it != slChooserNames->end(); ++it, ++itV ) {
1277 1277
1278 if ( *it == "Business Phone" || *it == "Work Phone" ) 1278 if ( *it == "Business Phone" || *it == "Work Phone" )
1279 *itV = ent.businessPhone(); 1279 *itV = ent.businessPhone();
1280/* 1280/*
1281 if ( *it == "Business 2 Phone" ) 1281 if ( *it == "Business 2 Phone" )
1282 *itV = ent.business2Phone(); 1282 *itV = ent.business2Phone();
1283*/ 1283*/
1284 if ( *it == "Business Fax" || *it == "Work Fax" ) 1284 if ( *it == "Business Fax" || *it == "Work Fax" )
1285 *itV = ent.businessFax(); 1285 *itV = ent.businessFax();
1286 1286
1287 if ( *it == "Business Mobile" || *it == "work Mobile" ) 1287 if ( *it == "Business Mobile" || *it == "work Mobile" )
1288 *itV = ent.businessMobile(); 1288 *itV = ent.businessMobile();
1289/* 1289/*
1290 if ( *it == "Company Phone" ) 1290 if ( *it == "Company Phone" )
1291 *itV = ent.companyPhone(); 1291 *itV = ent.companyPhone();
1292*/ 1292*/
1293 if ( *it == "Default Email" ) 1293 if ( *it == "Default Email" )
1294 *itV = ent.defaultEmail(); 1294 *itV = ent.defaultEmail();
1295 1295
1296 if ( *it == "Emails" ) 1296 if ( *it == "Emails" )
1297 *itV = ent.emails(); 1297 *itV = ent.emails();
1298 1298
1299 if ( *it == "Home Phone" ) 1299 if ( *it == "Home Phone" )
1300 *itV = ent.homePhone(); 1300 *itV = ent.homePhone();
1301/* 1301/*
1302 if ( *it == "Home 2 Phone" ) 1302 if ( *it == "Home 2 Phone" )
1303 *itV = ent.home2Phone(); 1303 *itV = ent.home2Phone();
1304*/ 1304*/
1305 if ( *it == "Home Fax" ) 1305 if ( *it == "Home Fax" )
1306 *itV = ent.homeFax(); 1306 *itV = ent.homeFax();
1307 1307
1308 if ( *it == "Home Mobile" ) 1308 if ( *it == "Home Mobile" )
1309 *itV = ent.homeMobile(); 1309 *itV = ent.homeMobile();
1310/* 1310/*
1311 if ( *it == "Car Phone" ) 1311 if ( *it == "Car Phone" )
1312 *itV = ent.carPhone(); 1312 *itV = ent.carPhone();
1313 1313
1314 if ( *it == "ISDN Phone" ) 1314 if ( *it == "ISDN Phone" )
1315 *itV = ent.ISDNPhone(); 1315 *itV = ent.ISDNPhone();
1316 1316
1317 if ( *it == "Other Phone" ) 1317 if ( *it == "Other Phone" )
1318 *itV = ent.otherPhone(); 1318 *itV = ent.otherPhone();
1319*/ 1319*/
1320 if ( *it == "Business Pager" || *it == "Work Pager" ) 1320 if ( *it == "Business Pager" || *it == "Work Pager" )
1321 *itV = ent.businessPager(); 1321 *itV = ent.businessPager();
1322/* 1322/*
1323 if ( *it == "Home Pager") 1323 if ( *it == "Home Pager")
1324 *itV = ent.homePager(); 1324 *itV = ent.homePager();
1325 1325
1326 if ( *it == "AIM IM" ) 1326 if ( *it == "AIM IM" )
1327 *itV = ent.AIMIM(); 1327 *itV = ent.AIMIM();
1328 1328
1329 if ( *it == "ICQ IM" ) 1329 if ( *it == "ICQ IM" )
1330 *itV = ent.ICQIM(); 1330 *itV = ent.ICQIM();
1331 1331
1332 if ( *it == "Jabber IM" ) 1332 if ( *it == "Jabber IM" )
1333 *itV = ent.jabberIM(); 1333 *itV = ent.jabberIM();
1334 1334
1335 if ( *it == "MSN IM" ) 1335 if ( *it == "MSN IM" )
1336 *itV = ent.MSNIM(); 1336 *itV = ent.MSNIM();
1337 1337
1338 if ( *it == "Yahoo IM" ) 1338 if ( *it == "Yahoo IM" )
1339 *itV = ent.yahooIM(); 1339 *itV = ent.yahooIM();
1340*/ 1340*/
1341 if ( *it == "Home Web Page" ) 1341 if ( *it == "Home Web Page" )
1342 *itV = ent.homeWebpage(); 1342 *itV = ent.homeWebpage();
1343 if ( *it == "Business Web Page" || *it == "Work Web Page" ) 1343 if ( *it == "Business Web Page" || *it == "Work Web Page" )
1344 *itV = ent.businessWebpage(); 1344 *itV = ent.businessWebpage();
1345 1345
1346 1346
1347 } 1347 }
1348 1348
1349 cmbCat->setCategories( ent.categories(), "Contacts", tr("Contacts") ); 1349 cmbCat->setCategories( ent.categories(), "Contacts", tr("Contacts") );
1350 1350
1351 QString gender = ent.gender(); 1351 QString gender = ent.gender();
1352 cmbGender->setCurrentItem( gender.toInt() ); 1352 cmbGender->setCurrentItem( gender.toInt() );
1353 1353
1354 txtNote->setText( ent.notes() ); 1354 txtNote->setText( ent.notes() );
1355 1355
1356 slotCmbChooser1Change( cmbChooserField1->currentItem() ); 1356 slotCmbChooser1Change( cmbChooserField1->currentItem() );
1357 slotCmbChooser2Change( cmbChooserField2->currentItem() ); 1357 slotCmbChooser2Change( cmbChooserField2->currentItem() );
1358 slotCmbChooser3Change( cmbChooserField3->currentItem() ); 1358 slotCmbChooser3Change( cmbChooserField3->currentItem() );
1359 1359
1360 slotAddressTypeChange( cmbAddress->currentItem() ); 1360 slotAddressTypeChange( cmbAddress->currentItem() );
1361 1361
1362} 1362}
1363 1363
1364void ContactEditor::saveEntry() { 1364void ContactEditor::saveEntry() {
1365 1365
1366 if ( useFullName == TRUE ) { 1366 if ( useFullName == TRUE ) {
1367 txtFirstName->setText( parseName( txtFullName->text(), NAME_F ) ); 1367 txtFirstName->setText( parseName( txtFullName->text(), NAME_F ) );
1368 txtMiddleName->setText( parseName( txtFullName->text(), NAME_M ) ); 1368 txtMiddleName->setText( parseName( txtFullName->text(), NAME_M ) );
1369 txtLastName->setText( parseName( txtFullName->text(), NAME_L ) ); 1369 txtLastName->setText( parseName( txtFullName->text(), NAME_L ) );
1370 txtSuffix->setText( parseName( txtFullName->text(), NAME_S ) ); 1370 txtSuffix->setText( parseName( txtFullName->text(), NAME_S ) );
1371 1371
1372 useFullName = FALSE; 1372 useFullName = FALSE;
1373 } 1373 }
1374 1374
1375 /*if ( ent.firstName() != txtFirstName->text() || 1375 /*if ( ent.firstName() != txtFirstName->text() ||
1376 ent.lastName != txtLastName->text() || 1376 ent.lastName != txtLastName->text() ||
1377 ent.middleName != txtMiddleName->text() ) { 1377 ent.middleName != txtMiddleName->text() ) {
1378 */ 1378 */
1379 ent.setFirstName( txtFirstName->text() ); 1379 ent.setFirstName( txtFirstName->text() );
1380 ent.setLastName( txtLastName->text() ); 1380 ent.setLastName( txtLastName->text() );
1381 ent.setMiddleName( txtMiddleName->text() ); 1381 ent.setMiddleName( txtMiddleName->text() );
1382 ent.setSuffix( txtSuffix->text() );
1382 1383
1383 //} 1384 //}
1384 1385
1385 ent.setFileAs( cmbFileAs->currentText() ); 1386 ent.setFileAs( cmbFileAs->currentText() );
1386 1387
1387 ent.setCategories( cmbCat->currentCategories() ); 1388 ent.setCategories( cmbCat->currentCategories() );
1388 1389
1389 if (hasTitle) 1390 if (hasTitle)
1390 ent.setJobTitle( txtJobTitle->text() ); 1391 ent.setJobTitle( txtJobTitle->text() );
1391 1392
1392 if (hasCompany) 1393 if (hasCompany)
1393 ent.setCompany( txtOrganization->text() ); 1394 ent.setCompany( txtOrganization->text() );
1394 1395
1395 if (hasNotes) 1396 if (hasNotes)
1396 ent.setNotes( txtNote->text() ); 1397 ent.setNotes( txtNote->text() );
1397 1398
1398 if (hasStreet) { 1399 if (hasStreet) {
1399 ent.setHomeStreet( (*slHomeAddress)[0] ); 1400 ent.setHomeStreet( (*slHomeAddress)[0] );
1400 ent.setBusinessStreet( (*slBusinessAddress)[0] ); 1401 ent.setBusinessStreet( (*slBusinessAddress)[0] );
1401 } 1402 }
1402/* 1403/*
1403 if (hasStreet2) { 1404 if (hasStreet2) {
1404 ent.setHomeStreet2( (*slHomeAddress)[1] ); 1405 ent.setHomeStreet2( (*slHomeAddress)[1] );
1405 ent.setBusinessStreet2( (*slBusinessAddress)[1] ); 1406 ent.setBusinessStreet2( (*slBusinessAddress)[1] );
1406 } 1407 }
1407 1408
1408 if (hasPOBox) { 1409 if (hasPOBox) {
1409 ent.setHomePOBox( (*slHomeAddress)[2] ); 1410 ent.setHomePOBox( (*slHomeAddress)[2] );
1410 ent.setBusinessPOBox( (*slBusinessAddress)[2] ); 1411 ent.setBusinessPOBox( (*slBusinessAddress)[2] );
1411 } 1412 }
1412*/ 1413*/
1413 if (hasCity) { 1414 if (hasCity) {
1414 ent.setHomeCity( (*slHomeAddress)[3] ); 1415 ent.setHomeCity( (*slHomeAddress)[3] );
1415 ent.setBusinessCity( (*slBusinessAddress)[3] ); 1416 ent.setBusinessCity( (*slBusinessAddress)[3] );
1416 } 1417 }
1417 1418
1418 if (hasState) { 1419 if (hasState) {
1419 ent.setHomeState( (*slHomeAddress)[4] ); 1420 ent.setHomeState( (*slHomeAddress)[4] );
1420 ent.setBusinessState( (*slBusinessAddress)[4] ); 1421 ent.setBusinessState( (*slBusinessAddress)[4] );
1421 } 1422 }
1422 1423
1423 if (hasZip) { 1424 if (hasZip) {
1424 ent.setHomeZip( (*slHomeAddress)[5] ); 1425 ent.setHomeZip( (*slHomeAddress)[5] );
1425 ent.setBusinessZip( (*slBusinessAddress)[5] ); 1426 ent.setBusinessZip( (*slBusinessAddress)[5] );
1426 } 1427 }
1427 1428
1428 if (hasCountry) { 1429 if (hasCountry) {
1429 ent.setHomeCountry( (*slHomeAddress)[6] ); 1430 ent.setHomeCountry( (*slHomeAddress)[6] );
1430 ent.setBusinessCountry( (*slBusinessAddress)[6] ); 1431 ent.setBusinessCountry( (*slBusinessAddress)[6] );
1431 } 1432 }
1432 1433
1433 QStringList::ConstIterator it; 1434 QStringList::ConstIterator it;
1434 QListIterator<QLineEdit> itLE( listValue ); 1435 QListIterator<QLineEdit> itLE( listValue );
1435 for ( it = slDynamicEntries->begin(); it != slDynamicEntries->end(); ++it, ++itLE) { 1436 for ( it = slDynamicEntries->begin(); it != slDynamicEntries->end(); ++it, ++itLE) {
1436 if ( *it == "Department" ) 1437 if ( *it == "Department" )
1437 ent.setDepartment( (*itLE)->text() ); 1438 ent.setDepartment( (*itLE)->text() );
1438 1439
1439 if ( *it == "Company" ) 1440 if ( *it == "Company" )
1440 ent.setCompany( (*itLE)->text() ); 1441 ent.setCompany( (*itLE)->text() );
1441 1442
1442 if ( *it == "Office" ) 1443 if ( *it == "Office" )
1443 ent.setOffice( (*itLE)->text() ); 1444 ent.setOffice( (*itLE)->text() );
1444 1445
1445 if ( *it == "Profession" ) 1446 if ( *it == "Profession" )
1446 ent.setProfession( (*itLE)->text() ); 1447 ent.setProfession( (*itLE)->text() );
1447 1448
1448 if ( *it == "Assistant" ) 1449 if ( *it == "Assistant" )
1449 ent.setAssistant( (*itLE)->text() ); 1450 ent.setAssistant( (*itLE)->text() );
1450 1451
1451 if ( *it == "Manager" ) 1452 if ( *it == "Manager" )
1452 ent.setManager( (*itLE)->text() ); 1453 ent.setManager( (*itLE)->text() );
1453 1454
1454 if ( *it == "Spouse" ) 1455 if ( *it == "Spouse" )
1455 ent.setSpouse( (*itLE)->text() ); 1456 ent.setSpouse( (*itLE)->text() );
1456 1457
1457 if ( *it == "Birthday" ) 1458 if ( *it == "Birthday" )
1458 ent.setBirthday( (*itLE)->text() ); 1459 ent.setBirthday( (*itLE)->text() );
1459 1460
1460 if ( *it == "Anniversary" ) 1461 if ( *it == "Anniversary" )
1461 ent.setAnniversary( (*itLE)->text() ); 1462 ent.setAnniversary( (*itLE)->text() );
1462 1463
1463 if ( *it == "Nickname" ) 1464 if ( *it == "Nickname" )
1464 ent.setNickname( (*itLE)->text() ); 1465 ent.setNickname( (*itLE)->text() );
1465 1466
1466 if ( *it == "Children" ) 1467 if ( *it == "Children" )
1467 ent.setChildren( (*itLE)->text() ); 1468 ent.setChildren( (*itLE)->text() );
1468 1469
1469 } 1470 }
1470 1471
1471 QStringList::ConstIterator itV; 1472 QStringList::ConstIterator itV;
1472 for ( it = slChooserNames->begin(), itV = slChooserValues->begin(); it != slChooserNames->end(); ++it, ++itV ) { 1473 for ( it = slChooserNames->begin(), itV = slChooserValues->begin(); it != slChooserNames->end(); ++it, ++itV ) {
1473 1474
1474 if ( *it == "Business Phone" || *it == "Work Phone" ) 1475 if ( *it == "Business Phone" || *it == "Work Phone" )
1475 ent.setBusinessPhone( *itV ); 1476 ent.setBusinessPhone( *itV );
1476/* 1477/*
1477 if ( *it == "Business 2 Phone" ) 1478 if ( *it == "Business 2 Phone" )
1478 ent.setBusiness2Phone( *itV ); 1479 ent.setBusiness2Phone( *itV );
1479*/ 1480*/
1480 if ( *it == "Business Fax" || *it == "Work Fax" ) 1481 if ( *it == "Business Fax" || *it == "Work Fax" )
1481 ent.setBusinessFax( *itV ); 1482 ent.setBusinessFax( *itV );
1482 1483
1483 if ( *it == "Business Mobile" || *it == "Work Mobile" ) 1484 if ( *it == "Business Mobile" || *it == "Work Mobile" )
1484 ent.setBusinessMobile( *itV ); 1485 ent.setBusinessMobile( *itV );
1485/* 1486/*
1486 if ( *it == "Company Phone" ) 1487 if ( *it == "Company Phone" )
1487 ent.setCompanyPhone( *itV ); 1488 ent.setCompanyPhone( *itV );
1488*/ 1489*/
1489 //if ( *it == "Default Email" ) 1490 //if ( *it == "Default Email" )
1490 //ent.setDefaultEmail( *itV ); 1491 //ent.setDefaultEmail( *itV );
1491 1492
1492 if ( *it == "Emails" ) { 1493 if ( *it == "Emails" ) {
1493 QString allemail; 1494 QString allemail;
1494 QString defaultmail; 1495 QString defaultmail;
1495 parseEmailFrom( *itV, defaultmail, allemail ); 1496 parseEmailFrom( *itV, defaultmail, allemail );
1496 ent.setDefaultEmail( defaultmail ); 1497 ent.setDefaultEmail( defaultmail );
1497 ent.setEmails( *itV ); 1498 ent.setEmails( *itV );
1498 } 1499 }
1499 1500
1500 if ( *it == "Home Phone" ) 1501 if ( *it == "Home Phone" )
1501 ent.setHomePhone( *itV ); 1502 ent.setHomePhone( *itV );
1502/* 1503/*
1503 if ( *it == "Home 2 Phone" ) 1504 if ( *it == "Home 2 Phone" )
1504 ent.setHome2Phone( *itV ); 1505 ent.setHome2Phone( *itV );
1505*/ 1506*/
1506 if ( *it == "Home Fax" ) 1507 if ( *it == "Home Fax" )
1507 ent.setHomeFax( *itV ); 1508 ent.setHomeFax( *itV );
1508 1509
1509 if ( *it == "Home Mobile" ) 1510 if ( *it == "Home Mobile" )
1510 ent.setHomeMobile( *itV ); 1511 ent.setHomeMobile( *itV );
1511/* 1512/*
1512 if ( *it == "Car Phone" ) 1513 if ( *it == "Car Phone" )
1513 ent.setCarPhone( *itV ); 1514 ent.setCarPhone( *itV );
1514 1515
1515 if ( *it == "ISDN Phone" ) 1516 if ( *it == "ISDN Phone" )
1516 ent.setISDNPhone( *itV ); 1517 ent.setISDNPhone( *itV );
1517 1518
1518 if ( *it == "Other Phone" ) 1519 if ( *it == "Other Phone" )
1519 ent.setOtherPhone( *itV ); 1520 ent.setOtherPhone( *itV );
1520*/ 1521*/
1521 if ( *it == "Business Pager" || *it == "Work Pager" ) 1522 if ( *it == "Business Pager" || *it == "Work Pager" )
1522 ent.setBusinessPager( *itV ); 1523 ent.setBusinessPager( *itV );
1523/* 1524/*
1524 if ( *it == "Home Pager" ) 1525 if ( *it == "Home Pager" )
1525 ent.setHomePager( *itV ); 1526 ent.setHomePager( *itV );
1526 1527
1527 if ( *it == "AIM IM" ) 1528 if ( *it == "AIM IM" )
1528 ent.setAIMIM( *itV ); 1529 ent.setAIMIM( *itV );
1529 1530
1530 if ( *it == "ICQ IM" ) 1531 if ( *it == "ICQ IM" )
1531 ent.setICQIM( *itV ); 1532 ent.setICQIM( *itV );
1532 1533
1533 if ( *it == "Jabber IM" ) 1534 if ( *it == "Jabber IM" )
1534 ent.setJabberIM( *itV ); 1535 ent.setJabberIM( *itV );
1535 1536
1536 if ( *it == "MSN IM" ) 1537 if ( *it == "MSN IM" )
1537 ent.setMSNIM( *itV ); 1538 ent.setMSNIM( *itV );
1538 1539
1539 if ( *it == "Yahoo IM" ) 1540 if ( *it == "Yahoo IM" )
1540 ent.setYahooIM( *itV ); 1541 ent.setYahooIM( *itV );
1541*/ 1542*/
1542 if ( *it == "Home Web Page" ) 1543 if ( *it == "Home Web Page" )
1543 ent.setHomeWebpage( *itV ); 1544 ent.setHomeWebpage( *itV );
1544 if ( *it == "Business Web Page" || *it == "Work Web Page" ) 1545 if ( *it == "Business Web Page" || *it == "Work Web Page" )
1545 ent.setBusinessWebpage( *itV ); 1546 ent.setBusinessWebpage( *itV );
1546 1547
1547 1548
1548 } 1549 }
1549 1550
1550 int gender = cmbGender->currentItem(); 1551 int gender = cmbGender->currentItem();
1551 ent.setGender( QString::number( gender ) ); 1552 ent.setGender( QString::number( gender ) );
1552 1553
1553 QString str = txtNote->text(); 1554 QString str = txtNote->text();
1554 if ( !str.isNull() ) 1555 if ( !str.isNull() )
1555 ent.setNotes( str ); 1556 ent.setNotes( str );
1556 1557
1557} 1558}
1558 1559
1559void parseEmailFrom( const QString &txt, QString &strDefaultEmail, 1560void parseEmailFrom( const QString &txt, QString &strDefaultEmail,
1560 QString &strAll ) 1561 QString &strAll )
1561{ 1562{
1562 int where, 1563 int where,
1563 start; 1564 start;
1564 if ( txt.isEmpty() ) 1565 if ( txt.isEmpty() )
1565 return; 1566 return;
1566 // find the first 1567 // find the first
1567 where = txt.find( ',' ); 1568 where = txt.find( ',' );
1568 if ( where < 0 ) { 1569 if ( where < 0 ) {
1569 strDefaultEmail = txt; 1570 strDefaultEmail = txt;
1570 strAll = txt; 1571 strAll = txt;
1571 } else { 1572 } else {
1572 strDefaultEmail = txt.left( where ).stripWhiteSpace(); 1573 strDefaultEmail = txt.left( where ).stripWhiteSpace();
1573 strAll = strDefaultEmail; 1574 strAll = strDefaultEmail;
1574 while ( where > -1 ) { 1575 while ( where > -1 ) {
1575 strAll.append(" "); 1576 strAll.append(" ");
1576 start = where; 1577 start = where;
1577 where = txt.find( ',', where + 1 ); 1578 where = txt.find( ',', where + 1 );
1578 if ( where > - 1 ) 1579 if ( where > - 1 )
1579 strAll.append( txt.mid(start + 1, where - start - 1).stripWhiteSpace() ); 1580 strAll.append( txt.mid(start + 1, where - start - 1).stripWhiteSpace() );
1580 else // grab until the end... 1581 else // grab until the end...
1581 strAll.append( txt.right(txt.length() - start - 1).stripWhiteSpace() ); 1582 strAll.append( txt.right(txt.length() - start - 1).stripWhiteSpace() );
1582 } 1583 }
1583 } 1584 }
1584} 1585}
1585 1586
1586void parseEmailTo( const QString &strDefaultEmail, 1587void parseEmailTo( const QString &strDefaultEmail,
1587 const QString &strOtherEmail, QString &strBack ) 1588 const QString &strOtherEmail, QString &strBack )
1588{ 1589{
1589 // create a comma dilimeted set of emails... 1590 // create a comma dilimeted set of emails...
1590 // use the power of short circuiting... 1591 // use the power of short circuiting...
1591 bool foundDefault = false; 1592 bool foundDefault = false;
1592 QString strTmp; 1593 QString strTmp;
1593 int start = 0; 1594 int start = 0;
1594 int where; 1595 int where;
1595 // start at the beginng. 1596 // start at the beginng.
1596 strBack = strDefaultEmail; 1597 strBack = strDefaultEmail;
1597 where = 0; 1598 where = 0;
1598 while ( where > -1 ) { 1599 while ( where > -1 ) {
1599 start = where; 1600 start = where;
1600 where = strOtherEmail.find( ' ', where + 1 ); 1601 where = strOtherEmail.find( ' ', where + 1 );
1601 if ( where > 0 ) { 1602 if ( where > 0 ) {
1602 strTmp = strOtherEmail.mid( start, where - start ).stripWhiteSpace(); 1603 strTmp = strOtherEmail.mid( start, where - start ).stripWhiteSpace();
1603 } else 1604 } else
1604 strTmp = strOtherEmail.right( strOtherEmail.length() - start ).stripWhiteSpace(); 1605 strTmp = strOtherEmail.right( strOtherEmail.length() - start ).stripWhiteSpace();
1605 if ( foundDefault || strTmp != strDefaultEmail ) { 1606 if ( foundDefault || strTmp != strDefaultEmail ) {
1606 strBack.append( ", " ); 1607 strBack.append( ", " );
1607 strBack.append( strTmp ); 1608 strBack.append( strTmp );
1608 } else 1609 } else
1609 foundDefault = true; 1610 foundDefault = true;
1610 } 1611 }
1611} 1612}
1612 1613
1613 1614
1614static inline bool containsAlphaNum( const QString &str ) 1615static inline bool containsAlphaNum( const QString &str )
1615{ 1616{
1616 int i, 1617 int i,
1617 count = str.length(); 1618 count = str.length();
1618 for ( i = 0; i < count; i++ ) 1619 for ( i = 0; i < count; i++ )
1619 if ( !str[i].isSpace() ) 1620 if ( !str[i].isSpace() )
1620 return TRUE; 1621 return TRUE;
1621 return FALSE; 1622 return FALSE;
1622} 1623}
1623 1624
1624static inline bool constainsWhiteSpace( const QString &str ) 1625static inline bool constainsWhiteSpace( const QString &str )
1625{ 1626{
1626 int i, 1627 int i,
1627 count = str.length(); 1628 count = str.length();
1628 for (i = 0; i < count; i++ ) 1629 for (i = 0; i < count; i++ )
1629 if ( str[i].isSpace() ) 1630 if ( str[i].isSpace() )
1630 return TRUE; 1631 return TRUE;
1631 return FALSE; 1632 return FALSE;
1632} 1633}
1633 1634