Diffstat (limited to 'libkdepim/ksyncprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libkdepim/ksyncprefsdialog.cpp | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index a1eebec..6e6e631 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp | |||
@@ -145,8 +145,11 @@ void KSyncPrefsDialog::setupSyncAlgTab() | |||
145 | ++iii; | 145 | ++iii; |
146 | mIncludeInRingAB = new QCheckBox( i18n("Include in multiple addressbook sync"), topFrame ); | 146 | mIncludeInRingAB = new QCheckBox( i18n("Include in multiple addressbook sync"), topFrame ); |
147 | topLayout->addMultiCellWidget(mIncludeInRingAB, iii,iii,0,1); | 147 | topLayout->addMultiCellWidget(mIncludeInRingAB, iii,iii,0,1); |
148 | ++iii; | 148 | ++iii; |
149 | mIncludeInRingPWM = new QCheckBox( i18n("Include in multiple pwmanager sync"), topFrame ); | ||
150 | topLayout->addMultiCellWidget(mIncludeInRingPWM, iii,iii,0,1); | ||
151 | ++iii; | ||
149 | 152 | ||
150 | mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame ); | 153 | mAskForPreferences = new QCheckBox( i18n("Ask for preferences before sync"), topFrame ); |
151 | topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1); | 154 | topLayout->addMultiCellWidget(mAskForPreferences, iii,iii,0,1); |
152 | ++iii; | 155 | ++iii; |
@@ -223,40 +226,48 @@ void KSyncPrefsDialog::setupSyncAlgTab() | |||
223 | temphb = new QHBox( localFileWidget ); | 226 | temphb = new QHBox( localFileWidget ); |
224 | 227 | ||
225 | lab = new QLabel( i18n("Local file Cal:"), temphb ); | 228 | lab = new QLabel( i18n("Local file Cal:"), temphb ); |
226 | lab = new QLabel( i18n("Local file ABook:"), temphb ); | 229 | lab = new QLabel( i18n("Local file ABook:"), temphb ); |
230 | lab = new QLabel( i18n("Local file PWMgr:"), temphb ); | ||
227 | temphb = new QHBox( localFileWidget ); | 231 | temphb = new QHBox( localFileWidget ); |
228 | button = new QPushButton( i18n("Choose..."), temphb ); | 232 | button = new QPushButton( i18n("Choose..."), temphb ); |
229 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) ); | 233 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) ); |
230 | button = new QPushButton( i18n("Choose..."), temphb ); | 234 | button = new QPushButton( i18n("Choose..."), temphb ); |
231 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) ); | 235 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) ); |
236 | button = new QPushButton( i18n("Choose..."), temphb ); | ||
237 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFilePWM() ) ); | ||
232 | temphb = new QHBox( localFileWidget ); | 238 | temphb = new QHBox( localFileWidget ); |
233 | 239 | ||
234 | mRemoteFile = new QLineEdit( temphb); | 240 | mRemoteFile = new QLineEdit( temphb); |
235 | mRemoteFileAB = new QLineEdit( temphb); | 241 | mRemoteFileAB = new QLineEdit( temphb); |
242 | mRemoteFilePWM = new QLineEdit( temphb); | ||
236 | 243 | ||
237 | // *** remote | 244 | // *** remote |
238 | remoteFileWidget = new QVBox( topFrame); | 245 | remoteFileWidget = new QVBox( topFrame); |
239 | topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); | 246 | topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); |
240 | ++iii; | 247 | ++iii; |
241 | temphb = new QHBox( remoteFileWidget ); | 248 | temphb = new QHBox( remoteFileWidget ); |
242 | new QLabel( i18n("Calendar:"), temphb); | 249 | new QLabel( i18n("Calendar:"), temphb); |
243 | new QLabel( i18n("AddressBook:"), temphb); | 250 | new QLabel( i18n("AddressBook:"), temphb); |
251 | new QLabel( i18n("PWManager:"), temphb); | ||
244 | 252 | ||
245 | lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget); | 253 | lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget); |
246 | temphb = new QHBox( remoteFileWidget ); | 254 | temphb = new QHBox( remoteFileWidget ); |
247 | mRemotePrecommand = new QLineEdit(temphb); | 255 | mRemotePrecommand = new QLineEdit(temphb); |
248 | mRemotePrecommandAB = new QLineEdit(temphb); | 256 | mRemotePrecommandAB = new QLineEdit(temphb); |
257 | mRemotePrecommandPWM = new QLineEdit(temphb); | ||
249 | 258 | ||
250 | lab = new QLabel( i18n("Local temp file:"), remoteFileWidget); | 259 | lab = new QLabel( i18n("Local temp file:"), remoteFileWidget); |
251 | temphb = new QHBox( remoteFileWidget ); | 260 | temphb = new QHBox( remoteFileWidget ); |
252 | mLocalTempFile = new QLineEdit(temphb); | 261 | mLocalTempFile = new QLineEdit(temphb); |
253 | mLocalTempFileAB = new QLineEdit(temphb); | 262 | mLocalTempFileAB = new QLineEdit(temphb); |
263 | mLocalTempFilePWM = new QLineEdit(temphb); | ||
254 | 264 | ||
255 | lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget); | 265 | lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget); |
256 | temphb = new QHBox( remoteFileWidget ); | 266 | temphb = new QHBox( remoteFileWidget ); |
257 | mRemotePostcommand = new QLineEdit(temphb ); | 267 | mRemotePostcommand = new QLineEdit(temphb ); |
258 | mRemotePostcommandAB = new QLineEdit(temphb ); | 268 | mRemotePostcommandAB = new QLineEdit(temphb ); |
269 | mRemotePostcommandPWM = new QLineEdit(temphb ); | ||
259 | 270 | ||
260 | lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget); | 271 | lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget); |
261 | temphb = new QHBox( remoteFileWidget ); | 272 | temphb = new QHBox( remoteFileWidget ); |
262 | button = new QPushButton( i18n("ssh/scp"), temphb ); | 273 | button = new QPushButton( i18n("ssh/scp"), temphb ); |
@@ -300,14 +311,24 @@ void KSyncPrefsDialog::chooseFile() | |||
300 | void KSyncPrefsDialog::chooseFileAB() | 311 | void KSyncPrefsDialog::chooseFileAB() |
301 | { | 312 | { |
302 | QString fn = QDir::homeDirPath(); | 313 | QString fn = QDir::homeDirPath(); |
303 | 314 | ||
304 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); | 315 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.vcf)"), this ); |
305 | if ( fn == "" ) | 316 | if ( fn == "" ) |
306 | return; | 317 | return; |
307 | mRemoteFileAB->setText( fn ); | 318 | mRemoteFileAB->setText( fn ); |
308 | } | 319 | } |
309 | 320 | ||
321 | void KSyncPrefsDialog::chooseFilePWM() | ||
322 | { | ||
323 | QString fn = QDir::homeDirPath(); | ||
324 | |||
325 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.pwm)"), this ); | ||
326 | if ( fn == "" ) | ||
327 | return; | ||
328 | mRemoteFilePWM->setText( fn ); | ||
329 | } | ||
330 | |||
310 | void KSyncPrefsDialog::textChanged( const QString & s ) | 331 | void KSyncPrefsDialog::textChanged( const QString & s ) |
311 | { | 332 | { |
312 | if ( mProfileBox->count() == 0 ) | 333 | if ( mProfileBox->count() == 0 ) |
313 | return; | 334 | return; |
@@ -340,8 +361,13 @@ void KSyncPrefsDialog::profileChanged( int item ) | |||
340 | mRemotePostcommandAB->setText(prof->getPostSyncCommandAB()); | 361 | mRemotePostcommandAB->setText(prof->getPostSyncCommandAB()); |
341 | mLocalTempFileAB->setText(prof->getLocalTempFileAB()); | 362 | mLocalTempFileAB->setText(prof->getLocalTempFileAB()); |
342 | mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ; | 363 | mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ; |
343 | 364 | ||
365 | mRemotePrecommandPWM->setText(prof->getPreSyncCommandPWM()); | ||
366 | mRemotePostcommandPWM->setText(prof->getPostSyncCommandPWM()); | ||
367 | mLocalTempFilePWM->setText(prof->getLocalTempFilePWM()); | ||
368 | mRemoteFilePWM->setText(prof->getRemoteFileNamePWM()) ; | ||
369 | |||
344 | mWriteContactToSIM->setChecked( prof->getWriteContactToSIM()); | 370 | mWriteContactToSIM->setChecked( prof->getWriteContactToSIM()); |
345 | mPhoneDevice->setText(prof->getPhoneDevice()); | 371 | mPhoneDevice->setText(prof->getPhoneDevice()); |
346 | mPhoneConnection->setText(prof->getPhoneConnection()); | 372 | mPhoneConnection->setText(prof->getPhoneConnection()); |
347 | mPhoneModel->setText(prof->getPhoneModel()); | 373 | mPhoneModel->setText(prof->getPhoneModel()); |
@@ -351,8 +377,9 @@ void KSyncPrefsDialog::profileChanged( int item ) | |||
351 | mWriteBackExisting->setChecked( prof->getWriteBackExisting() ); | 377 | mWriteBackExisting->setChecked( prof->getWriteBackExisting() ); |
352 | mWriteBackFile->setChecked( prof->getWriteBackFile()); | 378 | mWriteBackFile->setChecked( prof->getWriteBackFile()); |
353 | mIncludeInRing->setChecked( prof->getIncludeInRingSync() ); | 379 | mIncludeInRing->setChecked( prof->getIncludeInRingSync() ); |
354 | mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() ); | 380 | mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() ); |
381 | mIncludeInRingPWM->setChecked( prof->getIncludeInRingSyncPWM() ); | ||
355 | mWriteBackFuture->setChecked( prof->getWriteBackFuture()); | 382 | mWriteBackFuture->setChecked( prof->getWriteBackFuture()); |
356 | mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() ); | 383 | mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() ); |
357 | 384 | ||
358 | switch ( prof->getSyncPrefs() ) { | 385 | switch ( prof->getSyncPrefs() ) { |
@@ -400,8 +427,11 @@ void KSyncPrefsDialog::fillSSH() | |||
400 | mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" ); | 427 | mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" ); |
401 | mRemotePrecommandAB->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); | 428 | mRemotePrecommandAB->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); |
402 | mLocalTempFileAB->setText("/tmp/std.vcf" ); | 429 | mLocalTempFileAB->setText("/tmp/std.vcf" ); |
403 | mRemotePostcommandAB->setText("scp /tmp/std.vcf zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf" ); | 430 | mRemotePostcommandAB->setText("scp /tmp/std.vcf zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf" ); |
431 | mRemotePrecommandPWM->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" ); | ||
432 | mLocalTempFilePWM->setText("/tmp/passwords.pwm" ); | ||
433 | mRemotePostcommandPWM->setText("scp /tmp/passwords.pwm zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/pwmanager.pwm" ); | ||
404 | } | 434 | } |
405 | void KSyncPrefsDialog::fillFTP() | 435 | void KSyncPrefsDialog::fillFTP() |
406 | { | 436 | { |
407 | mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" ); | 437 | mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" ); |
@@ -409,8 +439,12 @@ void KSyncPrefsDialog::fillFTP() | |||
409 | mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); | 439 | mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); |
410 | mRemotePrecommandAB->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf" ); | 440 | mRemotePrecommandAB->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf" ); |
411 | mLocalTempFileAB->setText("/tmp/std.vcf" ); | 441 | mLocalTempFileAB->setText("/tmp/std.vcf" ); |
412 | mRemotePostcommandAB->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); | 442 | mRemotePostcommandAB->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); |
443 | |||
444 | mRemotePrecommandPWM->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm" ); | ||
445 | mLocalTempFilePWM->setText("/tmp/passwords.pwm" ); | ||
446 | mRemotePostcommandPWM->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" ); | ||
413 | 447 | ||
414 | } | 448 | } |
415 | void KSyncPrefsDialog::kindChanged( bool b ) | 449 | void KSyncPrefsDialog::kindChanged( bool b ) |
416 | { | 450 | { |
@@ -460,14 +494,19 @@ void KSyncPrefsDialog::saveProfile() | |||
460 | prof->setPreSyncCommandAB( mRemotePrecommandAB->text()); | 494 | prof->setPreSyncCommandAB( mRemotePrecommandAB->text()); |
461 | prof->setPostSyncCommandAB( mRemotePostcommandAB->text() ); | 495 | prof->setPostSyncCommandAB( mRemotePostcommandAB->text() ); |
462 | prof->setLocalTempFileAB( mLocalTempFileAB->text()); | 496 | prof->setLocalTempFileAB( mLocalTempFileAB->text()); |
463 | prof->setRemoteFileNameAB( mRemoteFileAB->text() ); | 497 | prof->setRemoteFileNameAB( mRemoteFileAB->text() ); |
498 | prof->setPreSyncCommandPWM( mRemotePrecommandPWM->text()); | ||
499 | prof->setPostSyncCommandPWM( mRemotePostcommandPWM->text() ); | ||
500 | prof->setLocalTempFilePWM( mLocalTempFilePWM->text()); | ||
501 | prof->setRemoteFileNamePWM( mRemoteFilePWM->text() ); | ||
464 | prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() ); | 502 | prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() ); |
465 | prof->setAskForPreferences( mAskForPreferences->isChecked()); | 503 | prof->setAskForPreferences( mAskForPreferences->isChecked()); |
466 | prof->setWriteBackExisting(mWriteBackExisting->isChecked() ); | 504 | prof->setWriteBackExisting(mWriteBackExisting->isChecked() ); |
467 | prof->setWriteBackFile( mWriteBackFile->isChecked()); | 505 | prof->setWriteBackFile( mWriteBackFile->isChecked()); |
468 | prof->setIncludeInRingSync( mIncludeInRing->isChecked() ); | 506 | prof->setIncludeInRingSync( mIncludeInRing->isChecked() ); |
469 | prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() ); | 507 | prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() ); |
508 | prof->setIncludeInRingSyncPWM( mIncludeInRingPWM->isChecked() ); | ||
470 | int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ; | 509 | int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ; |
471 | prof->setSyncPrefs( syncprefs); | 510 | prof->setSyncPrefs( syncprefs); |
472 | prof->setIsLocalFileSync( mIsLocal->isChecked() ); | 511 | prof->setIsLocalFileSync( mIsLocal->isChecked() ); |
473 | prof->setIsPhoneSync( mIsPhone->isChecked() ); | 512 | prof->setIsPhoneSync( mIsPhone->isChecked() ); |