summaryrefslogtreecommitdiffabout
path: root/libkdepim
authorzautrix <zautrix>2005-01-14 21:17:00 (UTC)
committer zautrix <zautrix>2005-01-14 21:17:00 (UTC)
commitee9df90c4898f4ed624be2d4e94918fcc80060e9 (patch) (side-by-side diff)
treed15e5e2e7fd4120d09fdda2ab4331ade67082e84 /libkdepim
parent620f8de219ee34c209960f02c8296c0568dd5d8b (diff)
downloadkdepimpi-ee9df90c4898f4ed624be2d4e94918fcc80060e9.zip
kdepimpi-ee9df90c4898f4ed624be2d4e94918fcc80060e9.tar.gz
kdepimpi-ee9df90c4898f4ed624be2d4e94918fcc80060e9.tar.bz2
sync settings
Diffstat (limited to 'libkdepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncprefsdialog.cpp45
-rw-r--r--libkdepim/ksyncprefsdialog.h5
-rw-r--r--libkdepim/ksyncprofile.cpp19
-rw-r--r--libkdepim/ksyncprofile.h14
4 files changed, 80 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
@@ -159,6 +159,9 @@ void KSyncPrefsDialog::setupSyncAlgTab()
QButtonGroup* gr;
{
QVGroupBox* topFrame = gb0;
+
+
+
mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame );
//topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1);
//++iii;
@@ -177,6 +180,14 @@ void KSyncPrefsDialog::setupSyncAlgTab()
//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;
@@ -187,6 +198,13 @@ 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;
mWriteBackFuture= new QCheckBox( i18n("Write back (calendar) entries for time period only"), topFrame );
@@ -202,6 +220,7 @@ void KSyncPrefsDialog::setupSyncAlgTab()
//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 ) ) );
@@ -354,7 +373,19 @@ void KSyncPrefsDialog::readFilter()
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 );
}
@@ -430,6 +461,7 @@ 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) ;
@@ -476,6 +508,11 @@ void KSyncPrefsDialog::profileChanged( int item )
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:
@@ -645,9 +682,11 @@ void KSyncPrefsDialog::saveProfile()
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()
diff --git a/libkdepim/ksyncprefsdialog.h b/libkdepim/ksyncprefsdialog.h
index 997f524..24543e1 100644
--- a/libkdepim/ksyncprefsdialog.h
+++ b/libkdepim/ksyncprefsdialog.h
@@ -100,6 +100,11 @@ class KSyncPrefsDialog : public KDialog
void saveProfile();
QButtonGroup* proGr;
+ QComboBox * mFilterOutCal;
+ QComboBox * mFilterInCal;
+ QComboBox * mFilterOutAB;
+ QComboBox * mFilterInAB;
+
QRadioButton* loc, *rem, *newest, *ask, *f_loc,* f_rem, *both;
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp
index 9f404cb..0d72fc9 100644
--- a/libkdepim/ksyncprofile.cpp
+++ b/libkdepim/ksyncprofile.cpp
@@ -81,6 +81,10 @@ KSyncProfile* KSyncProfile::clone()
myClone->setIsPiSync( mIsPiSync );
myClone->setWriteContactToSIM( mWriteContactToSIM );
myClone->setName( "noName" );
+ myClone->setFilterInCal ( mFilterInCal );
+ myClone->setFilterOutCal ( mFilterOutCal );
+ myClone->setFilterInAB ( mFilterInAB );
+ myClone->setFilterOutAB ( mFilterOutAB );
//myClone->setIdentifier( "noID" );
return myClone;
}
@@ -133,6 +137,10 @@ void KSyncProfile::setDefault()
mPhoneDevice = "/dev/ircomm";
mPhoneConnection = "irda";
mPhoneModel = "6310i";
+ mFilterInCal = "no filter";
+ mFilterOutCal = "no filter";
+ mFilterInAB = "no filter";
+ mFilterOutAB = "no filter";
}
void KSyncProfile::readConfig(KConfig *config )
{
@@ -188,6 +196,12 @@ void KSyncProfile::readConfig(KConfig *config )
mIsPhoneSync= config->readBoolEntry( "IsPhoneSync", mIsPhoneSync );
mIsPiSync= config->readBoolEntry( "IsPiSync", mIsPiSync );
mIsKapiFile = config->readBoolEntry( "IsKapiFile", mIsKapiFile );
+
+ mFilterInCal = config->readEntry( "FilterInCal", mFilterInCal );
+ mFilterOutCal = config->readEntry( "FilterOutCal", mFilterOutCal );
+ mFilterInAB = config->readEntry( "FilterInAB", mFilterInAB );
+ mFilterOutAB = config->readEntry( "FilterOutAB", mFilterOutAB );
+
}
else
{
@@ -252,5 +266,10 @@ void KSyncProfile::writeConfig( KConfig * config )
config->writeEntry( "IsPhoneSync", mIsPhoneSync );
config->writeEntry( "IsPiSync", mIsPiSync );
config->writeEntry( "IsKapiFile", mIsKapiFile );
+ config->writeEntry( "FilterInCal", mFilterInCal );
+ config->writeEntry( "FilterOutCal", mFilterOutCal );
+ config->writeEntry( "FilterInAB", mFilterInAB );
+ config->writeEntry( "FilterOutAB", mFilterOutAB );
+
}
diff --git a/libkdepim/ksyncprofile.h b/libkdepim/ksyncprofile.h
index e970b50..aad63d3 100644
--- a/libkdepim/ksyncprofile.h
+++ b/libkdepim/ksyncprofile.h
@@ -104,6 +104,15 @@ class KSyncProfile : public QObject {
QString get( ) { return ;}
*/
+ void setFilterInCal (const QString& n ){ mFilterInCal = n;}
+ void setFilterOutCal (const QString& n ){ mFilterOutCal = n;}
+ void setFilterInAB (const QString& n ){ mFilterInAB = n;}
+ void setFilterOutAB (const QString& n ){ mFilterOutAB = n;}
+ QString getFilterInCal () { return mFilterInCal ;}
+ QString getFilterOutCal () { return mFilterOutCal ;}
+ QString getFilterInAB () { return mFilterInAB ;}
+ QString getFilterOutAB () { return mFilterOutAB ;}
+
void setName( const QString& n ) {mName = n;}
QString getName( ) { return mName;}
void setShowSummaryAfterSync( bool b ) { mShowSummaryAfterSync = b;}
@@ -169,6 +178,11 @@ class KSyncProfile : public QObject {
QString mPhoneConnection;
QString mPhoneModel;
+ QString mFilterInCal;
+ QString mFilterOutCal;
+ QString mFilterInAB;
+ QString mFilterOutAB;
+
bool mIncludeInRingSync;
bool mIncludeInRingSyncAB;
bool mIncludeInRingSyncPWM;