summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncprefsdialog.cpp77
-rw-r--r--libkdepim/ksyncprefsdialog.h19
-rw-r--r--libkdepim/ksyncprofile.cpp37
-rw-r--r--libkdepim/ksyncprofile.h21
4 files changed, 131 insertions, 23 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp
index 7c04f48..355c05d 100644
--- a/libkdepim/ksyncprefsdialog.cpp
+++ b/libkdepim/ksyncprefsdialog.cpp
@@ -165,12 +165,20 @@ void KSyncPrefsDialog::setupSyncAlgTab()
165 topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1); 165 topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1);
166 ++iii;
167
168 mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame );
169 topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1);
166 ++iii; 170 ++iii;
167 171
168 mWriteBackExisting= new QCheckBox( i18n("Write back existing entries only"), topFrame ); 172 mWriteBackExisting= new QCheckBox( i18n("-- Write back (on remote) existing entries only"), topFrame );
169 topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1); 173 topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1);
170 ++iii; 174 ++iii;
171 175
172 mWriteBackFile = new QCheckBox( i18n("Write back file"), topFrame ); 176 mWriteBackFuture= new QCheckBox( i18n("-- Write back (calendar) entries in future only"), topFrame );
173 topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1); 177 topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1);
174 ++iii; 178 ++iii;
175 179 topLayout->addMultiCellWidget(new QLabel( i18n("---- Max. weeks in future: ") , topFrame ), iii,iii,0,0);
180 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, topFrame);
181 topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1);
182 ++iii;
183
176 proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); 184 proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame);
@@ -182,3 +190,3 @@ void KSyncPrefsDialog::setupSyncAlgTab()
182 connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); 190 connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
183 191 // *** local
184 localFileWidget = new QVBox( topFrame); 192 localFileWidget = new QVBox( topFrame);
@@ -187,9 +195,16 @@ void KSyncPrefsDialog::setupSyncAlgTab()
187 QHBox* temphb = new QHBox( localFileWidget ); 195 QHBox* temphb = new QHBox( localFileWidget );
188 lab = new QLabel( i18n("Local file:"), temphb);
189 mRemoteFile = new QLineEdit(localFileWidget);
190 196
197 lab = new QLabel( i18n("Local file Cal:"), temphb );
198 lab = new QLabel( i18n("Local file ABook:"), temphb );
199 temphb = new QHBox( localFileWidget );
191 button = new QPushButton( i18n("Choose..."), temphb ); 200 button = new QPushButton( i18n("Choose..."), temphb );
192 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) ); 201 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) );
202 button = new QPushButton( i18n("Choose..."), temphb );
203 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) );
204 temphb = new QHBox( localFileWidget );
193 205
206 mRemoteFile = new QLineEdit( temphb);
207 mRemoteFileAB = new QLineEdit( temphb);
194 208
209 // *** remote
195 remoteFileWidget = new QVBox( topFrame); 210 remoteFileWidget = new QVBox( topFrame);
@@ -197,11 +212,20 @@ void KSyncPrefsDialog::setupSyncAlgTab()
197 ++iii; 212 ++iii;
213 temphb = new QHBox( remoteFileWidget );
214 new QLabel( i18n("Calendar:"), temphb);
215 new QLabel( i18n("AddressBook:"), temphb);
216
198 lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget); 217 lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget);
199 mRemotePrecommand = new QLineEdit(remoteFileWidget); 218 temphb = new QHBox( remoteFileWidget );
219 mRemotePrecommand = new QLineEdit(temphb);
220 mRemotePrecommandAB = new QLineEdit(temphb);
200 221
201 lab = new QLabel( i18n("Local temp file:"), remoteFileWidget); 222 lab = new QLabel( i18n("Local temp file:"), remoteFileWidget);
202 mLocalTempFile = new QLineEdit(remoteFileWidget); 223 temphb = new QHBox( remoteFileWidget );
224 mLocalTempFile = new QLineEdit(temphb);
225 mLocalTempFileAB = new QLineEdit(temphb);
203 226
204
205 lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget); 227 lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget);
206 mRemotePostcommand = new QLineEdit(remoteFileWidget); 228 temphb = new QHBox( remoteFileWidget );
229 mRemotePostcommand = new QLineEdit(temphb );
230 mRemotePostcommandAB = new QLineEdit(temphb );
207 231
@@ -247,2 +271,12 @@ void KSyncPrefsDialog::chooseFile()
247 271
272void KSyncPrefsDialog::chooseFileAB()
273{
274 QString fn = QDir::homeDirPath();
275
276 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this );
277 if ( fn == "" )
278 return;
279 mRemoteFileAB->setText( fn );
280}
281
248void KSyncPrefsDialog::textChanged( const QString & s ) 282void KSyncPrefsDialog::textChanged( const QString & s )
@@ -275,2 +309,7 @@ void KSyncPrefsDialog::profileChanged( int item )
275 mRemoteFile->setText(prof->getRemoteFileName()) ; 309 mRemoteFile->setText(prof->getRemoteFileName()) ;
310
311 mRemotePrecommandAB->setText(prof->getPreSyncCommandAB());
312 mRemotePostcommandAB->setText(prof->getPostSyncCommandAB());
313 mLocalTempFileAB->setText(prof->getLocalTempFileAB());
314 mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ;
276 mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync()); 315 mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync());
@@ -281,2 +320,4 @@ void KSyncPrefsDialog::profileChanged( int item )
281 mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() ); 320 mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() );
321 mWriteBackFuture->setChecked( prof->getWriteBackFuture());
322 mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() );
282 323
@@ -323,2 +364,5 @@ void KSyncPrefsDialog::fillSSH()
323 mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" ); 364 mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" );
365 mRemotePrecommandAB->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf /tmp/std.vcf" );
366 mLocalTempFileAB->setText("/tmp/std.vcf" );
367 mRemotePostcommandAB->setText("scp /tmp/std.vcf zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf" );
324} 368}
@@ -329,2 +373,5 @@ void KSyncPrefsDialog::fillFTP()
329 mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); 373 mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" );
374 mRemotePrecommandAB->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf" );
375 mLocalTempFileAB->setText("/tmp/std.vcf" );
376 mRemotePostcommandAB->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf /tmp/std.vcf" );
330 377
@@ -362,2 +409,6 @@ void KSyncPrefsDialog::saveProfile()
362 prof->setRemoteFileName( mRemoteFile->text() ); 409 prof->setRemoteFileName( mRemoteFile->text() );
410 prof->setPreSyncCommandAB( mRemotePrecommandAB->text());
411 prof->setPostSyncCommandAB( mRemotePostcommandAB->text() );
412 prof->setLocalTempFileAB( mLocalTempFileAB->text());
413 prof->setRemoteFileNameAB( mRemoteFileAB->text() );
363 prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() ); 414 prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() );
@@ -371,2 +422,4 @@ void KSyncPrefsDialog::saveProfile()
371 prof->setIsLocalFileSync( mIsLocal->isChecked() ); 422 prof->setIsLocalFileSync( mIsLocal->isChecked() );
423 prof->setWriteBackFuture(mWriteBackFuture->isChecked());
424 prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value());
372 } 425 }
diff --git a/libkdepim/ksyncprefsdialog.h b/libkdepim/ksyncprefsdialog.h
index c663d22..8c2c59c 100644
--- a/libkdepim/ksyncprefsdialog.h
+++ b/libkdepim/ksyncprefsdialog.h
@@ -71,2 +71,3 @@ class KSyncPrefsDialog : public KDialog
71 void chooseFile(); 71 void chooseFile();
72 void chooseFileAB();
72 void slotOK(); 73 void slotOK();
@@ -100,10 +101,18 @@ class KSyncPrefsDialog : public KDialog
100 QLineEdit * mLocalTempFile; 101 QLineEdit * mLocalTempFile;
101 QWidget* mSetupSyncAlgTab;
102 102
103 QLineEdit * mRemotePostcommandAB;
104 QLineEdit * mRemotePrecommandAB;
105 QLineEdit * mRemoteFileAB;
106 QLineEdit * mLocalTempFileAB;
107
108
109 QWidget* mSetupSyncAlgTab;
103 QVBox* localFileWidget; 110 QVBox* localFileWidget;
104 QVBox* remoteFileWidget; 111 QVBox* remoteFileWidget;
105 QCheckBox* mWriteBackFile; 112 QCheckBox* mWriteBackFile;
106 QCheckBox* mWriteBackExisting; 113 QCheckBox* mWriteBackFuture;
107 QCheckBox* mAskForPreferences; 114 QSpinBox* mWriteBackFutureWeeks;
108 QCheckBox* mShowSummaryAfterSync; 115 QCheckBox* mWriteBackExisting;
116 QCheckBox* mAskForPreferences;
117 QCheckBox* mShowSummaryAfterSync;
109}; 118};
diff --git a/libkdepim/ksyncprofile.cpp b/libkdepim/ksyncprofile.cpp
index ea41a85..f34c309 100644
--- a/libkdepim/ksyncprofile.cpp
+++ b/libkdepim/ksyncprofile.cpp
@@ -49,2 +49,6 @@ KSyncProfile* KSyncProfile::clone()
49 myClone->setRemoteFileName( mRemoteFileName ); 49 myClone->setRemoteFileName( mRemoteFileName );
50 myClone->setPreSyncCommandAB( mPreSyncCommandAB );
51 myClone->setPostSyncCommandAB( mPostSyncCommandAB );
52 myClone->setLocalTempFileAB( mLocalTempFileAB);
53 myClone->setRemoteFileNameAB( mRemoteFileNameAB );
50 myClone->setShowSummaryAfterSync( mShowSummaryAfterSync ); 54 myClone->setShowSummaryAfterSync( mShowSummaryAfterSync );
@@ -53,2 +57,4 @@ KSyncProfile* KSyncProfile::clone()
53 myClone->setWriteBackFile( mWriteBackFile); 57 myClone->setWriteBackFile( mWriteBackFile);
58 myClone->setWriteBackFuture( mWriteBackFuture );
59 myClone->setWriteBackFutureWeeks( mWriteBackFutureWeeks );
54 myClone->setIncludeInRingSync( mIncludeInRingSync ); 60 myClone->setIncludeInRingSync( mIncludeInRingSync );
@@ -69,2 +75,6 @@ void KSyncProfile::setDefault()
69 mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics"; 75 mRemoteFileName = "/home/polo/kdepim/apps/korganizer/localfile.ics";
76 mPreSyncCommandAB = i18n("command for downloading remote file to local device");
77 mPostSyncCommandAB = i18n("command for uploading local temp file to remote device");
78 mLocalTempFileAB = "/tmp/std.vcf";
79 mRemoteFileNameAB = "/home/polo/kdepim/apps/kabc/localfile.vcf";
70 mShowSummaryAfterSync = true; 80 mShowSummaryAfterSync = true;
@@ -72,2 +82,4 @@ void KSyncProfile::setDefault()
72 mWriteBackExisting = false; 82 mWriteBackExisting = false;
83 mWriteBackFuture = false;
84 mWriteBackFutureWeeks = 12;
73 mWriteBackFile = true; 85 mWriteBackFile = true;
@@ -85,7 +97,13 @@ void KSyncProfile::readConfig(KConfig *config )
85 mPreSyncCommand = config->readEntry( prefix+ "PreSyncCommand",mPreSyncCommand ); 97 mPreSyncCommand = config->readEntry( prefix+ "PreSyncCommand",mPreSyncCommand );
86 mPostSyncCommand = config->readEntry( prefix+ "PostSyncCommand", mPostSyncCommand ); 98 mPostSyncCommand = config->readEntry( prefix+ "PostSyncCommand", mPostSyncCommand );;
87 mIncludeInRingSync = config->readBoolEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync );
88 mIncludeInRingSyncAB = config->readBoolEntry( prefix+ "IncludeInRingSyncAB",mIncludeInRingSyncAB );
89 mLocalTempFile = config->readEntry( prefix+ "LocalTempFile", mLocalTempFile ); 99 mLocalTempFile = config->readEntry( prefix+ "LocalTempFile", mLocalTempFile );
90 mRemoteFileName = config->readEntry( prefix+ "RemoteFileName", mRemoteFileName ); 100 mRemoteFileName = config->readEntry( prefix+ "RemoteFileName", mRemoteFileName );
101
102 mPreSyncCommandAB = config->readEntry( prefix+ "PreSyncCommandAB",mPreSyncCommandAB );
103 mPostSyncCommandAB = config->readEntry( prefix+ "PostSyncCommandAB", mPostSyncCommandAB );
104 mLocalTempFileAB = config->readEntry( prefix+ "LocalTempFileAB", mLocalTempFileAB );
105 mRemoteFileNameAB = config->readEntry( prefix+ "RemoteFileNameAB", mRemoteFileNameAB );
106
107 mIncludeInRingSync = config->readBoolEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync );
108 mIncludeInRingSyncAB = config->readBoolEntry( prefix+ "IncludeInRingSyncAB",mIncludeInRingSyncAB );
91 mShowSummaryAfterSync = config->readBoolEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync ); 109 mShowSummaryAfterSync = config->readBoolEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync );
@@ -93,3 +111,5 @@ void KSyncProfile::readConfig(KConfig *config )
93 mWriteBackExisting = config->readBoolEntry( prefix+ "WriteBackExisting",mWriteBackExisting ); 111 mWriteBackExisting = config->readBoolEntry( prefix+ "WriteBackExisting",mWriteBackExisting );
112 mWriteBackFuture = config->readBoolEntry( prefix+ "WriteBackFuture",mWriteBackFuture );
94 mSyncPrefs = config->readNumEntry( prefix+ "SyncPrefs", mSyncPrefs ); 113 mSyncPrefs = config->readNumEntry( prefix+ "SyncPrefs", mSyncPrefs );
114 mWriteBackFutureWeeks = config->readNumEntry( prefix+ "WriteBackFutureWeeks", mWriteBackFutureWeeks );
95 mIsLocalFileSync= config->readBoolEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync ); 115 mIsLocalFileSync= config->readBoolEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync );
@@ -103,6 +123,11 @@ void KSyncProfile::writeConfig( KConfig * config )
103 config->writeEntry( prefix+ "PostSyncCommand", mPostSyncCommand ); 123 config->writeEntry( prefix+ "PostSyncCommand", mPostSyncCommand );
104 config->writeEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync );
105 config->writeEntry( prefix+ "IncludeInRingSyncAB",mIncludeInRingSyncAB );
106 config->writeEntry( prefix+ "LocalTempFile", mLocalTempFile ); 124 config->writeEntry( prefix+ "LocalTempFile", mLocalTempFile );
107 config->writeEntry( prefix+ "RemoteFileName", mRemoteFileName ); 125 config->writeEntry( prefix+ "RemoteFileName", mRemoteFileName );
126
127 config->writeEntry( prefix+ "PreSyncCommandAB",mPreSyncCommandAB );
128 config->writeEntry( prefix+ "PostSyncCommandAB", mPostSyncCommandAB );
129 config->writeEntry( prefix+ "LocalTempFileAB", mLocalTempFileAB );
130 config->writeEntry( prefix+ "RemoteFileNameAB", mRemoteFileNameAB );
131 config->writeEntry( prefix+ "IncludeInRingSync",mIncludeInRingSync );
132 config->writeEntry( prefix+ "IncludeInRingSyncAB",mIncludeInRingSyncAB );
108 config->writeEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync ); 133 config->writeEntry( prefix+ "ShowSummaryAfterSync", mShowSummaryAfterSync );
@@ -110,3 +135,5 @@ void KSyncProfile::writeConfig( KConfig * config )
110 config->writeEntry( prefix+ "WriteBackExisting",mWriteBackExisting ); 135 config->writeEntry( prefix+ "WriteBackExisting",mWriteBackExisting );
136 config->writeEntry( prefix+ "WriteBackFuture",mWriteBackFuture );
111 config->writeEntry( prefix+ "SyncPrefs", mSyncPrefs ); 137 config->writeEntry( prefix+ "SyncPrefs", mSyncPrefs );
138 config->writeEntry( prefix+ "WriteBackFutureWeeks", mWriteBackFutureWeeks);
112 config->writeEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync ); 139 config->writeEntry( prefix+ "IsLocalFileSync", mIsLocalFileSync );
diff --git a/libkdepim/ksyncprofile.h b/libkdepim/ksyncprofile.h
index df1b49e..80094b1 100644
--- a/libkdepim/ksyncprofile.h
+++ b/libkdepim/ksyncprofile.h
@@ -61,3 +61,2 @@ class KSyncProfile : public QObject {
61 QString getPostSyncCommand( ) { return mPostSyncCommand;} 61 QString getPostSyncCommand( ) { return mPostSyncCommand;}
62
63 void setLocalTempFile( const QString& n ) { mLocalTempFile= n;} 62 void setLocalTempFile( const QString& n ) { mLocalTempFile= n;}
@@ -66,2 +65,12 @@ class KSyncProfile : public QObject {
66 QString getRemoteFileName( ) { return mRemoteFileName;} 65 QString getRemoteFileName( ) { return mRemoteFileName;}
66
67 void setPreSyncCommandAB( const QString& n ) {mPreSyncCommandAB = n;}
68 QString getPreSyncCommandAB( ) { return mPreSyncCommandAB; }
69 void setPostSyncCommandAB( const QString& n ) {mPostSyncCommandAB = n;}
70 QString getPostSyncCommandAB( ) { return mPostSyncCommandAB;}
71 void setLocalTempFileAB( const QString& n ) { mLocalTempFileAB= n;}
72 QString getLocalTempFileAB( ) { return mLocalTempFileAB;}
73 void setRemoteFileNameAB( const QString& n ) { mRemoteFileNameAB = n;}
74 QString getRemoteFileNameAB( ) { return mRemoteFileNameAB;}
75
67 /* 76 /*
@@ -77,2 +86,4 @@ class KSyncProfile : public QObject {
77 bool getWriteBackExisting( ) { return mWriteBackExisting;} 86 bool getWriteBackExisting( ) { return mWriteBackExisting;}
87 void setWriteBackFuture( bool b ) { mWriteBackFuture = b;}
88 bool getWriteBackFuture( ) { return mWriteBackFuture;}
78 void setWriteBackFile( bool b ) { mWriteBackFile= b;} 89 void setWriteBackFile( bool b ) { mWriteBackFile= b;}
@@ -85,2 +96,4 @@ class KSyncProfile : public QObject {
85 int getSyncPrefs( ) { return mSyncPrefs;} 96 int getSyncPrefs( ) { return mSyncPrefs;}
97 void setWriteBackFutureWeeks( int n ) { mWriteBackFutureWeeks= n;}
98 int getWriteBackFutureWeeks( ) { return mWriteBackFutureWeeks;}
86 void setIsLocalFileSync( bool b ) { mIsLocalFileSync= b;} 99 void setIsLocalFileSync( bool b ) { mIsLocalFileSync= b;}
@@ -94,2 +107,6 @@ class KSyncProfile : public QObject {
94 QString mRemoteFileName; 107 QString mRemoteFileName;
108 QString mPreSyncCommandAB;
109 QString mPostSyncCommandAB;
110 QString mLocalTempFileAB;
111 QString mRemoteFileNameAB;
95 bool mIncludeInRingSync; 112 bool mIncludeInRingSync;
@@ -99,2 +116,4 @@ class KSyncProfile : public QObject {
99 bool mWriteBackExisting; 116 bool mWriteBackExisting;
117 bool mWriteBackFuture;
118 int mWriteBackFutureWeeks;
100 bool mAskForPreferences; 119 bool mAskForPreferences;