summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncprefsdialog.cpp
Unidiff
Diffstat (limited to 'libkdepim/ksyncprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncprefsdialog.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp
index 292cde1..27f7932 100644
--- a/libkdepim/ksyncprefsdialog.cpp
+++ b/libkdepim/ksyncprefsdialog.cpp
@@ -499,353 +499,353 @@ void KSyncPrefsDialog::textChanged( const QString & s )
499 prof->setName( s ); 499 prof->setName( s );
500 mSyncProfileNames[mProfileBox-> currentItem ()] = s; 500 mSyncProfileNames[mProfileBox-> currentItem ()] = s;
501} 501}
502void KSyncPrefsDialog::profileChanged( int item ) 502void KSyncPrefsDialog::profileChanged( int item )
503{ 503{
504 //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() ); 504 //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() );
505 KSyncProfile* prof; 505 KSyncProfile* prof;
506 saveProfile(); 506 saveProfile();
507 readFilter(); 507 readFilter();
508 readResources(); 508 readResources();
509 currentSelection = item; 509 currentSelection = item;
510 prof = mSyncProfiles.at(item) ; 510 prof = mSyncProfiles.at(item) ;
511 511
512 mRemotePw->setText(prof->getRemotePw()); 512 mRemotePw->setText(prof->getRemotePw());
513 mRemoteIP->setText(prof->getRemoteIP()); 513 mRemoteIP->setText(prof->getRemoteIP());
514 mRemotePort->setText(prof->getRemotePort()); 514 mRemotePort->setText(prof->getRemotePort());
515 515
516 mRemotePwAB->setText(prof->getRemotePwAB()); 516 mRemotePwAB->setText(prof->getRemotePwAB());
517 mRemoteIPAB->setText(prof->getRemoteIPAB()); 517 mRemoteIPAB->setText(prof->getRemoteIPAB());
518 mRemotePortAB->setText(prof->getRemotePortAB()); 518 mRemotePortAB->setText(prof->getRemotePortAB());
519 519
520 mRemotePwPWM->setText(prof->getRemotePwPWM()); 520 mRemotePwPWM->setText(prof->getRemotePwPWM());
521 mRemoteIPPWM->setText(prof->getRemoteIPPWM()); 521 mRemoteIPPWM->setText(prof->getRemoteIPPWM());
522 mRemotePortPWM->setText(prof->getRemotePortPWM()); 522 mRemotePortPWM->setText(prof->getRemotePortPWM());
523 523
524 mRemotePrecommand->setText(prof->getPreSyncCommand()); 524 mRemotePrecommand->setText(prof->getPreSyncCommand());
525 mRemotePostcommand->setText(prof->getPostSyncCommand()); 525 mRemotePostcommand->setText(prof->getPostSyncCommand());
526 mLocalTempFile->setText(prof->getLocalTempFile()); 526 mLocalTempFile->setText(prof->getLocalTempFile());
527 mRemoteFile->setText(prof->getRemoteFileName()) ; 527 mRemoteFile->setText(prof->getRemoteFileName()) ;
528 528
529 mRemotePrecommandAB->setText(prof->getPreSyncCommandAB()); 529 mRemotePrecommandAB->setText(prof->getPreSyncCommandAB());
530 mRemotePostcommandAB->setText(prof->getPostSyncCommandAB()); 530 mRemotePostcommandAB->setText(prof->getPostSyncCommandAB());
531 mLocalTempFileAB->setText(prof->getLocalTempFileAB()); 531 mLocalTempFileAB->setText(prof->getLocalTempFileAB());
532 mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ; 532 mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ;
533 533
534 mRemotePrecommandPWM->setText(prof->getPreSyncCommandPWM()); 534 mRemotePrecommandPWM->setText(prof->getPreSyncCommandPWM());
535 mRemotePostcommandPWM->setText(prof->getPostSyncCommandPWM()); 535 mRemotePostcommandPWM->setText(prof->getPostSyncCommandPWM());
536 mLocalTempFilePWM->setText(prof->getLocalTempFilePWM()); 536 mLocalTempFilePWM->setText(prof->getLocalTempFilePWM());
537 mRemoteFilePWM->setText(prof->getRemoteFileNamePWM()) ; 537 mRemoteFilePWM->setText(prof->getRemoteFileNamePWM()) ;
538 538
539 if ( mWriteContactToSIM ) 539 if ( mWriteContactToSIM )
540 mWriteContactToSIM->setChecked( prof->getWriteContactToSIM()); 540 mWriteContactToSIM->setChecked( prof->getWriteContactToSIM());
541 mPhoneDevice->setText(prof->getPhoneDevice()); 541 mPhoneDevice->setText(prof->getPhoneDevice());
542 mPhoneConnection->setText(prof->getPhoneConnection()); 542 mPhoneConnection->setText(prof->getPhoneConnection());
543 mPhoneModel->setText(prof->getPhoneModel()); 543 mPhoneModel->setText(prof->getPhoneModel());
544 544
545 mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync()); 545 mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync());
546 mAskForPreferences->setChecked( prof->getAskForPreferences()); 546 mAskForPreferences->setChecked( prof->getAskForPreferences());
547 mWriteBackExisting->setChecked( prof->getWriteBackExisting() ); 547 mWriteBackExisting->setChecked( prof->getWriteBackExisting() );
548 mWriteBackFile->setChecked( prof->getWriteBackFile()); 548 mWriteBackFile->setChecked( prof->getWriteBackFile());
549 mIncludeInRing->setChecked( prof->getIncludeInRingSync() ); 549 mIncludeInRing->setChecked( prof->getIncludeInRingSync() );
550 mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() ); 550 mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() );
551 mIncludeInRingPWM->setChecked( prof->getIncludeInRingSyncPWM() ); 551 mIncludeInRingPWM->setChecked( prof->getIncludeInRingSyncPWM() );
552 mWriteBackFuture->setChecked( prof->getWriteBackFuture()); 552 mWriteBackFuture->setChecked( prof->getWriteBackFuture());
553 mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() ); 553 mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() );
554 mWriteBackPastWeeks->setValue( prof->getWriteBackPastWeeks() ); 554 mWriteBackPastWeeks->setValue( prof->getWriteBackPastWeeks() );
555 555
556 mFilterInCal->setCurrentItem( mFilterKopi.findIndex(prof->getFilterInCal () ) + 1 ); 556 mFilterInCal->setCurrentItem( mFilterKopi.findIndex(prof->getFilterInCal () ) + 1 );
557 mFilterOutCal->setCurrentItem( mFilterKopi.findIndex(prof->getFilterOutCal () ) + 1 ); 557 mFilterOutCal->setCurrentItem( mFilterKopi.findIndex(prof->getFilterOutCal () ) + 1 );
558 mFilterInAB->setCurrentItem( mFilterKapi.findIndex(prof->getFilterInAB () ) + 1 ); 558 mFilterInAB->setCurrentItem( mFilterKapi.findIndex(prof->getFilterInAB () ) + 1 );
559 mFilterOutAB->setCurrentItem( mFilterKapi.findIndex(prof->getFilterOutAB () ) + 1 ); 559 mFilterOutAB->setCurrentItem( mFilterKapi.findIndex(prof->getFilterOutAB () ) + 1 );
560 560
561 switch ( prof->getSyncPrefs() ) { 561 switch ( prof->getSyncPrefs() ) {
562 case 0: 562 case 0:
563 loc->setChecked( true); 563 loc->setChecked( true);
564 break; 564 break;
565 case 1: 565 case 1:
566 rem->setChecked( true ); 566 rem->setChecked( true );
567 break; 567 break;
568 case 2: 568 case 2:
569 newest->setChecked( true); 569 newest->setChecked( true);
570 break; 570 break;
571 case 3: 571 case 3:
572 ask->setChecked( true); 572 ask->setChecked( true);
573 break; 573 break;
574 case 4: 574 case 4:
575 f_loc->setChecked( true); 575 f_loc->setChecked( true);
576 break; 576 break;
577 case 5: 577 case 5:
578 f_rem->setChecked( true); 578 f_rem->setChecked( true);
579 break; 579 break;
580 case 6: 580 case 6:
581 //both->setChecked( true); 581 //both->setChecked( true);
582 break; 582 break;
583 default: 583 default:
584 break; 584 break;
585 } 585 }
586 mIsLocal->setChecked(prof->getIsLocalFileSync()) ; 586 mIsLocal->setChecked(prof->getIsLocalFileSync()) ;
587 mIsPhone->setChecked(prof->getIsPhoneSync()) ; 587 mIsPhone->setChecked(prof->getIsPhoneSync()) ;
588 mIsPi->setChecked(prof->getIsPiSync()) ; 588 mIsPi->setChecked(prof->getIsPiSync()) ;
589 mIsPiSpecific->setChecked(prof->getIsPiSyncSpec()) ; 589 mIsPiSpecific->setChecked(prof->getIsPiSyncSpec()) ;
590 mIsKapiFileL->setChecked(prof->getIsKapiFile()) ; 590 mIsKapiFileL->setChecked(prof->getIsKapiFile()) ;
591 mIsKapiFileR->setChecked(prof->getIsKapiFile()) ; 591 mIsKapiFileR->setChecked(prof->getIsKapiFile()) ;
592 592
593 593
594 QStringList res = QStringList::split( ":",prof->getResSpecKopi()); 594 QStringList res = QStringList::split( ":",prof->getResSpecKopi());
595 int i; 595 int i= res.count()/2;
596 for ( i = 0;i < res.count(); ++i ) { 596 for ( ;i < res.count(); ++i ) {
597 mResTableKopi->setText( i, 0, res[i] ); 597 mResTableKopi->setText( i, 0, res[i] );
598 } 598 }
599 res = QStringList::split( ":",prof->getResSpecKapi()); 599 res = QStringList::split( ":",prof->getResSpecKapi());
600 for ( i = 0;i < res.count(); ++i ) { 600 for ( i = 0;i < res.count(); ++i ) {
601 mResTableKapi->setText( i, 0, res[i] ); 601 mResTableKapi->setText( i, 0, res[i] );
602 } 602 }
603 mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() &&!prof->getIsPiSync() &&!prof->getIsPiSyncSpec()); 603 mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() &&!prof->getIsPiSync() &&!prof->getIsPiSyncSpec());
604 proGr->setEnabled( item > 2 ); 604 proGr->setEnabled( item > 2 );
605 if ( item < 3 ) { 605 if ( item < 3 ) {
606 localFileWidget->hide(); 606 localFileWidget->hide();
607 remoteFileWidget->hide(); 607 remoteFileWidget->hide();
608 phoneWidget->hide(); 608 phoneWidget->hide();
609 piWidget->hide(); 609 piWidget->hide();
610 610
611 } else 611 } else
612 kindChanged( prof->getIsLocalFileSync() ); 612 kindChanged( prof->getIsLocalFileSync() );
613} 613}
614 614
615void KSyncPrefsDialog::fillSSH() 615void KSyncPrefsDialog::fillSSH()
616{ 616{
617 mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); 617 mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" );
618 mLocalTempFile->setText("/tmp/mycalendar.ics" ); 618 mLocalTempFile->setText("/tmp/mycalendar.ics" );
619 mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" ); 619 mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" );
620 mRemotePrecommandAB->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); 620 mRemotePrecommandAB->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf /tmp/std.vcf" );
621 mLocalTempFileAB->setText("/tmp/std.vcf" ); 621 mLocalTempFileAB->setText("/tmp/std.vcf" );
622 mRemotePostcommandAB->setText("scp /tmp/std.vcf zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf" ); 622 mRemotePostcommandAB->setText("scp /tmp/std.vcf zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf" );
623 mRemotePrecommandPWM->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" ); 623 mRemotePrecommandPWM->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" );
624 mLocalTempFilePWM->setText("/tmp/passwords.pwm" ); 624 mLocalTempFilePWM->setText("/tmp/passwords.pwm" );
625 mRemotePostcommandPWM->setText("scp /tmp/passwords.pwm zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/pwmanager.pwm" ); 625 mRemotePostcommandPWM->setText("scp /tmp/passwords.pwm zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/pwmanager.pwm" );
626} 626}
627void KSyncPrefsDialog::fillFTP() 627void KSyncPrefsDialog::fillFTP()
628{ 628{
629 mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" ); 629 mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" );
630 mLocalTempFile->setText("/tmp/mycalendar.ics" ); 630 mLocalTempFile->setText("/tmp/mycalendar.ics" );
631 mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); 631 mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" );
632 mRemotePrecommandAB->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf" ); 632 mRemotePrecommandAB->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf" );
633 mLocalTempFileAB->setText("/tmp/std.vcf" ); 633 mLocalTempFileAB->setText("/tmp/std.vcf" );
634 mRemotePostcommandAB->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); 634 mRemotePostcommandAB->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf /tmp/std.vcf" );
635 635
636 mRemotePrecommandPWM->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm" ); 636 mRemotePrecommandPWM->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm" );
637 mLocalTempFilePWM->setText("/tmp/passwords.pwm" ); 637 mLocalTempFilePWM->setText("/tmp/passwords.pwm" );
638 mRemotePostcommandPWM->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" ); 638 mRemotePostcommandPWM->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" );
639 639
640} 640}
641void KSyncPrefsDialog::kindChanged( bool b ) 641void KSyncPrefsDialog::kindChanged( bool b )
642{ 642{
643 643
644 if ( mIsLocal->isChecked () ) { 644 if ( mIsLocal->isChecked () ) {
645 mIsKapiFileL->setChecked( mIsKapiFileR->isChecked() ); 645 mIsKapiFileL->setChecked( mIsKapiFileR->isChecked() );
646 } else { 646 } else {
647 mIsKapiFileR->setChecked( mIsKapiFileL->isChecked() ); 647 mIsKapiFileR->setChecked( mIsKapiFileL->isChecked() );
648 } 648 }
649 649
650 if ( mIsLocal->isChecked () ) 650 if ( mIsLocal->isChecked () )
651 localFileWidget->show(); 651 localFileWidget->show();
652 else 652 else
653 localFileWidget->hide(); 653 localFileWidget->hide();
654 654
655 if ( mIsNotLocal->isChecked () ) 655 if ( mIsNotLocal->isChecked () )
656 remoteFileWidget->show(); 656 remoteFileWidget->show();
657 else 657 else
658 remoteFileWidget->hide(); 658 remoteFileWidget->hide();
659 659
660 if ( mIsPhone->isChecked () ) { 660 if ( mIsPhone->isChecked () ) {
661 phoneWidget->show(); 661 phoneWidget->show();
662 } 662 }
663 else { 663 else {
664 phoneWidget->hide(); 664 phoneWidget->hide();
665 } 665 }
666 666
667 if ( mIsPi->isChecked () || mIsPiSpecific->isChecked () ) { 667 if ( mIsPi->isChecked () || mIsPiSpecific->isChecked () ) {
668 piWidget->show(); 668 piWidget->show();
669 if (mIsPiSpecific->isChecked () ) { 669 if (mIsPiSpecific->isChecked () ) {
670 mTableBox->show(); 670 mTableBox->show();
671 } 671 }
672 else { 672 else {
673 mTableBox->hide(); 673 mTableBox->hide();
674 } 674 }
675 } 675 }
676 else { 676 else {
677 piWidget->hide(); 677 piWidget->hide();
678 } 678 }
679 679
680 680
681} 681}
682void KSyncPrefsDialog::deleteProfile() 682void KSyncPrefsDialog::deleteProfile()
683{ 683{
684 //qDebug("KSyncPrefsDialog::deleteProfile() "); 684 //qDebug("KSyncPrefsDialog::deleteProfile() ");
685 if ( currentSelection >= 0 ) { 685 if ( currentSelection >= 0 ) {
686 if ( currentSelection < 3 ) { 686 if ( currentSelection < 3 ) {
687 KMessageBox::error(this,i18n("This profil cannot be deleted!\n"),i18n("KO/Pi config error")); 687 KMessageBox::error(this,i18n("This profil cannot be deleted!\n"),i18n("KO/Pi config error"));
688 return; 688 return;
689 } 689 }
690 KSyncProfile* temp = mSyncProfiles.at(currentSelection); 690 KSyncProfile* temp = mSyncProfiles.at(currentSelection);
691 mSyncProfiles.remove( temp ); 691 mSyncProfiles.remove( temp );
692 mSyncProfileNames.remove( mSyncProfileNames.at( currentSelection )); 692 mSyncProfileNames.remove( mSyncProfileNames.at( currentSelection ));
693 insertProfiles(); 693 insertProfiles();
694 } 694 }
695} 695}
696 696
697void KSyncPrefsDialog::saveProfile() 697void KSyncPrefsDialog::saveProfile()
698{ 698{
699 KSyncProfile* prof; 699 KSyncProfile* prof;
700 if ( currentSelection >= 0 ) { 700 if ( currentSelection >= 0 ) {
701 prof = mSyncProfiles.at(currentSelection) ; 701 prof = mSyncProfiles.at(currentSelection) ;
702 702
703 prof->setRemotePw( mRemotePw->text()); 703 prof->setRemotePw( mRemotePw->text());
704 prof->setRemoteIP( mRemoteIP->text()); 704 prof->setRemoteIP( mRemoteIP->text());
705 prof->setRemotePort( mRemotePort->text()); 705 prof->setRemotePort( mRemotePort->text());
706 706
707 prof->setRemotePwAB( mRemotePwAB->text()); 707 prof->setRemotePwAB( mRemotePwAB->text());
708 prof->setRemoteIPAB( mRemoteIPAB->text()); 708 prof->setRemoteIPAB( mRemoteIPAB->text());
709 prof->setRemotePortAB( mRemotePortAB->text()); 709 prof->setRemotePortAB( mRemotePortAB->text());
710 710
711 prof->setRemotePwPWM( mRemotePwPWM->text()); 711 prof->setRemotePwPWM( mRemotePwPWM->text());
712 prof->setRemoteIPPWM( mRemoteIPPWM->text()); 712 prof->setRemoteIPPWM( mRemoteIPPWM->text());
713 prof->setRemotePortPWM( mRemotePortPWM->text()); 713 prof->setRemotePortPWM( mRemotePortPWM->text());
714 714
715 prof->setPreSyncCommand( mRemotePrecommand->text()); 715 prof->setPreSyncCommand( mRemotePrecommand->text());
716 prof->setPostSyncCommand( mRemotePostcommand->text() ); 716 prof->setPostSyncCommand( mRemotePostcommand->text() );
717 prof->setLocalTempFile( mLocalTempFile->text()); 717 prof->setLocalTempFile( mLocalTempFile->text());
718 prof->setRemoteFileName( mRemoteFile->text() ); 718 prof->setRemoteFileName( mRemoteFile->text() );
719 prof->setPreSyncCommandAB( mRemotePrecommandAB->text()); 719 prof->setPreSyncCommandAB( mRemotePrecommandAB->text());
720 prof->setPostSyncCommandAB( mRemotePostcommandAB->text() ); 720 prof->setPostSyncCommandAB( mRemotePostcommandAB->text() );
721 prof->setLocalTempFileAB( mLocalTempFileAB->text()); 721 prof->setLocalTempFileAB( mLocalTempFileAB->text());
722 prof->setRemoteFileNameAB( mRemoteFileAB->text() ); 722 prof->setRemoteFileNameAB( mRemoteFileAB->text() );
723 prof->setPreSyncCommandPWM( mRemotePrecommandPWM->text()); 723 prof->setPreSyncCommandPWM( mRemotePrecommandPWM->text());
724 prof->setPostSyncCommandPWM( mRemotePostcommandPWM->text() ); 724 prof->setPostSyncCommandPWM( mRemotePostcommandPWM->text() );
725 prof->setLocalTempFilePWM( mLocalTempFilePWM->text()); 725 prof->setLocalTempFilePWM( mLocalTempFilePWM->text());
726 prof->setRemoteFileNamePWM( mRemoteFilePWM->text() ); 726 prof->setRemoteFileNamePWM( mRemoteFilePWM->text() );
727 prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() ); 727 prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() );
728 prof->setAskForPreferences( mAskForPreferences->isChecked()); 728 prof->setAskForPreferences( mAskForPreferences->isChecked());
729 prof->setWriteBackExisting(mWriteBackExisting->isChecked() ); 729 prof->setWriteBackExisting(mWriteBackExisting->isChecked() );
730 prof->setWriteBackFile( mWriteBackFile->isChecked()); 730 prof->setWriteBackFile( mWriteBackFile->isChecked());
731 prof->setIncludeInRingSync( mIncludeInRing->isChecked() ); 731 prof->setIncludeInRingSync( mIncludeInRing->isChecked() );
732 prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() ); 732 prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() );
733 prof->setIncludeInRingSyncPWM( mIncludeInRingPWM->isChecked() ); 733 prof->setIncludeInRingSyncPWM( mIncludeInRingPWM->isChecked() );
734 int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ; 734 int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ;
735 prof->setSyncPrefs( syncprefs); 735 prof->setSyncPrefs( syncprefs);
736 prof->setIsLocalFileSync( mIsLocal->isChecked() ); 736 prof->setIsLocalFileSync( mIsLocal->isChecked() );
737 prof->setIsPhoneSync( mIsPhone->isChecked() ); 737 prof->setIsPhoneSync( mIsPhone->isChecked() );
738 prof->setIsPiSync( mIsPi->isChecked() ); 738 prof->setIsPiSync( mIsPi->isChecked() );
739 prof->setIsPiSyncSpec( mIsPiSpecific->isChecked() ); 739 prof->setIsPiSyncSpec( mIsPiSpecific->isChecked() );
740 prof->setIsKapiFile( mIsKapiFileL->isChecked() ); 740 prof->setIsKapiFile( mIsKapiFileL->isChecked() );
741 prof->setWriteBackFuture(mWriteBackFuture->isChecked()); 741 prof->setWriteBackFuture(mWriteBackFuture->isChecked());
742 prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value()); 742 prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value());
743 prof->setWriteBackPastWeeks(mWriteBackPastWeeks->value()); 743 prof->setWriteBackPastWeeks(mWriteBackPastWeeks->value());
744 if ( mWriteContactToSIM ) 744 if ( mWriteContactToSIM )
745 prof->setWriteContactToSIM(mWriteContactToSIM->isChecked()); 745 prof->setWriteContactToSIM(mWriteContactToSIM->isChecked());
746 prof->setPhoneDevice( mPhoneDevice->text() ); 746 prof->setPhoneDevice( mPhoneDevice->text() );
747 prof->setPhoneConnection( mPhoneConnection->text() ); 747 prof->setPhoneConnection( mPhoneConnection->text() );
748 prof->setPhoneModel( mPhoneModel->text() ); 748 prof->setPhoneModel( mPhoneModel->text() );
749 prof->setFilterInCal ( mFilterInCal->currentText ()); 749 prof->setFilterInCal ( mFilterInCal->currentText ());
750 prof->setFilterOutCal ( mFilterOutCal ->currentText ()); 750 prof->setFilterOutCal ( mFilterOutCal ->currentText ());
751 prof->setFilterInAB ( mFilterInAB ->currentText ()); 751 prof->setFilterInAB ( mFilterInAB ->currentText ());
752 prof->setFilterOutAB ( mFilterOutAB ->currentText ()); 752 prof->setFilterOutAB ( mFilterOutAB ->currentText ());
753 if ( mIsPiSpecific->isChecked() ) { 753 if ( mIsPiSpecific->isChecked() ) {
754 754
755 QStringList res; 755 QStringList res = mResourcesKopi;
756 int i; 756 int i;
757 for ( i = 0;i < mResourcesKopi.count(); ++i ) { 757 for ( i = 0;i < mResourcesKopi.count(); ++i ) {
758 res.append( mResTableKopi->text( i, 0 )); 758 res.append( mResTableKopi->text( i, 0 ));
759 } 759 }
760 prof->setResSpecKopi( res.join(":")); 760 prof->setResSpecKopi( res.join(":"));
761 } 761 }
762 } 762 }
763} 763}
764 764
765void KSyncPrefsDialog::insertProfiles() 765void KSyncPrefsDialog::insertProfiles()
766{ 766{
767 int curItem = mProfileBox->currentItem(); 767 int curItem = mProfileBox->currentItem();
768 mProfileBox->blockSignals( true ); 768 mProfileBox->blockSignals( true );
769 mProfileBox->clear(); 769 mProfileBox->clear();
770 mProfileBox->insertStringList (mSyncProfileNames ); 770 mProfileBox->insertStringList (mSyncProfileNames );
771 int item = mSyncProfileNames.count() -1; 771 int item = mSyncProfileNames.count() -1;
772 if ( curItem >= 0 && mSyncProfileNames.count() > 0 && curItem < mSyncProfileNames.count() ) 772 if ( curItem >= 0 && mSyncProfileNames.count() > 0 && curItem < mSyncProfileNames.count() )
773 mProfileBox->setCurrentItem( curItem ); 773 mProfileBox->setCurrentItem( curItem );
774 else if ( item >= 0 ) { 774 else if ( item >= 0 ) {
775 mProfileBox->setCurrentItem( item ); 775 mProfileBox->setCurrentItem( item );
776 } 776 }
777 currentSelection = -1; 777 currentSelection = -1;
778 if ( mSyncProfileNames.count() > 0 ) { 778 if ( mSyncProfileNames.count() > 0 ) {
779 //qDebug(" profileChanged( mProfileBox->currentItem() "); 779 //qDebug(" profileChanged( mProfileBox->currentItem() ");
780 profileChanged( mProfileBox->currentItem() ); 780 profileChanged( mProfileBox->currentItem() );
781 currentSelection = mProfileBox->currentItem(); 781 currentSelection = mProfileBox->currentItem();
782 } 782 }
783 mProfileBox->blockSignals( false ); 783 mProfileBox->blockSignals( false );
784} 784}
785 785
786void KSyncPrefsDialog::addProfile ( KSyncProfile* temp ) 786void KSyncPrefsDialog::addProfile ( KSyncProfile* temp )
787{ 787{
788 saveProfile(); 788 saveProfile();
789 mSyncProfiles.append( temp ); 789 mSyncProfiles.append( temp );
790 mSyncProfileNames << temp->getName(); 790 mSyncProfileNames << temp->getName();
791 insertProfiles(); 791 insertProfiles();
792 int last = mProfileBox->count() -1; 792 int last = mProfileBox->count() -1;
793 mProfileBox->blockSignals( true ); 793 mProfileBox->blockSignals( true );
794 mProfileBox->setCurrentItem( last ); 794 mProfileBox->setCurrentItem( last );
795 mProfileBox->blockSignals( false ); 795 mProfileBox->blockSignals( false );
796 profileChanged(last); 796 profileChanged(last);
797} 797}
798void KSyncPrefsDialog::newProfile() 798void KSyncPrefsDialog::newProfile()
799{ 799{
800 addProfile ( new KSyncProfile () ); 800 addProfile ( new KSyncProfile () );
801} 801}
802 802
803void KSyncPrefsDialog::cloneProfile() 803void KSyncPrefsDialog::cloneProfile()
804{ 804{
805 if ( currentSelection >= 0 ) 805 if ( currentSelection >= 0 )
806 addProfile (mSyncProfiles.at(currentSelection)->clone()) ; 806 addProfile (mSyncProfiles.at(currentSelection)->clone()) ;
807 else 807 else
808 newProfile(); 808 newProfile();
809} 809}
810 810
811void KSyncPrefsDialog::setLocalMachineName ( const QString& name ) 811void KSyncPrefsDialog::setLocalMachineName ( const QString& name )
812{ 812{
813 mMyMachineName->setText( name ); 813 mMyMachineName->setText( name );
814 814
815} 815}
816QString KSyncPrefsDialog::getLocalMachineName ( ) 816QString KSyncPrefsDialog::getLocalMachineName ( )
817{ 817{
818 return mMyMachineName->text(); 818 return mMyMachineName->text();
819} 819}
820 820
821QStringList KSyncPrefsDialog::getSyncProfileNames() 821QStringList KSyncPrefsDialog::getSyncProfileNames()
822{ 822{
823 return mSyncProfileNames; 823 return mSyncProfileNames;
824} 824}
825void KSyncPrefsDialog::usrReadConfig() 825void KSyncPrefsDialog::usrReadConfig()
826{ 826{
827 //KConfig *config = KOGlobals::config(); 827 //KConfig *config = KOGlobals::config();
828 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); 828 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) );
829 config.setGroup("General"); 829 config.setGroup("General");
830 mSyncProfileNames =config.readListEntry("SyncProfileNames"); 830 mSyncProfileNames =config.readListEntry("SyncProfileNames");
831 mMyMachineName->setText(config.readEntry("LocalMachineName","undefined")); 831 mMyMachineName->setText(config.readEntry("LocalMachineName","undefined"));
832 int i; 832 int i;
833 KSyncProfile* temp ; 833 KSyncProfile* temp ;
834 mSyncProfiles.clear(); 834 mSyncProfiles.clear();
835 for ( i = 0; i < mSyncProfileNames.count();++i ) { 835 for ( i = 0; i < mSyncProfileNames.count();++i ) {
836 temp = new KSyncProfile (); 836 temp = new KSyncProfile ();
837 temp->setName( mSyncProfileNames[i] ); 837 temp->setName( mSyncProfileNames[i] );
838 temp->readConfig( &config ); 838 temp->readConfig( &config );
839 mSyncProfiles.append( temp ); 839 mSyncProfiles.append( temp );
840 } 840 }
841 insertProfiles(); 841 insertProfiles();
842 //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); 842 //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName );
843} 843}
844 844
845 845
846void KSyncPrefsDialog::usrWriteConfig() 846void KSyncPrefsDialog::usrWriteConfig()
847{ 847{
848 saveProfile(); 848 saveProfile();
849 if ( currentSelection >= 0 ) 849 if ( currentSelection >= 0 )
850 profileChanged(currentSelection); 850 profileChanged(currentSelection);
851 //KConfig *config = KOGlobals::config(); 851 //KConfig *config = KOGlobals::config();