summaryrefslogtreecommitdiffabout
path: root/libkdepim
Unidiff
Diffstat (limited to 'libkdepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncprefsdialog.cpp55
-rw-r--r--libkdepim/ksyncprefsdialog.h1
2 files changed, 48 insertions, 8 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp
index b097277..6f46d19 100644
--- a/libkdepim/ksyncprefsdialog.cpp
+++ b/libkdepim/ksyncprefsdialog.cpp
@@ -222,11 +222,16 @@ void KSyncPrefsDialog::setupSyncAlgTab()
222 //topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1); 222 //topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1);
223 //++iii; 223 //++iii;
224 QHGroupBox* gb3 = new QHGroupBox( i18n("Time period"), topFrame); 224 QVGroupBox* gb3 = new QVGroupBox( i18n("Time period"), topFrame);
225 connect ( mWriteBackFuture, SIGNAL( toggled ( bool ) ), gb3, SLOT ( setEnabled ( bool ) ) ); 225 connect ( mWriteBackFuture, SIGNAL( toggled ( bool ) ), gb3, SLOT ( setEnabled ( bool ) ) );
226 new QLabel( i18n("From ") , gb3 ); 226
227 mWriteBackPastWeeks= new QSpinBox(1,104, 1, gb3); 227 new QLabel( i18n("From ") , gb3 );
228 new QLabel( i18n(" weeks in the past to ") , gb3 ); 228 QHBox * tf1 = new QHBox ( gb3 );
229 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, gb3); 229 mWriteBackPastWeeks= new QSpinBox(1,104, 1, tf1 );
230 new QLabel( i18n(" weeks in the future ") , gb3 ); 230 mWriteBackPastWeeks->setMaximumWidth( 100 );
231 new QLabel( i18n(" weeks in the past to ") ,tf1 );
232 QHBox * tf2 = new QHBox ( gb3 );
233 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, tf2);
234 mWriteBackFutureWeeks->setMaximumWidth( 100 );
235 new QLabel( i18n(" weeks in the future ") , tf2 );
231 //topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1); 236 //topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1);
232 //++iii; 237 //++iii;
@@ -379,4 +384,5 @@ void KSyncPrefsDialog::setupSyncAlgTab()
379 mResTablePwmpi->horizontalHeader()->setLabel( 0, i18n("Remote") ); 384 mResTablePwmpi->horizontalHeader()->setLabel( 0, i18n("Remote") );
380 mResTableKopi->setLeftMargin( 80 ); 385 mResTableKopi->setLeftMargin( 80 );
386 mResTableKapi->setLeftMargin( 80 );
381 } 387 }
382 // ****************************************** 388 // ******************************************
@@ -388,5 +394,4 @@ void KSyncPrefsDialog::readResources()
388{ 394{
389 mResourcesKopi.clear(); 395 mResourcesKopi.clear();
390 mResourcesKapi.clear();
391 KConfig fc(locateLocal("config","kopicalendarrc")); 396 KConfig fc(locateLocal("config","kopicalendarrc"));
392 fc.setGroup("CC"); 397 fc.setGroup("CC");
@@ -404,4 +409,27 @@ void KSyncPrefsDialog::readResources()
404 mResTableKopi->verticalHeader ()->setLabel( i, mResourcesKopi[i] ); 409 mResTableKopi->verticalHeader ()->setLabel( i, mResourcesKopi[i] );
405 } 410 }
411
412 mResourcesKapi.clear();
413
414 KConfig conf ( locateLocal("config", "kabcrc") );
415
416 conf.setGroup( "General" );
417
418 QStringList keys = conf.readListEntry( "ResourceKeys" );
419 //keys += conf->readListEntry( "PassiveResourceKeys" );
420
421 //QString standardKey = mConfig->readEntry( "Standard" );
422
423 for ( QStringList::Iterator it = keys.begin(); it != keys.end(); ++it ) {
424 conf.setGroup("Resource_"+ (*it) );
425 QString name = conf.readEntry( "ResourceName" );
426 mResourcesKapi.append( name );
427 }
428 mResTableKapi->setNumRows( mResourcesKapi.count() );
429 for ( i = 0;i < mResourcesKopi.count(); ++i ) {
430 mResTableKapi->verticalHeader ()->setLabel( i, mResourcesKapi[i] );
431 }
432
433
406} 434}
407void KSyncPrefsDialog::readFilter() 435void KSyncPrefsDialog::readFilter()
@@ -482,5 +510,8 @@ void KSyncPrefsDialog::chooseFilePWM()
482 mRemoteFilePWM->setText( fn ); 510 mRemoteFilePWM->setText( fn );
483} 511}
484 512void KSyncPrefsDialog::updateMyCaption()
513{
514 setCaption( mProfileBox->currentText() + " : " +i18n("Synchronization Preferences"));
515}
485void KSyncPrefsDialog::textChanged( const QString & s ) 516void KSyncPrefsDialog::textChanged( const QString & s )
486{ 517{
@@ -499,4 +530,5 @@ void KSyncPrefsDialog::textChanged( const QString & s )
499 prof->setName( s ); 530 prof->setName( s );
500 mSyncProfileNames[mProfileBox-> currentItem ()] = s; 531 mSyncProfileNames[mProfileBox-> currentItem ()] = s;
532 updateMyCaption();
501} 533}
502void KSyncPrefsDialog::profileChanged( int item ) 534void KSyncPrefsDialog::profileChanged( int item )
@@ -613,4 +645,5 @@ void KSyncPrefsDialog::profileChanged( int item )
613 } else 645 } else
614 kindChanged( prof->getIsLocalFileSync() ); 646 kindChanged( prof->getIsLocalFileSync() );
647 updateMyCaption();
615} 648}
616 649
@@ -753,4 +786,5 @@ void KSyncPrefsDialog::saveProfile()
753 prof->setFilterInAB ( mFilterInAB ->currentText ()); 786 prof->setFilterInAB ( mFilterInAB ->currentText ());
754 prof->setFilterOutAB ( mFilterOutAB ->currentText ()); 787 prof->setFilterOutAB ( mFilterOutAB ->currentText ());
788 mProfileBox->setFocus();
755 if ( mIsPiSpecific->isChecked() ) { 789 if ( mIsPiSpecific->isChecked() ) {
756 790
@@ -761,4 +795,9 @@ void KSyncPrefsDialog::saveProfile()
761 } 795 }
762 prof->setResSpecKopi( res.join(":")); 796 prof->setResSpecKopi( res.join(":"));
797 res = mResourcesKapi;
798 for ( i = 0;i < mResourcesKapi.count(); ++i ) {
799 res.append( mResTableKapi->text( i, 0 ));
800 }
801 prof->setResSpecKapi( res.join(":"));
763 } 802 }
764 } 803 }
diff --git a/libkdepim/ksyncprefsdialog.h b/libkdepim/ksyncprefsdialog.h
index e8a9709..d8c02de 100644
--- a/libkdepim/ksyncprefsdialog.h
+++ b/libkdepim/ksyncprefsdialog.h
@@ -85,4 +85,5 @@ class KSyncPrefsDialog : public KDialog
85 void readResources(); 85 void readResources();
86 private: 86 private:
87 void updateMyCaption();
87 int currentSelection; 88 int currentSelection;
88 QPtrList<KSyncProfile> mSyncProfiles; 89 QPtrList<KSyncProfile> mSyncProfiles;