summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncprefsdialog.cpp
Unidiff
Diffstat (limited to 'libkdepim/ksyncprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncprefsdialog.cpp77
1 files changed, 65 insertions, 12 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 }