author | zautrix <zautrix> | 2004-09-22 03:08:05 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-22 03:08:05 (UTC) |
commit | d63eac7a612a9724705bc58ad98c65c6ac052d07 (patch) (unidiff) | |
tree | dc584a0ddcbd5f828ea36b86b6af640e46e137f2 /libkdepim/kcmconfigs | |
parent | 633522024e48efc423155a04b71083a03696211d (diff) | |
download | kdepimpi-d63eac7a612a9724705bc58ad98c65c6ac052d07.zip kdepimpi-d63eac7a612a9724705bc58ad98c65c6ac052d07.tar.gz kdepimpi-d63eac7a612a9724705bc58ad98c65c6ac052d07.tar.bz2 |
connected global config
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp index 00a07d9..2819ab1 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp | |||
@@ -363,409 +363,409 @@ void KDEPIMConfigWidget::externalapp_changed( int newApp ) | |||
363 | 363 | ||
364 | // set mCurrentClient | 364 | // set mCurrentClient |
365 | switch(mCurrentApp) | 365 | switch(mCurrentApp) |
366 | { | 366 | { |
367 | case(ExternalAppHandler::EMAIL): | 367 | case(ExternalAppHandler::EMAIL): |
368 | mCurrentClient = mEmailClient; | 368 | mCurrentClient = mEmailClient; |
369 | break; | 369 | break; |
370 | case(ExternalAppHandler::PHONE): | 370 | case(ExternalAppHandler::PHONE): |
371 | mCurrentClient = mPhoneClient; | 371 | mCurrentClient = mPhoneClient; |
372 | break; | 372 | break; |
373 | case(ExternalAppHandler::SMS): | 373 | case(ExternalAppHandler::SMS): |
374 | mCurrentClient = mSMSClient; | 374 | mCurrentClient = mSMSClient; |
375 | break; | 375 | break; |
376 | case(ExternalAppHandler::FAX): | 376 | case(ExternalAppHandler::FAX): |
377 | mCurrentClient = mFaxClient; | 377 | mCurrentClient = mFaxClient; |
378 | break; | 378 | break; |
379 | case(ExternalAppHandler::PAGER): | 379 | case(ExternalAppHandler::PAGER): |
380 | mCurrentClient = mPagerClient; | 380 | mCurrentClient = mPagerClient; |
381 | break; | 381 | break; |
382 | case(ExternalAppHandler::SIP): | 382 | case(ExternalAppHandler::SIP): |
383 | mCurrentClient = mSipClient; | 383 | mCurrentClient = mSipClient; |
384 | break; | 384 | break; |
385 | default: | 385 | default: |
386 | return; | 386 | return; |
387 | } | 387 | } |
388 | 388 | ||
389 | // and at last update the widgets | 389 | // and at last update the widgets |
390 | updateClientWidgets(); | 390 | updateClientWidgets(); |
391 | } | 391 | } |
392 | 392 | ||
393 | 393 | ||
394 | 394 | ||
395 | void KDEPIMConfigWidget::client_changed( int newClient ) | 395 | void KDEPIMConfigWidget::client_changed( int newClient ) |
396 | { | 396 | { |
397 | if (newClient == mCurrentClient) | 397 | if (newClient == mCurrentClient) |
398 | return; | 398 | return; |
399 | 399 | ||
400 | // first store the current data | 400 | // first store the current data |
401 | saveEditFieldSettings(); | 401 | saveEditFieldSettings(); |
402 | 402 | ||
403 | 403 | ||
404 | //then reset the clientvariable | 404 | //then reset the clientvariable |
405 | mCurrentClient = newClient; | 405 | mCurrentClient = newClient; |
406 | 406 | ||
407 | // and at last update the widgets | 407 | // and at last update the widgets |
408 | updateClientWidgets(); | 408 | updateClientWidgets(); |
409 | 409 | ||
410 | KPrefsWidget::modified(); | 410 | KPrefsWidget::modified(); |
411 | } | 411 | } |
412 | 412 | ||
413 | void KDEPIMConfigWidget::saveEditFieldSettings() | 413 | void KDEPIMConfigWidget::saveEditFieldSettings() |
414 | { | 414 | { |
415 | 415 | ||
416 | switch(mCurrentApp) | 416 | switch(mCurrentApp) |
417 | { | 417 | { |
418 | case(ExternalAppHandler::EMAIL): | 418 | case(ExternalAppHandler::EMAIL): |
419 | mEmailClient = mClient->currentItem(); | 419 | mEmailClient = mClient->currentItem(); |
420 | break; | 420 | break; |
421 | case(ExternalAppHandler::PHONE): | 421 | case(ExternalAppHandler::PHONE): |
422 | mPhoneClient= mClient->currentItem(); | 422 | mPhoneClient= mClient->currentItem(); |
423 | break; | 423 | break; |
424 | case(ExternalAppHandler::SMS): | 424 | case(ExternalAppHandler::SMS): |
425 | mSMSClient = mClient->currentItem(); | 425 | mSMSClient = mClient->currentItem(); |
426 | break; | 426 | break; |
427 | case(ExternalAppHandler::FAX): | 427 | case(ExternalAppHandler::FAX): |
428 | mFaxClient = mClient->currentItem(); | 428 | mFaxClient = mClient->currentItem(); |
429 | break; | 429 | break; |
430 | case(ExternalAppHandler::PAGER): | 430 | case(ExternalAppHandler::PAGER): |
431 | mPagerClient = mClient->currentItem(); | 431 | mPagerClient = mClient->currentItem(); |
432 | break; | 432 | break; |
433 | case(ExternalAppHandler::SIP): | 433 | case(ExternalAppHandler::SIP): |
434 | mSipClient = mClient->currentItem(); | 434 | mSipClient = mClient->currentItem(); |
435 | break; | 435 | break; |
436 | default: | 436 | default: |
437 | return; | 437 | return; |
438 | } | 438 | } |
439 | 439 | ||
440 | //store the current data back to the apropriate membervariables if we had set it to "other" | 440 | //store the current data back to the apropriate membervariables if we had set it to "other" |
441 | if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) | 441 | if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) |
442 | { | 442 | { |
443 | mEmailOtherChannel = mChannel->text(); | 443 | mEmailOtherChannel = mChannel->text(); |
444 | mEmailOtherMessage = mMessage->text(); | 444 | mEmailOtherMessage = mMessage->text(); |
445 | mEmailOtherMessageParameters = mParameters->text(); | 445 | mEmailOtherMessageParameters = mParameters->text(); |
446 | mEmailOtherMessage2 = mMessage2->text(); | 446 | mEmailOtherMessage2 = mMessage2->text(); |
447 | mEmailOtherMessageParameters2 = mParameters2->text(); | 447 | mEmailOtherMessageParameters2 = mParameters2->text(); |
448 | } | 448 | } |
449 | else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) | 449 | else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) |
450 | { | 450 | { |
451 | mPhoneOtherChannel = mChannel->text(); | 451 | mPhoneOtherChannel = mChannel->text(); |
452 | mPhoneOtherMessage = mMessage->text(); | 452 | mPhoneOtherMessage = mMessage->text(); |
453 | mPhoneOtherMessageParameters = mParameters->text(); | 453 | mPhoneOtherMessageParameters = mParameters->text(); |
454 | } | 454 | } |
455 | else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) | 455 | else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) |
456 | { | 456 | { |
457 | mSMSOtherChannel = mChannel->text(); | 457 | mSMSOtherChannel = mChannel->text(); |
458 | mSMSOtherMessage = mMessage->text(); | 458 | mSMSOtherMessage = mMessage->text(); |
459 | mSMSOtherMessageParameters = mParameters->text(); | 459 | mSMSOtherMessageParameters = mParameters->text(); |
460 | } | 460 | } |
461 | else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) | 461 | else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) |
462 | { | 462 | { |
463 | mFaxOtherChannel = mChannel->text(); | 463 | mFaxOtherChannel = mChannel->text(); |
464 | mFaxOtherMessage = mMessage->text(); | 464 | mFaxOtherMessage = mMessage->text(); |
465 | mFaxOtherMessageParameters = mParameters->text(); | 465 | mFaxOtherMessageParameters = mParameters->text(); |
466 | } | 466 | } |
467 | else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) | 467 | else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) |
468 | { | 468 | { |
469 | mPagerOtherChannel = mChannel->text(); | 469 | mPagerOtherChannel = mChannel->text(); |
470 | mPagerOtherMessage = mMessage->text(); | 470 | mPagerOtherMessage = mMessage->text(); |
471 | mPagerOtherMessageParameters = mParameters->text(); | 471 | mPagerOtherMessageParameters = mParameters->text(); |
472 | } | 472 | } |
473 | else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) | 473 | else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) |
474 | { | 474 | { |
475 | mSipOtherChannel = mChannel->text(); | 475 | mSipOtherChannel = mChannel->text(); |
476 | mSipOtherMessage = mMessage->text(); | 476 | mSipOtherMessage = mMessage->text(); |
477 | mSipOtherMessageParameters = mParameters->text(); | 477 | mSipOtherMessageParameters = mParameters->text(); |
478 | } | 478 | } |
479 | 479 | ||
480 | 480 | ||
481 | } | 481 | } |
482 | 482 | ||
483 | void KDEPIMConfigWidget::updateClientWidgets() | 483 | void KDEPIMConfigWidget::updateClientWidgets() |
484 | { | 484 | { |
485 | bool blocked = signalsBlocked(); | 485 | bool blocked = signalsBlocked(); |
486 | blockSignals( true ); | 486 | blockSignals( true ); |
487 | 487 | ||
488 | // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display | 488 | // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display |
489 | QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp ); | 489 | QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp ); |
490 | if (it == mExternalAppsMap.end()) | 490 | if (it == mExternalAppsMap.end()) |
491 | return; | 491 | return; |
492 | 492 | ||
493 | // update group box | 493 | // update group box |
494 | mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data())); | 494 | mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data())); |
495 | 495 | ||
496 | //update the entries in the client combobox | 496 | //update the entries in the client combobox |
497 | mClient->clear(); | 497 | mClient->clear(); |
498 | 498 | ||
499 | QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp); | 499 | QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp); |
500 | DefaultAppItem* dai; | 500 | DefaultAppItem* dai; |
501 | for ( dai=items.first(); dai != 0; dai=items.next() ) | 501 | for ( dai=items.first(); dai != 0; dai=items.next() ) |
502 | { | 502 | { |
503 | mClient->insertItem( i18n(dai->_label), dai->_id ); | 503 | mClient->insertItem( i18n(dai->_label), dai->_id ); |
504 | 504 | ||
505 | if (dai->_id == mCurrentClient) | 505 | if (dai->_id == mCurrentClient) |
506 | { | 506 | { |
507 | //restore the edit fields with the data of the local membervariables if we had set it to "other". | 507 | //restore the edit fields with the data of the local membervariables if we had set it to "other". |
508 | //Otherwise take the default data from externalapphandler. | 508 | //Otherwise take the default data from externalapphandler. |
509 | mChannel->setText(dai->_channel); | 509 | mChannel->setText(dai->_channel); |
510 | mMessage->setText(dai->_message); | 510 | mMessage->setText(dai->_message); |
511 | mParameters->setText(dai->_parameters); | 511 | mParameters->setText(dai->_parameters); |
512 | mMessage2->setText(dai->_message2); | 512 | mMessage2->setText(dai->_message2); |
513 | mParameters2->setText(dai->_parameters2); | 513 | mParameters2->setText(dai->_parameters2); |
514 | 514 | ||
515 | 515 | ||
516 | if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) | 516 | if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) |
517 | { | 517 | { |
518 | mChannel->setText(mEmailOtherChannel); | 518 | mChannel->setText(mEmailOtherChannel); |
519 | mMessage->setText(mEmailOtherMessage); | 519 | mMessage->setText(mEmailOtherMessage); |
520 | mParameters->setText(mEmailOtherMessageParameters); | 520 | mParameters->setText(mEmailOtherMessageParameters); |
521 | mMessage2->setText(mEmailOtherMessage2); | 521 | mMessage2->setText(mEmailOtherMessage2); |
522 | mParameters2->setText(mEmailOtherMessageParameters2); | 522 | mParameters2->setText(mEmailOtherMessageParameters2); |
523 | } | 523 | } |
524 | else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) | 524 | else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) |
525 | { | 525 | { |
526 | mChannel->setText(mPhoneOtherChannel); | 526 | mChannel->setText(mPhoneOtherChannel); |
527 | mMessage->setText(mPhoneOtherMessage); | 527 | mMessage->setText(mPhoneOtherMessage); |
528 | mParameters->setText(mPhoneOtherMessageParameters); | 528 | mParameters->setText(mPhoneOtherMessageParameters); |
529 | } | 529 | } |
530 | else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) | 530 | else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) |
531 | { | 531 | { |
532 | mChannel->setText(mSMSOtherChannel); | 532 | mChannel->setText(mSMSOtherChannel); |
533 | mMessage->setText(mSMSOtherMessage); | 533 | mMessage->setText(mSMSOtherMessage); |
534 | mParameters->setText(mSMSOtherMessageParameters); | 534 | mParameters->setText(mSMSOtherMessageParameters); |
535 | } | 535 | } |
536 | else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) | 536 | else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) |
537 | { | 537 | { |
538 | mChannel->setText(mFaxOtherChannel); | 538 | mChannel->setText(mFaxOtherChannel); |
539 | mMessage->setText(mFaxOtherMessage); | 539 | mMessage->setText(mFaxOtherMessage); |
540 | mParameters->setText(mFaxOtherMessageParameters); | 540 | mParameters->setText(mFaxOtherMessageParameters); |
541 | } | 541 | } |
542 | else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) | 542 | else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) |
543 | { | 543 | { |
544 | mChannel->setText(mPagerOtherChannel); | 544 | mChannel->setText(mPagerOtherChannel); |
545 | mMessage->setText(mPagerOtherMessage); | 545 | mMessage->setText(mPagerOtherMessage); |
546 | mParameters->setText(mPagerOtherMessageParameters); | 546 | mParameters->setText(mPagerOtherMessageParameters); |
547 | } | 547 | } |
548 | else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) | 548 | else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) |
549 | { | 549 | { |
550 | mChannel->setText(mSipOtherChannel); | 550 | mChannel->setText(mSipOtherChannel); |
551 | mMessage->setText(mSipOtherMessage); | 551 | mMessage->setText(mSipOtherMessage); |
552 | mParameters->setText(mSipOtherMessageParameters); | 552 | mParameters->setText(mSipOtherMessageParameters); |
553 | } | 553 | } |
554 | } | 554 | } |
555 | 555 | ||
556 | } | 556 | } |
557 | 557 | ||
558 | bool readonly; | 558 | bool readonly; |
559 | bool enabled; | 559 | bool enabled; |
560 | if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) | 560 | if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) |
561 | ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) | 561 | ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) |
562 | ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) | 562 | ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) |
563 | ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) | 563 | ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) |
564 | ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) | 564 | ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) |
565 | ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))) | 565 | ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))) |
566 | { | 566 | { |
567 | readonly = false; | 567 | readonly = false; |
568 | } | 568 | } |
569 | else | 569 | else |
570 | { | 570 | { |
571 | readonly = true; | 571 | readonly = true; |
572 | } | 572 | } |
573 | 573 | ||
574 | if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::NONE_EMC)) | 574 | if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::NONE_EMC)) |
575 | ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::NONE_PHC)) | 575 | ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::NONE_PHC)) |
576 | ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::NONE_SMC)) | 576 | ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::NONE_SMC)) |
577 | ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::NONE_FAC)) | 577 | ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::NONE_FAC)) |
578 | ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::NONE_PAC)) | 578 | ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::NONE_PAC)) |
579 | ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::NONE_SIC))) | 579 | ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::NONE_SIC))) |
580 | { | 580 | { |
581 | enabled = false; | 581 | enabled = false; |
582 | } | 582 | } |
583 | else | 583 | else |
584 | { | 584 | { |
585 | enabled = true; | 585 | enabled = true; |
586 | } | 586 | } |
587 | 587 | ||
588 | 588 | ||
589 | mChannel->setReadOnly(readonly); | 589 | mChannel->setReadOnly(readonly); |
590 | mMessage->setReadOnly(readonly); | 590 | mMessage->setReadOnly(readonly); |
591 | mParameters->setReadOnly(readonly); | 591 | mParameters->setReadOnly(readonly); |
592 | mMessage2->setReadOnly(readonly); | 592 | mMessage2->setReadOnly(readonly); |
593 | mParameters2->setReadOnly(readonly); | 593 | mParameters2->setReadOnly(readonly); |
594 | 594 | ||
595 | mChannel->setEnabled(enabled); | 595 | mChannel->setEnabled(enabled); |
596 | mMessage->setEnabled(enabled); | 596 | mMessage->setEnabled(enabled); |
597 | mParameters->setEnabled(enabled); | 597 | mParameters->setEnabled(enabled); |
598 | mMessage2->setEnabled(enabled); | 598 | mMessage2->setEnabled(enabled); |
599 | mParameters2->setEnabled(enabled); | 599 | mParameters2->setEnabled(enabled); |
600 | 600 | ||
601 | 601 | ||
602 | 602 | ||
603 | mClient->setCurrentItem(mCurrentClient); | 603 | mClient->setCurrentItem(mCurrentClient); |
604 | 604 | ||
605 | 605 | ||
606 | // enable/disable the extra message/parameter field | 606 | // enable/disable the extra message/parameter field |
607 | if (mCurrentApp == ExternalAppHandler::EMAIL) | 607 | if (mCurrentApp == ExternalAppHandler::EMAIL) |
608 | { | 608 | { |
609 | } | 609 | } |
610 | else | 610 | else |
611 | { | 611 | { |
612 | mMessage2->setText( "" ); | 612 | mMessage2->setText( "" ); |
613 | mParameters2->setText( "" ); | 613 | mParameters2->setText( "" ); |
614 | } | 614 | } |
615 | 615 | ||
616 | if (enabled == true) { | 616 | if (enabled == true) { |
617 | mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); | 617 | mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); |
618 | mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); | 618 | mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); |
619 | } | 619 | } |
620 | 620 | ||
621 | 621 | ||
622 | blockSignals( blocked ); | 622 | blockSignals( blocked ); |
623 | 623 | ||
624 | } | 624 | } |
625 | 625 | ||
626 | void KDEPIMConfigWidget::usrReadConfig() | 626 | void KDEPIMConfigWidget::usrReadConfig() |
627 | { | 627 | { |
628 | KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); | 628 | KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); |
629 | 629 | ||
630 | bool blocked = signalsBlocked(); | 630 | bool blocked = signalsBlocked(); |
631 | blockSignals( true ); | 631 | blockSignals( true ); |
632 | 632 | ||
633 | QString dummy = prefs->mUserDateFormatLong; | 633 | QString dummy = prefs->mUserDateFormatLong; |
634 | mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); | 634 | mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); |
635 | dummy = prefs->mUserDateFormatShort; | 635 | dummy = prefs->mUserDateFormatShort; |
636 | mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); | 636 | mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); |
637 | 637 | ||
638 | QDate current ( 2001, 1,1); | 638 | QDate current ( 2001, 1,1); |
639 | mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1)); | 639 | mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1)); |
640 | mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1)); | 640 | mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1)); |
641 | setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId)); | 641 | setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId)); |
642 | 642 | ||
643 | 643 | ||
644 | 644 | ||
645 | 645 | ||
646 | mEmailClient = prefs->mEmailClient; | 646 | mEmailClient = prefs->mEmailClient; |
647 | mEmailOtherChannel = prefs->mEmailOtherChannel; | 647 | mEmailOtherChannel = prefs->mEmailOtherChannel; |
648 | mEmailOtherMessage = prefs->mEmailOtherMessage; | 648 | mEmailOtherMessage = prefs->mEmailOtherMessage; |
649 | mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters; | 649 | mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters; |
650 | mEmailOtherMessage2 = prefs->mEmailOtherMessage2; | 650 | mEmailOtherMessage2 = prefs->mEmailOtherMessage2; |
651 | mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2; | 651 | mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2; |
652 | 652 | ||
653 | mPhoneClient = prefs->mPhoneClient; | 653 | mPhoneClient = prefs->mPhoneClient; |
654 | mPhoneOtherChannel = prefs->mPhoneOtherChannel; | 654 | mPhoneOtherChannel = prefs->mPhoneOtherChannel; |
655 | mPhoneOtherMessage = prefs->mPhoneOtherMessage; | 655 | mPhoneOtherMessage = prefs->mPhoneOtherMessage; |
656 | mPhoneOtherMessageParameters = prefs->mPhoneOtherMessageParameters; | 656 | mPhoneOtherMessageParameters = prefs->mPhoneOtherMessageParameters; |
657 | 657 | ||
658 | mFaxClient = prefs->mFaxClient; | 658 | mFaxClient = prefs->mFaxClient; |
659 | mFaxOtherChannel = prefs->mFaxOtherChannel; | 659 | mFaxOtherChannel = prefs->mFaxOtherChannel; |
660 | mFaxOtherMessage = prefs->mFaxOtherMessage; | 660 | mFaxOtherMessage = prefs->mFaxOtherMessage; |
661 | mFaxOtherMessageParameters = prefs->mFaxOtherMessageParameters; | 661 | mFaxOtherMessageParameters = prefs->mFaxOtherMessageParameters; |
662 | 662 | ||
663 | mSMSClient = prefs->mSMSClient; | 663 | mSMSClient = prefs->mSMSClient; |
664 | mSMSOtherChannel = prefs->mSMSOtherChannel; | 664 | mSMSOtherChannel = prefs->mSMSOtherChannel; |
665 | mSMSOtherMessage = prefs->mSMSOtherMessage; | 665 | mSMSOtherMessage = prefs->mSMSOtherMessage; |
666 | mSMSOtherMessageParameters = prefs->mSMSOtherMessageParameters; | 666 | mSMSOtherMessageParameters = prefs->mSMSOtherMessageParameters; |
667 | 667 | ||
668 | mPagerClient = prefs->mPagerClient; | 668 | mPagerClient = prefs->mPagerClient; |
669 | mPagerOtherChannel = prefs->mPagerOtherChannel; | 669 | mPagerOtherChannel = prefs->mPagerOtherChannel; |
670 | mPagerOtherMessage = prefs->mPagerOtherMessage; | 670 | mPagerOtherMessage = prefs->mPagerOtherMessage; |
671 | mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters; | 671 | mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters; |
672 | 672 | ||
673 | mSipClient = prefs->mPagerClient; | 673 | mSipClient = prefs->mPagerClient; |
674 | mSipOtherChannel = prefs->mSipOtherChannel; | 674 | mSipOtherChannel = prefs->mSipOtherChannel; |
675 | mSipOtherMessage = prefs->mSipOtherMessage; | 675 | mSipOtherMessage = prefs->mSipOtherMessage; |
676 | mSipOtherMessageParameters = prefs->mSipOtherMessageParameters; | 676 | mSipOtherMessageParameters = prefs->mSipOtherMessageParameters; |
677 | 677 | ||
678 | mCurrentApp = ExternalAppHandler::EMAIL; | 678 | mCurrentApp = ExternalAppHandler::EMAIL; |
679 | mCurrentClient = mEmailClient; | 679 | mCurrentClient = mEmailClient; |
680 | 680 | ||
681 | updateClientWidgets(); | 681 | updateClientWidgets(); |
682 | 682 | ||
683 | blockSignals( blocked ); | 683 | blockSignals( blocked ); |
684 | 684 | ||
685 | } | 685 | } |
686 | 686 | ||
687 | void KDEPIMConfigWidget::usrWriteConfig() | 687 | void KDEPIMConfigWidget::usrWriteConfig() |
688 | { | 688 | { |
689 | KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); | 689 | KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); |
690 | 690 | ||
691 | saveEditFieldSettings(); | 691 | saveEditFieldSettings(); |
692 | 692 | ||
693 | 693 | ||
694 | prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); | 694 | prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); |
695 | prefs->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); | 695 | prefs->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); |
696 | 696 | ||
697 | prefs->mTimeZoneId = mTimeZoneCombo->currentText(); | 697 | prefs->mTimeZoneId = mTimeZoneCombo->currentText(); |
698 | QDate date; | 698 | QDate date; |
699 | date = mStartDateSavingEdit->date(); | 699 | date = mStartDateSavingEdit->date(); |
700 | int sub = 0; | 700 | int sub = 0; |
701 | if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) | 701 | if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) |
702 | sub = 1; | 702 | sub = 1; |
703 | prefs->mDaylightsavingStart = date.dayOfYear()-sub; | 703 | prefs->mDaylightsavingStart = date.dayOfYear()-sub; |
704 | date = mEndDateSavingEdit->date(); | 704 | date = mEndDateSavingEdit->date(); |
705 | if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) | 705 | if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) |
706 | sub = 1; | 706 | sub = 1; |
707 | else | 707 | else |
708 | sub = 0; | 708 | sub = 0; |
709 | prefs->mDaylightsavingEnd = date.dayOfYear()-sub; | 709 | prefs->mDaylightsavingEnd = date.dayOfYear()-sub; |
710 | 710 | ||
711 | 711 | ||
712 | prefs->mEmailClient = mEmailClient; | 712 | prefs->mEmailClient = mEmailClient; |
713 | prefs->mEmailOtherChannel = mEmailOtherChannel; | 713 | prefs->mEmailOtherChannel = mEmailOtherChannel; |
714 | prefs->mEmailOtherMessage = mEmailOtherMessage; | 714 | prefs->mEmailOtherMessage = mEmailOtherMessage; |
715 | prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters; | 715 | prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters; |
716 | prefs->mEmailOtherMessage2 = mEmailOtherMessage2; | 716 | prefs->mEmailOtherMessage2 = mEmailOtherMessage2; |
717 | prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2; | 717 | prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2; |
718 | 718 | ||
719 | prefs->mPhoneClient = mPhoneClient; | 719 | prefs->mPhoneClient = mPhoneClient; |
720 | prefs->mPhoneOtherChannel = mPhoneOtherChannel; | 720 | prefs->mPhoneOtherChannel = mPhoneOtherChannel; |
721 | prefs->mPhoneOtherMessage = mPhoneOtherMessage; | 721 | prefs->mPhoneOtherMessage = mPhoneOtherMessage; |
722 | prefs->mPhoneOtherMessageParameters = mPhoneOtherMessageParameters; | 722 | prefs->mPhoneOtherMessageParameters = mPhoneOtherMessageParameters; |
723 | 723 | ||
724 | prefs->mFaxClient = mFaxClient; | 724 | prefs->mFaxClient = mFaxClient; |
725 | prefs->mFaxOtherChannel = mFaxOtherChannel; | 725 | prefs->mFaxOtherChannel = mFaxOtherChannel; |
726 | prefs->mFaxOtherMessage = mFaxOtherMessage; | 726 | prefs->mFaxOtherMessage = mFaxOtherMessage; |
727 | prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters; | 727 | prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters; |
728 | 728 | ||
729 | prefs->mSMSClient = mSMSClient; | 729 | prefs->mSMSClient = mSMSClient; |
730 | prefs->mSMSOtherChannel = mSMSOtherChannel; | 730 | prefs->mSMSOtherChannel = mSMSOtherChannel; |
731 | prefs->mSMSOtherMessage = mSMSOtherMessage; | 731 | prefs->mSMSOtherMessage = mSMSOtherMessage; |
732 | prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters; | 732 | prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters; |
733 | 733 | ||
734 | prefs->mPagerClient = mPagerClient; | 734 | prefs->mPagerClient = mPagerClient; |
735 | prefs->mPagerOtherChannel = mPagerOtherChannel; | 735 | prefs->mPagerOtherChannel = mPagerOtherChannel; |
736 | prefs->mPagerOtherMessage = mPagerOtherMessage; | 736 | prefs->mPagerOtherMessage = mPagerOtherMessage; |
737 | prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters; | 737 | prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters; |
738 | 738 | ||
739 | 739 | ||
740 | prefs->mSipClient = mSipClient; | 740 | prefs->mSipClient = mSipClient; |
741 | prefs->mSipOtherChannel = mSipOtherChannel; | 741 | prefs->mSipOtherChannel = mSipOtherChannel; |
742 | prefs->mSipOtherMessage = mSipOtherMessage; | 742 | prefs->mSipOtherMessage = mSipOtherMessage; |
743 | prefs->mSipOtherMessageParameters = mSipOtherMessageParameters; | 743 | prefs->mSipOtherMessageParameters = mSipOtherMessageParameters; |
744 | 744 | ||
745 | //release the cache that other views can access the changed values instantanious | 745 | //release the cache that other views can access the changed values instantanious |
746 | ExternalAppHandler::instance()->loadConfig(); | 746 | ExternalAppHandler::instance()->loadConfig(); |
747 | 747 | KPimGlobalPrefs::instance()->setGlobalConfig(); | |
748 | } | 748 | } |
749 | 749 | ||
750 | 750 | ||
751 | void KDEPIMConfigWidget::setCombo(QComboBox *combo, const QString & text, | 751 | void KDEPIMConfigWidget::setCombo(QComboBox *combo, const QString & text, |
752 | const QStringList *tags) | 752 | const QStringList *tags) |
753 | { | 753 | { |
754 | if (tags) { | 754 | if (tags) { |
755 | int i = tags->findIndex(text); | 755 | int i = tags->findIndex(text); |
756 | if (i > 0) combo->setCurrentItem(i); | 756 | if (i > 0) combo->setCurrentItem(i); |
757 | } else { | 757 | } else { |
758 | for(int i=0;i<combo->count();++i) { | 758 | for(int i=0;i<combo->count();++i) { |
759 | if (combo->text(i) == text) { | 759 | if (combo->text(i) == text) { |
760 | combo->setCurrentItem(i); | 760 | combo->setCurrentItem(i); |
761 | break; | 761 | break; |
762 | } | 762 | } |
763 | } | 763 | } |
764 | } | 764 | } |
765 | } | 765 | } |
766 | 766 | ||
767 | 767 | ||
768 | void KDEPIMConfigWidget::textChanged( const QString& text ) | 768 | void KDEPIMConfigWidget::textChanged( const QString& text ) |
769 | { | 769 | { |
770 | emit changed( true ); | 770 | emit changed( true ); |
771 | } | 771 | } |