Diffstat (limited to 'libkdepim/ksyncprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libkdepim/ksyncprefsdialog.cpp | 55 |
1 files changed, 47 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() //topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1); //++iii; - QHGroupBox* gb3 = new QHGroupBox( i18n("Time period"), topFrame); + QVGroupBox* gb3 = new QVGroupBox( i18n("Time period"), topFrame); connect ( mWriteBackFuture, SIGNAL( toggled ( bool ) ), gb3, SLOT ( setEnabled ( bool ) ) ); - new QLabel( i18n("From ") , gb3 ); - mWriteBackPastWeeks= new QSpinBox(1,104, 1, gb3); - new QLabel( i18n(" weeks in the past to ") , gb3 ); - mWriteBackFutureWeeks= new QSpinBox(1,104, 1, gb3); - new QLabel( i18n(" weeks in the future ") , gb3 ); + + new QLabel( i18n("From ") , gb3 ); + QHBox * tf1 = new QHBox ( gb3 ); + mWriteBackPastWeeks= new QSpinBox(1,104, 1, tf1 ); + mWriteBackPastWeeks->setMaximumWidth( 100 ); + new QLabel( i18n(" weeks in the past to ") ,tf1 ); + QHBox * tf2 = new QHBox ( gb3 ); + mWriteBackFutureWeeks= new QSpinBox(1,104, 1, tf2); + mWriteBackFutureWeeks->setMaximumWidth( 100 ); + new QLabel( i18n(" weeks in the future ") , tf2 ); //topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1); //++iii; @@ -379,4 +384,5 @@ void KSyncPrefsDialog::setupSyncAlgTab() mResTablePwmpi->horizontalHeader()->setLabel( 0, i18n("Remote") ); mResTableKopi->setLeftMargin( 80 ); + mResTableKapi->setLeftMargin( 80 ); } // ****************************************** @@ -388,5 +394,4 @@ void KSyncPrefsDialog::readResources() { mResourcesKopi.clear(); - mResourcesKapi.clear(); KConfig fc(locateLocal("config","kopicalendarrc")); fc.setGroup("CC"); @@ -404,4 +409,27 @@ void KSyncPrefsDialog::readResources() mResTableKopi->verticalHeader ()->setLabel( i, mResourcesKopi[i] ); } + + mResourcesKapi.clear(); + + KConfig conf ( locateLocal("config", "kabcrc") ); + + conf.setGroup( "General" ); + + QStringList keys = conf.readListEntry( "ResourceKeys" ); + //keys += conf->readListEntry( "PassiveResourceKeys" ); + + //QString standardKey = mConfig->readEntry( "Standard" ); + + for ( QStringList::Iterator it = keys.begin(); it != keys.end(); ++it ) { + conf.setGroup("Resource_"+ (*it) ); + QString name = conf.readEntry( "ResourceName" ); + mResourcesKapi.append( name ); + } + mResTableKapi->setNumRows( mResourcesKapi.count() ); + for ( i = 0;i < mResourcesKopi.count(); ++i ) { + mResTableKapi->verticalHeader ()->setLabel( i, mResourcesKapi[i] ); + } + + } void KSyncPrefsDialog::readFilter() @@ -482,5 +510,8 @@ void KSyncPrefsDialog::chooseFilePWM() mRemoteFilePWM->setText( fn ); } - +void KSyncPrefsDialog::updateMyCaption() +{ + setCaption( mProfileBox->currentText() + " : " +i18n("Synchronization Preferences")); +} void KSyncPrefsDialog::textChanged( const QString & s ) { @@ -499,4 +530,5 @@ void KSyncPrefsDialog::textChanged( const QString & s ) prof->setName( s ); mSyncProfileNames[mProfileBox-> currentItem ()] = s; + updateMyCaption(); } void KSyncPrefsDialog::profileChanged( int item ) @@ -613,4 +645,5 @@ void KSyncPrefsDialog::profileChanged( int item ) } else kindChanged( prof->getIsLocalFileSync() ); + updateMyCaption(); } @@ -753,4 +786,5 @@ void KSyncPrefsDialog::saveProfile() prof->setFilterInAB ( mFilterInAB ->currentText ()); prof->setFilterOutAB ( mFilterOutAB ->currentText ()); + mProfileBox->setFocus(); if ( mIsPiSpecific->isChecked() ) { @@ -761,4 +795,9 @@ void KSyncPrefsDialog::saveProfile() } prof->setResSpecKopi( res.join(":")); + res = mResourcesKapi; + for ( i = 0;i < mResourcesKapi.count(); ++i ) { + res.append( mResTableKapi->text( i, 0 )); + } + prof->setResSpecKapi( res.join(":")); } } |