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
@@ -314,385 +314,384 @@ void KSyncPrefsDialog::setupSyncAlgTab()
314 314
315 // *** remote******************************* 315 // *** remote*******************************
316 remoteFileWidget = new QVBox( topFrame); 316 remoteFileWidget = new QVBox( topFrame);
317 //topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); 317 //topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1);
318 //++iii; 318 //++iii;
319 temphb = new QHBox( remoteFileWidget ); 319 temphb = new QHBox( remoteFileWidget );
320 new QLabel( i18n("Calendar:"), temphb); 320 new QLabel( i18n("Calendar:"), temphb);
321 new QLabel( i18n("AddressBook:"), temphb); 321 new QLabel( i18n("AddressBook:"), temphb);
322 new QLabel( i18n("PWManager:"), temphb); 322 new QLabel( i18n("PWManager:"), temphb);
323 323
324 lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget); 324 lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget);
325 temphb = new QHBox( remoteFileWidget ); 325 temphb = new QHBox( remoteFileWidget );
326 mRemotePrecommand = new QLineEdit(temphb); 326 mRemotePrecommand = new QLineEdit(temphb);
327 mRemotePrecommandAB = new QLineEdit(temphb); 327 mRemotePrecommandAB = new QLineEdit(temphb);
328 mRemotePrecommandPWM = new QLineEdit(temphb); 328 mRemotePrecommandPWM = new QLineEdit(temphb);
329 329
330 lab = new QLabel( i18n("Local temp file:"), remoteFileWidget); 330 lab = new QLabel( i18n("Local temp file:"), remoteFileWidget);
331 temphb = new QHBox( remoteFileWidget ); 331 temphb = new QHBox( remoteFileWidget );
332 mLocalTempFile = new QLineEdit(temphb); 332 mLocalTempFile = new QLineEdit(temphb);
333 mLocalTempFileAB = new QLineEdit(temphb); 333 mLocalTempFileAB = new QLineEdit(temphb);
334 mLocalTempFilePWM = new QLineEdit(temphb); 334 mLocalTempFilePWM = new QLineEdit(temphb);
335 335
336 lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget); 336 lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget);
337 temphb = new QHBox( remoteFileWidget ); 337 temphb = new QHBox( remoteFileWidget );
338 mRemotePostcommand = new QLineEdit(temphb ); 338 mRemotePostcommand = new QLineEdit(temphb );
339 mRemotePostcommandAB = new QLineEdit(temphb ); 339 mRemotePostcommandAB = new QLineEdit(temphb );
340 mRemotePostcommandPWM = new QLineEdit(temphb ); 340 mRemotePostcommandPWM = new QLineEdit(temphb );
341 mIsKapiFileR = new QCheckBox( i18n("Addressbook file is used by KA/Pi"), remoteFileWidget ); 341 mIsKapiFileR = new QCheckBox( i18n("Addressbook file is used by KA/Pi"), remoteFileWidget );
342 lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget); 342 lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget);
343 temphb = new QHBox( remoteFileWidget ); 343 temphb = new QHBox( remoteFileWidget );
344 button = new QPushButton( i18n("ssh/scp"), temphb ); 344 button = new QPushButton( i18n("ssh/scp"), temphb );
345 connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) ); 345 connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) );
346 button = new QPushButton( i18n("ftp"), temphb ); 346 button = new QPushButton( i18n("ftp"), temphb );
347 connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) ); 347 connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) );
348 lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget); 348 lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget);
349 349
350 // *** pi-sync******************************* 350 // *** pi-sync*******************************
351 piWidget = new QVBox( topFrame); 351 piWidget = new QVBox( topFrame);
352 //topLayout->addMultiCellWidget(piWidget, iii,iii,0,1); 352 //topLayout->addMultiCellWidget(piWidget, iii,iii,0,1);
353 //++iii; 353 //++iii;
354 temphb = new QHBox( piWidget ); 354 temphb = new QHBox( piWidget );
355 new QLabel( i18n("Calendar:"), temphb); 355 new QLabel( i18n("Calendar:"), temphb);
356 new QLabel( i18n("AddressBook:"), temphb); 356 new QLabel( i18n("AddressBook:"), temphb);
357 new QLabel( i18n("PWManager:"), temphb); 357 new QLabel( i18n("PWManager:"), temphb);
358 358
359 lab = new QLabel( i18n("Password for remote access: (could be the same for each)"), piWidget); 359 lab = new QLabel( i18n("Password for remote access: (could be the same for each)"), piWidget);
360 temphb = new QHBox( piWidget ); 360 temphb = new QHBox( piWidget );
361 mRemotePw = new QLineEdit(temphb); 361 mRemotePw = new QLineEdit(temphb);
362 mRemotePwAB = new QLineEdit(temphb); 362 mRemotePwAB = new QLineEdit(temphb);
363 mRemotePwPWM = new QLineEdit(temphb); 363 mRemotePwPWM = new QLineEdit(temphb);
364 364
365 lab = new QLabel( i18n("Remote IP address: (could be the same for each)"), piWidget); 365 lab = new QLabel( i18n("Remote IP address: (could be the same for each)"), piWidget);
366 temphb = new QHBox( piWidget ); 366 temphb = new QHBox( piWidget );
367 mRemoteIP = new QLineEdit(temphb); 367 mRemoteIP = new QLineEdit(temphb);
368 mRemoteIPAB = new QLineEdit(temphb); 368 mRemoteIPAB = new QLineEdit(temphb);
369 mRemoteIPPWM = new QLineEdit(temphb); 369 mRemoteIPPWM = new QLineEdit(temphb);
370 370
371 lab = new QLabel( i18n("Remote port number: (should be different for each)"), piWidget); 371 lab = new QLabel( i18n("Remote port number: (should be different for each)"), piWidget);
372 temphb = new QHBox( piWidget ); 372 temphb = new QHBox( piWidget );
373 mRemotePort = new QLineEdit(temphb); 373 mRemotePort = new QLineEdit(temphb);
374 mRemotePortAB = new QLineEdit(temphb); 374 mRemotePortAB = new QLineEdit(temphb);
375 mRemotePortPWM = new QLineEdit(temphb); 375 mRemotePortPWM = new QLineEdit(temphb);
376 376
377 lab = new QLabel( i18n("Local/remote Resource sync partners (Leave empty to not sync)"), piWidget); 377 lab = new QLabel( i18n("Local/remote Resource sync partners (Leave empty to not sync)"), piWidget);
378 mTableBox = new QHBox( piWidget ); 378 mTableBox = new QHBox( piWidget );
379 mResTableKopi = new QTable( 1, 1, mTableBox ); 379 mResTableKopi = new QTable( 1, 1, mTableBox );
380 mResTableKapi = new QTable( 1, 1, mTableBox ); 380 mResTableKapi = new QTable( 1, 1, mTableBox );
381 mResTablePwmpi = new QTable( 1, 1, mTableBox ); 381 mResTablePwmpi = new QTable( 1, 1, mTableBox );
382 mResTableKopi->horizontalHeader()->setLabel( 0, i18n("Remote") ); 382 mResTableKopi->horizontalHeader()->setLabel( 0, i18n("Remote") );
383 mResTableKapi->horizontalHeader()->setLabel( 0, i18n("Remote") ); 383 mResTableKapi->horizontalHeader()->setLabel( 0, i18n("Remote") );
384 mResTablePwmpi->horizontalHeader()->setLabel( 0, i18n("Remote") ); 384 mResTablePwmpi->horizontalHeader()->setLabel( 0, i18n("Remote") );
385 mResTableKopi->setLeftMargin( 80 ); 385 mResTableKopi->setLeftMargin( 80 );
386 mResTableKapi->setLeftMargin( 80 ); 386 mResTableKapi->setLeftMargin( 80 );
387 } 387 }
388 // ****************************************** 388 // ******************************************
389 // Profile kind specific settings END 389 // Profile kind specific settings END
390 390
391} 391}
392 392
393void KSyncPrefsDialog::readResources() 393void KSyncPrefsDialog::readResources()
394{ 394{
395 mResourcesKopi.clear(); 395 mResourcesKopi.clear();
396 KConfig fc(locateLocal("config","kopicalendarrc")); 396 KConfig fc(locateLocal("config","kopicalendarrc"));
397 fc.setGroup("CC"); 397 fc.setGroup("CC");
398 int numCals = fc.readNumEntry("NumberCalendars",0 ); 398 int numCals = fc.readNumEntry("NumberCalendars",0 );
399 int curCal = 1; 399 int curCal = 1;
400 while ( curCal <= numCals ) { 400 while ( curCal <= numCals ) {
401 QString prefix = "Cal_" +QString::number( curCal ); 401 QString prefix = "Cal_" +QString::number( curCal );
402 QString name = fc.readEntry( prefix+"_Name", "Calendar"); 402 QString name = fc.readEntry( prefix+"_Name", "Calendar");
403 mResourcesKopi.append( name ); 403 mResourcesKopi.append( name );
404 ++curCal; 404 ++curCal;
405 } 405 }
406 mResTableKopi->setNumRows( mResourcesKopi.count() ); 406 mResTableKopi->setNumRows( mResourcesKopi.count() );
407 int i; 407 int i;
408 for ( i = 0;i < mResourcesKopi.count(); ++i ) { 408 for ( i = 0;i < mResourcesKopi.count(); ++i ) {
409 mResTableKopi->verticalHeader ()->setLabel( i, mResourcesKopi[i] ); 409 mResTableKopi->verticalHeader ()->setLabel( i, mResourcesKopi[i] );
410 } 410 }
411 411
412 mResourcesKapi.clear(); 412 mResourcesKapi.clear();
413 413
414 KConfig conf ( locateLocal("config", "kabcrc") ); 414 KConfig conf ( locateLocal("config", "kabcrc") );
415 415
416 conf.setGroup( "General" ); 416 conf.setGroup( "General" );
417 417
418 QStringList keys = conf.readListEntry( "ResourceKeys" ); 418 QStringList keys = conf.readListEntry( "ResourceKeys" );
419 //keys += conf->readListEntry( "PassiveResourceKeys" ); 419 //keys += conf->readListEntry( "PassiveResourceKeys" );
420 420
421 //QString standardKey = mConfig->readEntry( "Standard" ); 421 //QString standardKey = mConfig->readEntry( "Standard" );
422 422
423 for ( QStringList::Iterator it = keys.begin(); it != keys.end(); ++it ) { 423 for ( QStringList::Iterator it = keys.begin(); it != keys.end(); ++it ) {
424 conf.setGroup("Resource_"+ (*it) ); 424 conf.setGroup("Resource_"+ (*it) );
425 QString name = conf.readEntry( "ResourceName" ); 425 QString name = conf.readEntry( "ResourceName" );
426 mResourcesKapi.append( name ); 426 mResourcesKapi.append( name );
427 } 427 }
428 mResTableKapi->setNumRows( mResourcesKapi.count() ); 428 mResTableKapi->setNumRows( mResourcesKapi.count() );
429 for ( i = 0;i < mResourcesKopi.count(); ++i ) { 429 for ( i = 0;i < mResourcesKopi.count(); ++i ) {
430 mResTableKapi->verticalHeader ()->setLabel( i, mResourcesKapi[i] ); 430 mResTableKapi->verticalHeader ()->setLabel( i, mResourcesKapi[i] );
431 } 431 }
432 432
433 433
434} 434}
435void KSyncPrefsDialog::readFilter() 435void KSyncPrefsDialog::readFilter()
436{ 436{
437 mFilterKapi.clear(); 437 mFilterKapi.clear();
438 mFilterKopi.clear(); 438 mFilterKopi.clear();
439 KConfig cfgko(locateLocal("config","korganizerrc")); 439 KConfig cfgko(locateLocal("config","korganizerrc"));
440 KConfig cfgka(locateLocal("config","kaddressbookrc")); 440 KConfig cfgka(locateLocal("config","kaddressbookrc"));
441 cfgko.setGroup("General"); 441 cfgko.setGroup("General");
442 mFilterKopi = cfgko.readListEntry("CalendarFilters"); 442 mFilterKopi = cfgko.readListEntry("CalendarFilters");
443 cfgka.setGroup("Filter"); 443 cfgka.setGroup("Filter");
444 int count = cfgka.readNumEntry( "Count", 0 ); 444 int count = cfgka.readNumEntry( "Count", 0 );
445 for ( int i = 0; i < count; i++ ) { 445 for ( int i = 0; i < count; i++ ) {
446 cfgka.setGroup("Filter_"+QString::number( i ) ); 446 cfgka.setGroup("Filter_"+QString::number( i ) );
447 mFilterKapi.append( cfgka.readEntry("Name", "internal error") ); 447 mFilterKapi.append( cfgka.readEntry("Name", "internal error") );
448 } 448 }
449 mFilterOutCal->clear(); 449 mFilterOutCal->clear();
450 mFilterInCal->clear(); 450 mFilterInCal->clear();
451 mFilterOutAB->clear(); 451 mFilterOutAB->clear();
452 mFilterInAB->clear(); 452 mFilterInAB->clear();
453 QStringList temp = mFilterKopi; 453 QStringList temp = mFilterKopi;
454 temp.prepend(i18n("No Filter") ); 454 temp.prepend(i18n("No Filter") );
455 mFilterOutCal->insertStringList( temp ); 455 mFilterOutCal->insertStringList( temp );
456 mFilterInCal->insertStringList( temp ); 456 mFilterInCal->insertStringList( temp );
457 temp = mFilterKapi; 457 temp = mFilterKapi;
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());
555 554
556 mRemotePrecommand->setText(prof->getPreSyncCommand()); 555 mRemotePrecommand->setText(prof->getPreSyncCommand());
557 mRemotePostcommand->setText(prof->getPostSyncCommand()); 556 mRemotePostcommand->setText(prof->getPostSyncCommand());
558 mLocalTempFile->setText(prof->getLocalTempFile()); 557 mLocalTempFile->setText(prof->getLocalTempFile());
559 mRemoteFile->setText(prof->getRemoteFileName()) ; 558 mRemoteFile->setText(prof->getRemoteFileName()) ;
560 559
561 mRemotePrecommandAB->setText(prof->getPreSyncCommandAB()); 560 mRemotePrecommandAB->setText(prof->getPreSyncCommandAB());
562 mRemotePostcommandAB->setText(prof->getPostSyncCommandAB()); 561 mRemotePostcommandAB->setText(prof->getPostSyncCommandAB());
563 mLocalTempFileAB->setText(prof->getLocalTempFileAB()); 562 mLocalTempFileAB->setText(prof->getLocalTempFileAB());
564 mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ; 563 mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ;
565 564
566 mRemotePrecommandPWM->setText(prof->getPreSyncCommandPWM()); 565 mRemotePrecommandPWM->setText(prof->getPreSyncCommandPWM());
567 mRemotePostcommandPWM->setText(prof->getPostSyncCommandPWM()); 566 mRemotePostcommandPWM->setText(prof->getPostSyncCommandPWM());
568 mLocalTempFilePWM->setText(prof->getLocalTempFilePWM()); 567 mLocalTempFilePWM->setText(prof->getLocalTempFilePWM());
569 mRemoteFilePWM->setText(prof->getRemoteFileNamePWM()) ; 568 mRemoteFilePWM->setText(prof->getRemoteFileNamePWM()) ;
570 569
571 if ( mWriteContactToSIM ) 570 if ( mWriteContactToSIM )
572 mWriteContactToSIM->setChecked( prof->getWriteContactToSIM()); 571 mWriteContactToSIM->setChecked( prof->getWriteContactToSIM());
573 mPhoneDevice->setText(prof->getPhoneDevice()); 572 mPhoneDevice->setText(prof->getPhoneDevice());
574 mPhoneConnection->setText(prof->getPhoneConnection()); 573 mPhoneConnection->setText(prof->getPhoneConnection());
575 mPhoneModel->setText(prof->getPhoneModel()); 574 mPhoneModel->setText(prof->getPhoneModel());
576 575
577 mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync()); 576 mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync());
578 mAskForPreferences->setChecked( prof->getAskForPreferences()); 577 mAskForPreferences->setChecked( prof->getAskForPreferences());
579 mWriteBackExisting->setChecked( prof->getWriteBackExisting() ); 578 mWriteBackExisting->setChecked( prof->getWriteBackExisting() );
580 mWriteBackFile->setChecked( prof->getWriteBackFile()); 579 mWriteBackFile->setChecked( prof->getWriteBackFile());
581 mIncludeInRing->setChecked( prof->getIncludeInRingSync() ); 580 mIncludeInRing->setChecked( prof->getIncludeInRingSync() );
582 mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() ); 581 mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() );
583 mIncludeInRingPWM->setChecked( prof->getIncludeInRingSyncPWM() ); 582 mIncludeInRingPWM->setChecked( prof->getIncludeInRingSyncPWM() );
584 mWriteBackFuture->setChecked( prof->getWriteBackFuture()); 583 mWriteBackFuture->setChecked( prof->getWriteBackFuture());
585 mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() ); 584 mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() );
586 mWriteBackPastWeeks->setValue( prof->getWriteBackPastWeeks() ); 585 mWriteBackPastWeeks->setValue( prof->getWriteBackPastWeeks() );
587 586
588 mFilterInCal->setCurrentItem( mFilterKopi.findIndex(prof->getFilterInCal () ) + 1 ); 587 mFilterInCal->setCurrentItem( mFilterKopi.findIndex(prof->getFilterInCal () ) + 1 );
589 mFilterOutCal->setCurrentItem( mFilterKopi.findIndex(prof->getFilterOutCal () ) + 1 ); 588 mFilterOutCal->setCurrentItem( mFilterKopi.findIndex(prof->getFilterOutCal () ) + 1 );
590 mFilterInAB->setCurrentItem( mFilterKapi.findIndex(prof->getFilterInAB () ) + 1 ); 589 mFilterInAB->setCurrentItem( mFilterKapi.findIndex(prof->getFilterInAB () ) + 1 );
591 mFilterOutAB->setCurrentItem( mFilterKapi.findIndex(prof->getFilterOutAB () ) + 1 ); 590 mFilterOutAB->setCurrentItem( mFilterKapi.findIndex(prof->getFilterOutAB () ) + 1 );
592 591
593 switch ( prof->getSyncPrefs() ) { 592 switch ( prof->getSyncPrefs() ) {
594 case 0: 593 case 0:
595 loc->setChecked( true); 594 loc->setChecked( true);
596 break; 595 break;
597 case 1: 596 case 1:
598 rem->setChecked( true ); 597 rem->setChecked( true );
599 break; 598 break;
600 case 2: 599 case 2:
601 newest->setChecked( true); 600 newest->setChecked( true);
602 break; 601 break;
603 case 3: 602 case 3:
604 ask->setChecked( true); 603 ask->setChecked( true);
605 break; 604 break;
606 case 4: 605 case 4:
607 f_loc->setChecked( true); 606 f_loc->setChecked( true);
608 break; 607 break;
609 case 5: 608 case 5:
610 f_rem->setChecked( true); 609 f_rem->setChecked( true);
611 break; 610 break;
612 case 6: 611 case 6:
613 //both->setChecked( true); 612 //both->setChecked( true);
614 break; 613 break;
615 default: 614 default:
616 break; 615 break;
617 } 616 }
618 mIsLocal->setChecked(prof->getIsLocalFileSync()) ; 617 mIsLocal->setChecked(prof->getIsLocalFileSync()) ;
619 mIsPhone->setChecked(prof->getIsPhoneSync()) ; 618 mIsPhone->setChecked(prof->getIsPhoneSync()) ;
620 mIsPi->setChecked(prof->getIsPiSync()) ; 619 mIsPi->setChecked(prof->getIsPiSync()) ;
621 mIsPiSpecific->setChecked(prof->getIsPiSyncSpec()) ; 620 mIsPiSpecific->setChecked(prof->getIsPiSyncSpec()) ;
622 mIsKapiFileL->setChecked(prof->getIsKapiFile()) ; 621 mIsKapiFileL->setChecked(prof->getIsKapiFile()) ;
623 mIsKapiFileR->setChecked(prof->getIsKapiFile()) ; 622 mIsKapiFileR->setChecked(prof->getIsKapiFile()) ;
624 623
625 624
626 QStringList res = QStringList::split( ":",prof->getResSpecKopi(), true ); 625 QStringList res = QStringList::split( ":",prof->getResSpecKopi(), true );
627 int add = res.count()/2; 626 int add = res.count()/2;
628 int i; 627 int i;
629 for ( i = 0;i < add ; ++i ) { 628 for ( i = 0;i < add ; ++i ) {
630 mResTableKopi->setText( i, 0, res[i+add] ); 629 mResTableKopi->setText( i, 0, res[i+add] );
631 } 630 }
632 res = QStringList::split( ":",prof->getResSpecKapi(), true); 631 res = QStringList::split( ":",prof->getResSpecKapi(), true);
633 add = res.count()/2; 632 add = res.count()/2;
634 for ( i = 0;i < add; ++i ) { 633 for ( i = 0;i < add; ++i ) {
635 mResTableKapi->setText( i, 0, res[i+add] ); 634 mResTableKapi->setText( i, 0, res[i+add] );
636 } 635 }
637 mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() &&!prof->getIsPiSync() &&!prof->getIsPiSyncSpec()); 636 mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() &&!prof->getIsPiSync() &&!prof->getIsPiSyncSpec());
638 proGr->setEnabled( item > 2 ); 637 proGr->setEnabled( item > 2 );
639 if ( item < 3 ) { 638 if ( item < 3 ) {
640 localFileWidget->hide(); 639 localFileWidget->hide();
641 remoteFileWidget->hide(); 640 remoteFileWidget->hide();
642 phoneWidget->hide(); 641 phoneWidget->hide();
643 piWidget->hide(); 642 piWidget->hide();
644 643
645 } else 644 } else
646 kindChanged( prof->getIsLocalFileSync() ); 645 kindChanged( prof->getIsLocalFileSync() );
647 updateMyCaption(); 646 updateMyCaption();
648} 647}
649 648
650void KSyncPrefsDialog::fillSSH() 649void KSyncPrefsDialog::fillSSH()
651{ 650{
652 mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); 651 mRemotePrecommand->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" );
653 mLocalTempFile->setText("/tmp/mycalendar.ics" ); 652 mLocalTempFile->setText("/tmp/mycalendar.ics" );
654 mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" ); 653 mRemotePostcommand->setText("scp /tmp/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/kdepim/apps/korganizer/mycalendar.ics" );
655 mRemotePrecommandAB->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); 654 mRemotePrecommandAB->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf /tmp/std.vcf" );
656 mLocalTempFileAB->setText("/tmp/std.vcf" ); 655 mLocalTempFileAB->setText("/tmp/std.vcf" );
657 mRemotePostcommandAB->setText("scp /tmp/std.vcf zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf" ); 656 mRemotePostcommandAB->setText("scp /tmp/std.vcf zaurus@192.168.0.65:/home/zaurus/kdepim/apps/kabc/std.vcf" );
658 mRemotePrecommandPWM->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" ); 657 mRemotePrecommandPWM->setText("scp zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" );
659 mLocalTempFilePWM->setText("/tmp/passwords.pwm" ); 658 mLocalTempFilePWM->setText("/tmp/passwords.pwm" );
660 mRemotePostcommandPWM->setText("scp /tmp/passwords.pwm zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/pwmanager.pwm" ); 659 mRemotePostcommandPWM->setText("scp /tmp/passwords.pwm zaurus@192.168.0.65:/home/zaurus/kdepim/apps/pwmanager/pwmanager.pwm" );
661} 660}
662void KSyncPrefsDialog::fillFTP() 661void KSyncPrefsDialog::fillFTP()
663{ 662{
664 mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" ); 663 mRemotePrecommand->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics" );
665 mLocalTempFile->setText("/tmp/mycalendar.ics" ); 664 mLocalTempFile->setText("/tmp/mycalendar.ics" );
666 mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" ); 665 mRemotePostcommand->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/korganizer/mycalendar.ics /tmp/mycalendar.ics" );
667 mRemotePrecommandAB->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf" ); 666 mRemotePrecommandAB->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf" );
668 mLocalTempFileAB->setText("/tmp/std.vcf" ); 667 mLocalTempFileAB->setText("/tmp/std.vcf" );
669 mRemotePostcommandAB->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf /tmp/std.vcf" ); 668 mRemotePostcommandAB->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/kabc/std.vcf /tmp/std.vcf" );
670 669
671 mRemotePrecommandPWM->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm" ); 670 mRemotePrecommandPWM->setText("cd /tmp;ftp ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm" );
672 mLocalTempFilePWM->setText("/tmp/passwords.pwm" ); 671 mLocalTempFilePWM->setText("/tmp/passwords.pwm" );
673 mRemotePostcommandPWM->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" ); 672 mRemotePostcommandPWM->setText("ftp -u ftp://zaurus:a@192.168.0.65/kdepim/apps/pwmanager/passwords.pwm /tmp/passwords.pwm" );
674 673
675} 674}
676void KSyncPrefsDialog::kindChanged( bool b ) 675void KSyncPrefsDialog::kindChanged( bool b )
677{ 676{
678 677
679 if ( mIsLocal->isChecked () ) { 678 if ( mIsLocal->isChecked () ) {
680 mIsKapiFileL->setChecked( mIsKapiFileR->isChecked() ); 679 mIsKapiFileL->setChecked( mIsKapiFileR->isChecked() );
681 } else { 680 } else {
682 mIsKapiFileR->setChecked( mIsKapiFileL->isChecked() ); 681 mIsKapiFileR->setChecked( mIsKapiFileL->isChecked() );
683 } 682 }
684 683
685 if ( mIsLocal->isChecked () ) 684 if ( mIsLocal->isChecked () )
686 localFileWidget->show(); 685 localFileWidget->show();
687 else 686 else
688 localFileWidget->hide(); 687 localFileWidget->hide();
689 688
690 if ( mIsNotLocal->isChecked () ) 689 if ( mIsNotLocal->isChecked () )
691 remoteFileWidget->show(); 690 remoteFileWidget->show();
692 else 691 else
693 remoteFileWidget->hide(); 692 remoteFileWidget->hide();
694 693
695 if ( mIsPhone->isChecked () ) { 694 if ( mIsPhone->isChecked () ) {
696 phoneWidget->show(); 695 phoneWidget->show();
697 } 696 }
698 else { 697 else {