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