summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncprefsdialog.cpp
Unidiff
Diffstat (limited to 'libkdepim/ksyncprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncprefsdialog.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp
index 6f46d19..2b87298 100644
--- a/libkdepim/ksyncprefsdialog.cpp
+++ b/libkdepim/ksyncprefsdialog.cpp
@@ -458,97 +458,96 @@ void KSyncPrefsDialog::readFilter()
458 temp.prepend(i18n("No Filter") ); 458 temp.prepend(i18n("No Filter") );
459 mFilterOutAB->insertStringList( temp ); 459 mFilterOutAB->insertStringList( temp );
460 mFilterInAB->insertStringList( temp ); 460 mFilterInAB->insertStringList( temp );
461} 461}
462 462
463void KSyncPrefsDialog::slotOK() 463void KSyncPrefsDialog::slotOK()
464{ 464{
465 if ( mMyMachineName->text() == "undefined" ) { 465 if ( mMyMachineName->text() == "undefined" ) {
466 KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error")); 466 KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error"));
467 return; 467 return;
468 } 468 }
469 int i; 469 int i;
470 for (i = 0; i < mSyncProfileNames.count(); ++ i) { 470 for (i = 0; i < mSyncProfileNames.count(); ++ i) {
471 if ( mSyncProfileNames.contains( mSyncProfileNames[i]) > 1 ) { 471 if ( mSyncProfileNames.contains( mSyncProfileNames[i]) > 1 ) {
472 KMessageBox::error(this,i18n("Multiple profiles with same name!\nPlease use unique profile names!"),i18n("KO/Pi config error")); 472 KMessageBox::error(this,i18n("Multiple profiles with same name!\nPlease use unique profile names!"),i18n("KO/Pi config error"));
473 return; 473 return;
474 } 474 }
475 } 475 }
476 usrWriteConfig(); 476 usrWriteConfig();
477 QDialog::accept(); 477 QDialog::accept();
478} 478}
479void KSyncPrefsDialog::accept() 479void KSyncPrefsDialog::accept()
480{ 480{
481 slotOK(); 481 slotOK();
482} 482}
483void KSyncPrefsDialog::chooseFile() 483void KSyncPrefsDialog::chooseFile()
484{ 484{
485 QString fn = QDir::homeDirPath(); 485 QString fn = QDir::homeDirPath();
486 486
487 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); 487 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this );
488 if ( fn == "" ) 488 if ( fn == "" )
489 return; 489 return;
490 mRemoteFile->setText( fn ); 490 mRemoteFile->setText( fn );
491} 491}
492 492
493void KSyncPrefsDialog::chooseFileAB() 493void KSyncPrefsDialog::chooseFileAB()
494{ 494{
495 QString fn = QDir::homeDirPath(); 495 QString fn = QDir::homeDirPath();
496 496
497 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.vcf)"), this ); 497 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.vcf)"), this );
498 if ( fn == "" ) 498 if ( fn == "" )
499 return; 499 return;
500 mRemoteFileAB->setText( fn ); 500 mRemoteFileAB->setText( fn );
501} 501}
502 502
503void KSyncPrefsDialog::chooseFilePWM() 503void KSyncPrefsDialog::chooseFilePWM()
504{ 504{
505 QString fn = QDir::homeDirPath(); 505 QString fn = QDir::homeDirPath();
506
507 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.pwm)"), this ); 506 fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.pwm)"), this );
508 if ( fn == "" ) 507 if ( fn == "" )
509 return; 508 return;
510 mRemoteFilePWM->setText( fn ); 509 mRemoteFilePWM->setText( fn );
511} 510}
512void KSyncPrefsDialog::updateMyCaption() 511void KSyncPrefsDialog::updateMyCaption()
513{ 512{
514 setCaption( mProfileBox->currentText() + " : " +i18n("Synchronization Preferences")); 513 setCaption( mProfileBox->currentText() + " : " +i18n("Synchronization Preferences"));
515} 514}
516void KSyncPrefsDialog::textChanged( const QString & s ) 515void KSyncPrefsDialog::textChanged( const QString & s )
517{ 516{
518 if ( mProfileBox->count() == 0 ) 517 if ( mProfileBox->count() == 0 )
519 return; 518 return;
520 if ( currentSelection < 3 ) { 519 if ( currentSelection < 3 ) {
521 //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error")); 520 //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error"));
522 mProfileBox->blockSignals( true ); 521 mProfileBox->blockSignals( true );
523 mProfileBox->setCurrentItem(mProfileBox-> currentItem ()); 522 mProfileBox->setCurrentItem(mProfileBox-> currentItem ());
524 mProfileBox->blockSignals( false ); 523 mProfileBox->blockSignals( false );
525 return; 524 return;
526 } 525 }
527 //qDebug("cur i %d ",mProfileBox-> currentItem () ); 526 //qDebug("cur i %d ",mProfileBox-> currentItem () );
528 mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ; 527 mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ;
529 KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ; 528 KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ;
530 prof->setName( s ); 529 prof->setName( s );
531 mSyncProfileNames[mProfileBox-> currentItem ()] = s; 530 mSyncProfileNames[mProfileBox-> currentItem ()] = s;
532 updateMyCaption(); 531 updateMyCaption();
533} 532}
534void KSyncPrefsDialog::profileChanged( int item ) 533void KSyncPrefsDialog::profileChanged( int item )
535{ 534{
536 //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() ); 535 //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() );
537 KSyncProfile* prof; 536 KSyncProfile* prof;
538 saveProfile(); 537 saveProfile();
539 readFilter(); 538 readFilter();
540 readResources(); 539 readResources();
541 currentSelection = item; 540 currentSelection = item;
542 prof = mSyncProfiles.at(item) ; 541 prof = mSyncProfiles.at(item) ;
543 542
544 mRemotePw->setText(prof->getRemotePw()); 543 mRemotePw->setText(prof->getRemotePw());
545 mRemoteIP->setText(prof->getRemoteIP()); 544 mRemoteIP->setText(prof->getRemoteIP());
546 mRemotePort->setText(prof->getRemotePort()); 545 mRemotePort->setText(prof->getRemotePort());
547 546
548 mRemotePwAB->setText(prof->getRemotePwAB()); 547 mRemotePwAB->setText(prof->getRemotePwAB());
549 mRemoteIPAB->setText(prof->getRemoteIPAB()); 548 mRemoteIPAB->setText(prof->getRemoteIPAB());
550 mRemotePortAB->setText(prof->getRemotePortAB()); 549 mRemotePortAB->setText(prof->getRemotePortAB());
551 550
552 mRemotePwPWM->setText(prof->getRemotePwPWM()); 551 mRemotePwPWM->setText(prof->getRemotePwPWM());
553 mRemoteIPPWM->setText(prof->getRemoteIPPWM()); 552 mRemoteIPPWM->setText(prof->getRemoteIPPWM());
554 mRemotePortPWM->setText(prof->getRemotePortPWM()); 553 mRemotePortPWM->setText(prof->getRemotePortPWM());