summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncprofile.cpp
authorzautrix <zautrix>2004-08-01 16:27:04 (UTC)
committer zautrix <zautrix>2004-08-01 16:27:04 (UTC)
commitf968c6f5541463caadee98e200c2ba035fa20959 (patch) (side-by-side diff)
treee71549b7ba1312a55f0311ed74754943d22af22a /libkdepim/ksyncprofile.cpp
parent3a4186926d078692ad3c2261b70406c391f27554 (diff)
downloadkdepimpi-f968c6f5541463caadee98e200c2ba035fa20959.zip
kdepimpi-f968c6f5541463caadee98e200c2ba035fa20959.tar.gz
kdepimpi-f968c6f5541463caadee98e200c2ba035fa20959.tar.bz2
Extended the sync config dialog
Diffstat (limited to 'libkdepim/ksyncprofile.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkdepim/ksyncprofile.cpp37
1 files changed, 32 insertions, 5 deletions
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp
index ea41a85..f34c309 100644
--- a/libkdepim/ksyncprofile.cpp
+++ b/libkdepim/ksyncprofile.cpp
@@ -18,112 +18,139 @@
Boston, MA 02111-1307, USA.
*/
// $Id$
#include <qcolor.h>
#include <kconfig.h>
#include <kstandarddirs.h>
#include <kglobal.h>
#include <kdebug.h>
#include "ksyncprofile.h"
KSyncProfile::KSyncProfile( const char * name): QObject (0, name )
{
setDefault();
}
KSyncProfile::~KSyncProfile()
{
}
KSyncProfile* KSyncProfile::clone()
{
KSyncProfile* myClone = new KSyncProfile();
myClone->setPreSyncCommand( mPreSyncCommand );
myClone->setPostSyncCommand( mPostSyncCommand );
myClone->setLocalTempFile( mLocalTempFile);
myClone->setRemoteFileName( mRemoteFileName );
+ myClone->setPreSyncCommandAB( mPreSyncCommandAB );
+ myClone->setPostSyncCommandAB( mPostSyncCommandAB );
+ myClone->setLocalTempFileAB( mLocalTempFileAB);
+ myClone->setRemoteFileNameAB( mRemoteFileNameAB );
myClone->setShowSummaryAfterSync( mShowSummaryAfterSync );
myClone->setAskForPreferences( mAskForPreferences);
myClone->setWriteBackExisting(mWriteBackExisting );
myClone->setWriteBackFile( mWriteBackFile);
+ myClone->setWriteBackFuture( mWriteBackFuture );
+ myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks );
myClone->setIncludeInRingSync( mIncludeInRingSync );
myClone->setIncludeInRingSyncAB( mIncludeInRingSyncAB );
myClone->setSyncPrefs( mSyncPrefs);
myClone->setIsLocalFileSync( mIsLocalFileSync );
myClone->setName( "noName" );
return myClone;
}
void KSyncProfile::setDefault()
{
mName = "noName";
mPreSyncCommand = i18n("command for downloading remote file to local device");
mPostSyncCommand = i18n("command for uploading local temp file to remote device");
mLocalTempFile = "/tmp/mycalendar.ics";
mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics";
+ mPreSyncCommandAB = i18n("command for downloading remote file to local device");
+ mPostSyncCommandAB = i18n("command for uploading local temp file to remote device");
+ mLocalTempFileAB = "/tmp/std.vcf";
+ mRemoteFileNameAB = "/home/polo/kdepim/apps/kabc/localfile.vcf";
mShowSummaryAfterSync = true;
mAskForPreferences = true;
mWriteBackExisting = false;
+ mWriteBackFuture = false;
+ mWriteBackFutureWeeks = 12;
mWriteBackFile = true;
mIncludeInRingSync = false;
mIncludeInRingSyncAB = false;
mSyncPrefs = SYNC_PREF_ASK;
mIsLocalFileSync = true;
}
void KSyncProfile::readConfig(KConfig *config )
{
config->setGroup("SyncProfiles");
QString prefix = "Profile_"+mName+"_";
//mName = config->readEntry( prefix+ "Name", mName );
mPreSyncCommand = config->readEntry( prefix+ "PreSyncCommand",mPreSyncCommand );
- mPostSyncCommand = config->readEntry( prefix+ "PostSyncCommand", mPostSyncCommand );
- mIncludeInRingSync = config->readBoolEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync );
- mIncludeInRingSyncAB = config->readBoolEntry( prefix+ "IncludeInRingSyncAB",mIncludeInRingSyncAB );
+ mPostSyncCommand = config->readEntry( prefix+ "PostSyncCommand", mPostSyncCommand );;
mLocalTempFile = config->readEntry( prefix+ "LocalTempFile", mLocalTempFile );
mRemoteFileName = config->readEntry( prefix+ "RemoteFileName", mRemoteFileName );
+
+ mPreSyncCommandAB = config->readEntry( prefix+ "PreSyncCommandAB",mPreSyncCommandAB );
+ mPostSyncCommandAB = config->readEntry( prefix+ "PostSyncCommandAB", mPostSyncCommandAB );
+ mLocalTempFileAB = config->readEntry( prefix+ "LocalTempFileAB", mLocalTempFileAB );
+ mRemoteFileNameAB = config->readEntry( prefix+ "RemoteFileNameAB", mRemoteFileNameAB );
+
+ mIncludeInRingSync = config->readBoolEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync );
+ mIncludeInRingSyncAB = config->readBoolEntry( prefix+ "IncludeInRingSyncAB",mIncludeInRingSyncAB );
mShowSummaryAfterSync = config->readBoolEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync );
mAskForPreferences = config->readBoolEntry( prefix+ "AskForPreferences",mAskForPreferences );
mWriteBackExisting = config->readBoolEntry( prefix+ "WriteBackExisting",mWriteBackExisting );
+ mWriteBackFuture = config->readBoolEntry( prefix+ "WriteBackFuture",mWriteBackFuture );
mSyncPrefs = config->readNumEntry( prefix+ "SyncPrefs", mSyncPrefs );
+ mWriteBackFutureWeeks = config->readNumEntry( prefix+ "WriteBackFutureWeeks", mWriteBackFutureWeeks );
mIsLocalFileSync= config->readBoolEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync );
}
void KSyncProfile::writeConfig( KConfig * config )
{
config->setGroup("SyncProfiles");
QString prefix = "Profile_"+mName+"_";
// config->writeEntry( prefix+ "Name", mName );
config->writeEntry( prefix+ "PreSyncCommand",mPreSyncCommand );
config->writeEntry( prefix+ "PostSyncCommand", mPostSyncCommand );
- config->writeEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync );
- config->writeEntry( prefix+ "IncludeInRingSyncAB",mIncludeInRingSyncAB );
config->writeEntry( prefix+ "LocalTempFile", mLocalTempFile );
config->writeEntry( prefix+ "RemoteFileName", mRemoteFileName );
+
+ config->writeEntry( prefix+ "PreSyncCommandAB",mPreSyncCommandAB );
+ config->writeEntry( prefix+ "PostSyncCommandAB", mPostSyncCommandAB );
+ config->writeEntry( prefix+ "LocalTempFileAB", mLocalTempFileAB );
+ config->writeEntry( prefix+ "RemoteFileNameAB", mRemoteFileNameAB );
+ config->writeEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync );
+ config->writeEntry( prefix+ "IncludeInRingSyncAB",mIncludeInRingSyncAB );
config->writeEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync );
config->writeEntry( prefix+ "AskForPreferences",mAskForPreferences );
config->writeEntry( prefix+ "WriteBackExisting",mWriteBackExisting );
+ config->writeEntry( prefix+ "WriteBackFuture",mWriteBackFuture );
config->writeEntry( prefix+ "SyncPrefs", mSyncPrefs );
+ config->writeEntry( prefix+ "WriteBackFutureWeeks", mWriteBackFutureWeeks);
config->writeEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync );
}
/*
class KPrefsItemInt : public KPrefsItem {
public:
KPrefsItemInt(const QString &group,const QString &name,int *,int defaultValue=0);
virtual ~KPrefsItemInt() {}
void setDefault();
void readConfig(KConfig *);
void writeConfig(KConfig *);
private:
int *mReference;
int mDefault;
};
*/