summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncprefsdialog.cpp
Unidiff
Diffstat (limited to 'libkdepim/ksyncprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncprefsdialog.cpp72
1 files changed, 67 insertions, 5 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp
index 8873ed1..292cde1 100644
--- a/libkdepim/ksyncprefsdialog.cpp
+++ b/libkdepim/ksyncprefsdialog.cpp
@@ -243,4 +243,6 @@ void KSyncPrefsDialog::setupSyncAlgTab()
243 mIsLocal = new QRadioButton ( i18n("Local file"), gr ); 243 mIsLocal = new QRadioButton ( i18n("Local file"), gr );
244 mIsPi = new QRadioButton ( i18n("Pi-Sync ( direct Kx/Pi to Kx/Pi sync )"), gr ); 244 mIsPi = new QRadioButton ( i18n("Pi-Sync - all resources ( direct Kx/Pi to Kx/Pi sync )"), gr );
245 connect (mIsPi, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); 245 connect (mIsPi, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
246 mIsPiSpecific = new QRadioButton ( i18n("Pi-Sync - selected resources ( direct Kx/Pi to Kx/Pi sync )"), gr );
247 connect (mIsPiSpecific, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
246 mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr ); 248 mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr );
@@ -368,2 +370,12 @@ void KSyncPrefsDialog::setupSyncAlgTab()
368 mRemotePortPWM = new QLineEdit(temphb); 370 mRemotePortPWM = new QLineEdit(temphb);
371
372 lab = new QLabel( i18n("Local/remote Resource sync partners"), piWidget);
373 mTableBox = new QHBox( piWidget );
374 mResTableKopi = new QTable( 1, 1, mTableBox );
375 mResTableKapi = new QTable( 1, 1, mTableBox );
376 mResTablePwmpi = new QTable( 1, 1, mTableBox );
377 mResTableKopi->horizontalHeader()->setLabel( 0, i18n("Remote") );
378 mResTableKapi->horizontalHeader()->setLabel( 0, i18n("Remote") );
379 mResTablePwmpi->horizontalHeader()->setLabel( 0, i18n("Remote") );
380 mResTableKopi->setLeftMargin( 80 );
369 } 381 }
@@ -374,2 +386,22 @@ void KSyncPrefsDialog::setupSyncAlgTab()
374 386
387void KSyncPrefsDialog::readResources()
388{
389 mResourcesKopi.clear();
390 mResourcesKapi.clear();
391 KConfig fc(locateLocal("config","kopicalendarrc"));
392 fc.setGroup("CC");
393 int numCals = fc.readNumEntry("NumberCalendars",0 );
394 int curCal = 1;
395 while ( curCal <= numCals ) {
396 QString prefix = "Cal_" +QString::number( curCal );
397 QString name = fc.readEntry( prefix+"_Name", "Calendar");
398 mResourcesKopi.append( name );
399 ++curCal;
400 }
401 mResTableKopi->setNumRows( mResourcesKopi.count() );
402 int i;
403 for ( i = 0;i < mResourcesKopi.count(); ++i ) {
404 mResTableKopi->verticalHeader ()->setLabel( i, mResourcesKopi[i] );
405 }
406}
375void KSyncPrefsDialog::readFilter() 407void KSyncPrefsDialog::readFilter()
@@ -475,2 +507,3 @@ void KSyncPrefsDialog::profileChanged( int item )
475 readFilter(); 507 readFilter();
508 readResources();
476 currentSelection = item; 509 currentSelection = item;
@@ -555,2 +588,3 @@ void KSyncPrefsDialog::profileChanged( int item )
555 mIsPi->setChecked(prof->getIsPiSync()) ; 588 mIsPi->setChecked(prof->getIsPiSync()) ;
589 mIsPiSpecific->setChecked(prof->getIsPiSyncSpec()) ;
556 mIsKapiFileL->setChecked(prof->getIsKapiFile()) ; 590 mIsKapiFileL->setChecked(prof->getIsKapiFile()) ;
@@ -558,3 +592,13 @@ void KSyncPrefsDialog::profileChanged( int item )
558 592
559 mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() &&!prof->getIsPiSync() ); 593
594 QStringList res = QStringList::split( ":",prof->getResSpecKopi());
595 int i;
596 for ( i = 0;i < res.count(); ++i ) {
597 mResTableKopi->setText( i, 0, res[i] );
598 }
599 res = QStringList::split( ":",prof->getResSpecKapi());
600 for ( i = 0;i < res.count(); ++i ) {
601 mResTableKapi->setText( i, 0, res[i] );
602 }
603 mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() &&!prof->getIsPiSync() &&!prof->getIsPiSyncSpec());
560 proGr->setEnabled( item > 2 ); 604 proGr->setEnabled( item > 2 );
@@ -620,5 +664,12 @@ void KSyncPrefsDialog::kindChanged( bool b )
620 phoneWidget->hide(); 664 phoneWidget->hide();
621 } 665 }
622 if ( mIsPi->isChecked () ) { 666
667 if ( mIsPi->isChecked () || mIsPiSpecific->isChecked () ) {
623 piWidget->show(); 668 piWidget->show();
669 if (mIsPiSpecific->isChecked () ) {
670 mTableBox->show();
671 }
672 else {
673 mTableBox->hide();
674 }
624 } 675 }
@@ -626,3 +677,4 @@ void KSyncPrefsDialog::kindChanged( bool b )
626 piWidget->hide(); 677 piWidget->hide();
627 } 678 }
679
628 680
@@ -686,2 +738,3 @@ void KSyncPrefsDialog::saveProfile()
686 prof->setIsPiSync( mIsPi->isChecked() ); 738 prof->setIsPiSync( mIsPi->isChecked() );
739 prof->setIsPiSyncSpec( mIsPiSpecific->isChecked() );
687 prof->setIsKapiFile( mIsKapiFileL->isChecked() ); 740 prof->setIsKapiFile( mIsKapiFileL->isChecked() );
@@ -699,2 +752,11 @@ void KSyncPrefsDialog::saveProfile()
699 prof->setFilterOutAB ( mFilterOutAB ->currentText ()); 752 prof->setFilterOutAB ( mFilterOutAB ->currentText ());
753 if ( mIsPiSpecific->isChecked() ) {
754
755 QStringList res;
756 int i;
757 for ( i = 0;i < mResourcesKopi.count(); ++i ) {
758 res.append( mResTableKopi->text( i, 0 ));
759 }
760 prof->setResSpecKopi( res.join(":"));
761 }
700 } 762 }