Diffstat (limited to 'libkdepim/ksyncprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libkdepim/ksyncprefsdialog.cpp | 70 |
1 files changed, 68 insertions, 2 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index 28aac45..f05c846 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp | |||
@@ -187,16 +187,18 @@ void KSyncPrefsDialog::setupSyncAlgTab() | |||
187 | 187 | ||
188 | proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); | 188 | proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); |
189 | gr = proGr; | 189 | gr = proGr; |
190 | topLayout->addMultiCellWidget(gr, iii,iii,0,1); | 190 | topLayout->addMultiCellWidget(gr, iii,iii,0,1); |
191 | ++iii; | 191 | ++iii; |
192 | mIsLocal = new QRadioButton ( i18n("Local file"), gr ); | 192 | mIsLocal = new QRadioButton ( i18n("Local file"), gr ); |
193 | mIsPi = new QRadioButton ( i18n("Quick Pi-Sync"), gr ); | ||
194 | connect (mIsPi, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); | ||
193 | mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr ); | 195 | mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr ); |
194 | connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); | 196 | connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); |
195 | mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr ); | 197 | mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr ); |
196 | connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); | 198 | connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); |
197 | 199 | ||
198 | 200 | ||
199 | phoneWidget = new QVBox( topFrame); | 201 | phoneWidget = new QVBox( topFrame); |
200 | topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1); | 202 | topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1); |
201 | ++iii; | 203 | ++iii; |
202 | mWriteContactToSIM= new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget ); | 204 | mWriteContactToSIM= new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget ); |
@@ -273,15 +275,46 @@ void KSyncPrefsDialog::setupSyncAlgTab() | |||
273 | temphb = new QHBox( remoteFileWidget ); | 275 | temphb = new QHBox( remoteFileWidget ); |
274 | button = new QPushButton( i18n("ssh/scp"), temphb ); | 276 | button = new QPushButton( i18n("ssh/scp"), temphb ); |
275 | connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) ); | 277 | connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) ); |
276 | button = new QPushButton( i18n("ftp"), temphb ); | 278 | button = new QPushButton( i18n("ftp"), temphb ); |
277 | connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) ); | 279 | connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) ); |
278 | lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget); | 280 | lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget); |
279 | 281 | ||
282 | // *** pi-sync | ||
283 | piWidget = new QVBox( topFrame); | ||
284 | topLayout->addMultiCellWidget(piWidget, iii,iii,0,1); | ||
285 | ++iii; | ||
286 | temphb = new QHBox( piWidget ); | ||
287 | new QLabel( i18n("Calendar:"), temphb); | ||
288 | new QLabel( i18n("AddressBook:"), temphb); | ||
289 | new QLabel( i18n("PWManager:"), temphb); | ||
290 | |||
291 | lab = new QLabel( i18n("Password for remote access:"), piWidget); | ||
292 | temphb = new QHBox( piWidget ); | ||
293 | mRemotePw = new QLineEdit(temphb); | ||
294 | mRemotePwAB = new QLineEdit(temphb); | ||
295 | mRemotePwPWM = new QLineEdit(temphb); | ||
296 | |||
297 | lab = new QLabel( i18n("Remote IP address:"), piWidget); | ||
298 | temphb = new QHBox( piWidget ); | ||
299 | mRemoteIP = new QLineEdit(temphb); | ||
300 | mRemoteIPAB = new QLineEdit(temphb); | ||
301 | mRemoteIPPWM = new QLineEdit(temphb); | ||
302 | |||
303 | lab = new QLabel( i18n("Remote port number:"), piWidget); | ||
304 | temphb = new QHBox( piWidget ); | ||
305 | mRemotePort = new QLineEdit(temphb); | ||
306 | mRemotePortAB = new QLineEdit(temphb); | ||
307 | mRemotePortPWM = new QLineEdit(temphb); | ||
280 | 308 | ||
281 | } | 309 | } |
310 | |||
311 | |||
312 | |||
313 | |||
314 | |||
282 | void KSyncPrefsDialog::slotOK() | 315 | void KSyncPrefsDialog::slotOK() |
283 | { | 316 | { |
284 | if ( mMyMachineName->text() == "undefined" ) { | 317 | if ( mMyMachineName->text() == "undefined" ) { |
285 | KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error")); | 318 | KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error")); |
286 | return; | 319 | return; |
287 | } | 320 | } |
@@ -350,12 +383,25 @@ void KSyncPrefsDialog::profileChanged( int item ) | |||
350 | { | 383 | { |
351 | //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() ); | 384 | //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() ); |
352 | KSyncProfile* prof; | 385 | KSyncProfile* prof; |
353 | saveProfile(); | 386 | saveProfile(); |
354 | currentSelection = item; | 387 | currentSelection = item; |
355 | prof = mSyncProfiles.at(item) ; | 388 | prof = mSyncProfiles.at(item) ; |
389 | |||
390 | mRemotePw->setText(prof->getRemotePw()); | ||
391 | mRemoteIP->setText(prof->getRemoteIP()); | ||
392 | mRemotePort->setText(prof->getRemotePort()); | ||
393 | |||
394 | mRemotePwAB->setText(prof->getRemotePwAB()); | ||
395 | mRemoteIPAB->setText(prof->getRemoteIPAB()); | ||
396 | mRemotePortAB->setText(prof->getRemotePortAB()); | ||
397 | |||
398 | mRemotePwPWM->setText(prof->getRemotePwPWM()); | ||
399 | mRemoteIPPWM->setText(prof->getRemoteIPPWM()); | ||
400 | mRemotePortPWM->setText(prof->getRemotePortPWM()); | ||
401 | |||
356 | mRemotePrecommand->setText(prof->getPreSyncCommand()); | 402 | mRemotePrecommand->setText(prof->getPreSyncCommand()); |
357 | mRemotePostcommand->setText(prof->getPostSyncCommand()); | 403 | mRemotePostcommand->setText(prof->getPostSyncCommand()); |
358 | mLocalTempFile->setText(prof->getLocalTempFile()); | 404 | mLocalTempFile->setText(prof->getLocalTempFile()); |
359 | mRemoteFile->setText(prof->getRemoteFileName()) ; | 405 | mRemoteFile->setText(prof->getRemoteFileName()) ; |
360 | 406 | ||
361 | mRemotePrecommandAB->setText(prof->getPreSyncCommandAB()); | 407 | mRemotePrecommandAB->setText(prof->getPreSyncCommandAB()); |
@@ -413,12 +459,13 @@ void KSyncPrefsDialog::profileChanged( int item ) | |||
413 | mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() ); | 459 | mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() ); |
414 | proGr->setEnabled( item > 2 ); | 460 | proGr->setEnabled( item > 2 ); |
415 | if ( item < 3 ) { | 461 | if ( item < 3 ) { |
416 | localFileWidget->hide(); | 462 | localFileWidget->hide(); |
417 | remoteFileWidget->hide(); | 463 | remoteFileWidget->hide(); |
418 | phoneWidget->hide(); | 464 | phoneWidget->hide(); |
465 | piWidget->hide(); | ||
419 | 466 | ||
420 | } else | 467 | } else |
421 | kindChanged( prof->getIsLocalFileSync() ); | 468 | kindChanged( prof->getIsLocalFileSync() ); |
422 | } | 469 | } |
423 | 470 | ||
424 | void KSyncPrefsDialog::fillSSH() | 471 | void KSyncPrefsDialog::fillSSH() |
@@ -463,12 +510,18 @@ void KSyncPrefsDialog::kindChanged( bool b ) | |||
463 | if ( mIsPhone->isChecked () ) { | 510 | if ( mIsPhone->isChecked () ) { |
464 | phoneWidget->show(); | 511 | phoneWidget->show(); |
465 | } | 512 | } |
466 | else { | 513 | else { |
467 | phoneWidget->hide(); | 514 | phoneWidget->hide(); |
468 | } | 515 | } |
516 | if ( mIsPi->isChecked () ) { | ||
517 | piWidget->show(); | ||
518 | } | ||
519 | else { | ||
520 | piWidget->hide(); | ||
521 | } | ||
469 | 522 | ||
470 | } | 523 | } |
471 | void KSyncPrefsDialog::deleteProfile() | 524 | void KSyncPrefsDialog::deleteProfile() |
472 | { | 525 | { |
473 | //qDebug("KSyncPrefsDialog::deleteProfile() "); | 526 | //qDebug("KSyncPrefsDialog::deleteProfile() "); |
474 | if ( currentSelection >= 0 ) { | 527 | if ( currentSelection >= 0 ) { |
@@ -485,12 +538,25 @@ void KSyncPrefsDialog::deleteProfile() | |||
485 | 538 | ||
486 | void KSyncPrefsDialog::saveProfile() | 539 | void KSyncPrefsDialog::saveProfile() |
487 | { | 540 | { |
488 | KSyncProfile* prof; | 541 | KSyncProfile* prof; |
489 | if ( currentSelection >= 0 ) { | 542 | if ( currentSelection >= 0 ) { |
490 | prof = mSyncProfiles.at(currentSelection) ; | 543 | prof = mSyncProfiles.at(currentSelection) ; |
544 | |||
545 | prof->setRemotePw( mRemotePw->text()); | ||
546 | prof->setRemoteIP( mRemoteIP->text()); | ||
547 | prof->setRemotePort( mRemotePort->text()); | ||
548 | |||
549 | prof->setRemotePwAB( mRemotePwAB->text()); | ||
550 | prof->setRemoteIPAB( mRemoteIPAB->text()); | ||
551 | prof->setRemotePortAB( mRemotePortAB->text()); | ||
552 | |||
553 | prof->setRemotePwPWM( mRemotePwPWM->text()); | ||
554 | prof->setRemoteIPPWM( mRemoteIPPWM->text()); | ||
555 | prof->setRemotePortPWM( mRemotePortPWM->text()); | ||
556 | |||
491 | prof->setPreSyncCommand( mRemotePrecommand->text()); | 557 | prof->setPreSyncCommand( mRemotePrecommand->text()); |
492 | prof->setPostSyncCommand( mRemotePostcommand->text() ); | 558 | prof->setPostSyncCommand( mRemotePostcommand->text() ); |
493 | prof->setLocalTempFile( mLocalTempFile->text()); | 559 | prof->setLocalTempFile( mLocalTempFile->text()); |
494 | prof->setRemoteFileName( mRemoteFile->text() ); | 560 | prof->setRemoteFileName( mRemoteFile->text() ); |
495 | prof->setPreSyncCommandAB( mRemotePrecommandAB->text()); | 561 | prof->setPreSyncCommandAB( mRemotePrecommandAB->text()); |
496 | prof->setPostSyncCommandAB( mRemotePostcommandAB->text() ); | 562 | prof->setPostSyncCommandAB( mRemotePostcommandAB->text() ); |