summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncprefsdialog.cpp
Side-by-side diff
Diffstat (limited to 'libkdepim/ksyncprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncprefsdialog.cpp45
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
@@ -160,4 +160,7 @@ void KSyncPrefsDialog::setupSyncAlgTab()
{
QVGroupBox* topFrame = gb0;
+
+
+
mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame );
//topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1);
@@ -178,4 +181,12 @@ void KSyncPrefsDialog::setupSyncAlgTab()
//++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);
@@ -188,4 +199,11 @@ void KSyncPrefsDialog::setupSyncAlgTab()
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;
@@ -203,4 +221,5 @@ void KSyncPrefsDialog::setupSyncAlgTab()
//++iii;
gb3->setEnabled( false );
+ connect ( mWriteBackExisting, SIGNAL( toggled ( bool ) ), gb4, SLOT ( setDisabled ( bool ) ) );
}
connect ( mWriteBackFile, SIGNAL( toggled ( bool ) ), gb2, SLOT ( setEnabled ( bool ) ) );
@@ -355,5 +374,17 @@ void KSyncPrefsDialog::readFilter()
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 );
}
@@ -431,4 +462,5 @@ void KSyncPrefsDialog::profileChanged( int item )
KSyncProfile* prof;
saveProfile();
+ readFilter();
currentSelection = item;
prof = mSyncProfiles.at(item) ;
@@ -477,4 +509,9 @@ void KSyncPrefsDialog::profileChanged( int item )
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() ) {
@@ -646,7 +683,9 @@ void KSyncPrefsDialog::saveProfile()
prof->setPhoneConnection( mPhoneConnection->text() );
prof->setPhoneModel( mPhoneModel->text() );
-
+ prof->setFilterInCal ( mFilterInCal->currentText ());
+ prof->setFilterOutCal ( mFilterOutCal ->currentText ());
+ prof->setFilterInAB ( mFilterInAB ->currentText ());
+ prof->setFilterOutAB ( mFilterOutAB ->currentText ());
}
-
}