Diffstat (limited to 'libkdepim/ksyncprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libkdepim/ksyncprefsdialog.cpp | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index 8a3f4cf..6e42fd4 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp @@ -154,16 +154,19 @@ void KSyncPrefsDialog::setupSyncAlgTab() topLayout->addMultiCellWidget(iims, iii,iii,0,1); ++iii; QVGroupBox* gb0 = new QVGroupBox( i18n("Sync algo options"), topFrame); topLayout->addMultiCellWidget(gb0, iii,iii,0,1); ++iii; QButtonGroup* gr; { QVGroupBox* topFrame = gb0; + + + mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame ); //topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1); //++iii; gr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame); //topLayout->addMultiCellWidget(gr, iii,iii,0,1); //++iii; loc = new QRadioButton ( i18n("Take local entry on conflict"), gr ); rem = new QRadioButton ( i18n("Take remote entry on conflict"), gr ); @@ -172,41 +175,57 @@ void KSyncPrefsDialog::setupSyncAlgTab() f_loc= new QRadioButton ( i18n("Force: Take local entry always"), gr ); f_rem = new QRadioButton ( i18n("Force: Take remote entry always"), gr ); // both = new QRadioButton ( i18n("Take both on conflict"), gr ); mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame ); //topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1); //++iii; + QHGroupBox* gb5 = new QHGroupBox( i18n("Apply filter when adding data to local:"), topFrame); + QVBox * fibo2 = new QVBox ( gb5 ); + new QLabel ( i18n("Incoming calendar filter:"), fibo2 ); + mFilterInCal = new QComboBox( fibo2 ); + fibo2 = new QVBox ( gb5 ); + new QLabel ( i18n("Incoming adressbook filter:"), fibo2 ); + mFilterInAB = new QComboBox( fibo2 ); + mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame ); // topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1); // ++iii; QVGroupBox* gb2 = new QVGroupBox( i18n("Write back options"), topFrame); //topLayout->addMultiCellWidget(gb2, iii,iii,0,1); //++iii; { QVGroupBox*topFrame = gb2; mWriteBackExisting= new QCheckBox( i18n("Write back (on remote) existing entries only"), topFrame ); + QHGroupBox* gb4 = new QHGroupBox( i18n("Apply filter when adding data to remote:"), topFrame); + QVBox * fibo = new QVBox ( gb4 ); + new QLabel ( i18n("Outgoing calendar filter:"), fibo ); + mFilterOutCal = new QComboBox( fibo ); + fibo = new QVBox ( gb4 ); + new QLabel ( i18n("Outgoing addressbook filter:"), fibo ); + mFilterOutAB = new QComboBox( fibo ); //topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1); //++iii; mWriteBackFuture= new QCheckBox( i18n("Write back (calendar) entries for time period only"), topFrame ); //topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1); //++iii; QHGroupBox* gb3 = new QHGroupBox( 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 ); //topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1); //++iii; gb3->setEnabled( false ); + connect ( mWriteBackExisting, SIGNAL( toggled ( bool ) ), gb4, SLOT ( setDisabled ( bool ) ) ); } connect ( mWriteBackFile, SIGNAL( toggled ( bool ) ), gb2, SLOT ( setEnabled ( bool ) ) ); } proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); gr = proGr; topLayout->addMultiCellWidget(gr, iii,iii,0,1); ++iii; @@ -349,17 +368,29 @@ void KSyncPrefsDialog::readFilter() mFilterKapi.clear(); mFilterKopi.clear(); mFilterKopi.append(i18n("No Filter") ); mFilterKapi.append(i18n("No Filter") ); KConfig cfgko(locateLocal("config","korganizerrc")); KConfig cfgka(locateLocal("config","kaddressbookrc")); cfgko.setGroup("General"); mFilterKopi = cfgko.readListEntry("CalendarFilters"); - mFilterKopi.prepend(i18n("No Filter") ); + mFilterKapi = mFilterKopi; + mFilterOutCal->clear(); + mFilterInCal->clear(); + mFilterOutAB->clear(); + mFilterInAB->clear(); + QStringList temp = mFilterKopi; + temp.prepend(i18n("No Filter") ); + mFilterOutCal->insertStringList( temp ); + mFilterInCal->insertStringList( temp ); + temp = mFilterKapi; + temp.prepend(i18n("No Filter") ); + mFilterOutAB->insertStringList( temp ); + mFilterInAB->insertStringList( temp ); } void KSyncPrefsDialog::slotOK() { if ( mMyMachineName->text() == "undefined" ) { KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error")); return; @@ -425,16 +456,17 @@ void KSyncPrefsDialog::textChanged( const QString & s ) prof->setName( s ); mSyncProfileNames[mProfileBox-> currentItem ()] = s; } void KSyncPrefsDialog::profileChanged( int item ) { //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() ); KSyncProfile* prof; saveProfile(); + readFilter(); currentSelection = item; prof = mSyncProfiles.at(item) ; mRemotePw->setText(prof->getRemotePw()); mRemoteIP->setText(prof->getRemoteIP()); mRemotePort->setText(prof->getRemotePort()); mRemotePwAB->setText(prof->getRemotePwAB()); @@ -471,16 +503,21 @@ void KSyncPrefsDialog::profileChanged( int item ) mWriteBackExisting->setChecked( prof->getWriteBackExisting() ); mWriteBackFile->setChecked( prof->getWriteBackFile()); mIncludeInRing->setChecked( prof->getIncludeInRingSync() ); mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() ); mIncludeInRingPWM->setChecked( prof->getIncludeInRingSyncPWM() ); mWriteBackFuture->setChecked( prof->getWriteBackFuture()); mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() ); mWriteBackPastWeeks->setValue( prof->getWriteBackPastWeeks() ); + + mFilterInCal->setCurrentItem( mFilterKopi.findIndex(prof->getFilterInCal () ) + 1 ); + mFilterOutCal->setCurrentItem( mFilterKopi.findIndex(prof->getFilterOutCal () ) + 1 ); + mFilterInAB->setCurrentItem( mFilterKapi.findIndex(prof->getFilterInAB () ) + 1 ); + mFilterOutAB->setCurrentItem( mFilterKapi.findIndex(prof->getFilterOutAB () ) + 1 ); switch ( prof->getSyncPrefs() ) { case 0: loc->setChecked( true); break; case 1: rem->setChecked( true ); break; @@ -640,19 +677,21 @@ void KSyncPrefsDialog::saveProfile() prof->setWriteBackFuture(mWriteBackFuture->isChecked()); prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value()); prof->setWriteBackPastWeeks(mWriteBackPastWeeks->value()); if ( mWriteContactToSIM ) prof->setWriteContactToSIM(mWriteContactToSIM->isChecked()); prof->setPhoneDevice( mPhoneDevice->text() ); prof->setPhoneConnection( mPhoneConnection->text() ); prof->setPhoneModel( mPhoneModel->text() ); - + prof->setFilterInCal ( mFilterInCal->currentText ()); + prof->setFilterOutCal ( mFilterOutCal ->currentText ()); + prof->setFilterInAB ( mFilterInAB ->currentText ()); + prof->setFilterOutAB ( mFilterOutAB ->currentText ()); } - } void KSyncPrefsDialog::insertProfiles() { int curItem = mProfileBox->currentItem(); mProfileBox->blockSignals( true ); mProfileBox->clear(); mProfileBox->insertStringList (mSyncProfileNames ); |