summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncprefsdialog.cpp
Unidiff
Diffstat (limited to 'libkdepim/ksyncprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncprefsdialog.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp
index 84cc448..cf8f996 100644
--- a/libkdepim/ksyncprefsdialog.cpp
+++ b/libkdepim/ksyncprefsdialog.cpp
@@ -155,97 +155,97 @@ void KSyncPrefsDialog::setupSyncAlgTab()
155 ++iii; 155 ++iii;
156 QButtonGroup* gr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame); 156 QButtonGroup* gr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Sync preferences"), topFrame);
157 topLayout->addMultiCellWidget(gr, iii,iii,0,1); 157 topLayout->addMultiCellWidget(gr, iii,iii,0,1);
158 ++iii; 158 ++iii;
159 loc = new QRadioButton ( i18n("Take local entry on conflict"), gr ); 159 loc = new QRadioButton ( i18n("Take local entry on conflict"), gr );
160 rem = new QRadioButton ( i18n("Take remote entry on conflict"), gr ); 160 rem = new QRadioButton ( i18n("Take remote entry on conflict"), gr );
161 newest = new QRadioButton ( i18n("Take newest entry on conflict"), gr ); 161 newest = new QRadioButton ( i18n("Take newest entry on conflict"), gr );
162 ask = new QRadioButton ( i18n("Ask for every entry on conflict"), gr ); 162 ask = new QRadioButton ( i18n("Ask for every entry on conflict"), gr );
163 f_loc= new QRadioButton ( i18n("Force: Take local entry always"), gr ); 163 f_loc= new QRadioButton ( i18n("Force: Take local entry always"), gr );
164 f_rem = new QRadioButton ( i18n("Force: Take remote entry always"), gr ); 164 f_rem = new QRadioButton ( i18n("Force: Take remote entry always"), gr );
165 // both = new QRadioButton ( i18n("Take both on conflict"), gr ); 165 // both = new QRadioButton ( i18n("Take both on conflict"), gr );
166 166
167 mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame ); 167 mShowSummaryAfterSync = new QCheckBox( i18n("Show summary after sync"), topFrame );
168 topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1); 168 topLayout->addMultiCellWidget(mShowSummaryAfterSync, iii,iii,0,1);
169 ++iii; 169 ++iii;
170 170
171 mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame ); 171 mWriteBackFile = new QCheckBox( i18n("Write back synced data"), topFrame );
172 topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1); 172 topLayout->addMultiCellWidget(mWriteBackFile, iii,iii,0,1);
173 ++iii; 173 ++iii;
174 174
175 mWriteBackExisting= new QCheckBox( i18n("-- Write back (on remote) existing entries only"), topFrame ); 175 mWriteBackExisting= new QCheckBox( i18n("-- Write back (on remote) existing entries only"), topFrame );
176 topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1); 176 topLayout->addMultiCellWidget(mWriteBackExisting, iii,iii,0,1);
177 ++iii; 177 ++iii;
178 178
179 mWriteBackFuture= new QCheckBox( i18n("-- Write back (calendar) entries in future only"), topFrame ); 179 mWriteBackFuture= new QCheckBox( i18n("-- Write back (calendar) entries in future only"), topFrame );
180 topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1); 180 topLayout->addMultiCellWidget(mWriteBackFuture, iii,iii,0,1);
181 ++iii; 181 ++iii;
182 topLayout->addMultiCellWidget(new QLabel( i18n("---- Max. weeks in future: ") , topFrame ), iii,iii,0,0); 182 topLayout->addMultiCellWidget(new QLabel( i18n("---- Max. weeks in future: ") , topFrame ), iii,iii,0,0);
183 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, topFrame); 183 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, topFrame);
184 topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1); 184 topLayout->addMultiCellWidget(mWriteBackFutureWeeks, iii,iii,1,1);
185 ++iii; 185 ++iii;
186 186
187 proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame); 187 proGr = new QButtonGroup ( 1, Qt::Horizontal, i18n("Profile kind"), topFrame);
188 gr = proGr; 188 gr = proGr;
189 topLayout->addMultiCellWidget(gr, iii,iii,0,1); 189 topLayout->addMultiCellWidget(gr, iii,iii,0,1);
190 ++iii; 190 ++iii;
191 mIsLocal = new QRadioButton ( i18n("Local file"), gr ); 191 mIsLocal = new QRadioButton ( i18n("Local file"), gr );
192 mIsPi = new QRadioButton ( i18n("Pi-Sync ( direct Kx/Pi to Kx/Pi sync )"), gr ); 192 mIsPi = new QRadioButton ( i18n("Pi-Sync ( direct Kx/Pi to Kx/Pi sync )"), gr );
193 connect (mIsPi, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); 193 connect (mIsPi, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
194 mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr ); 194 mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr );
195 connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); 195 connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
196 mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr ); 196 mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr );
197 connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); 197 connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) );
198 198
199 199
200 phoneWidget = new QVBox( topFrame); 200 phoneWidget = new QVBox( topFrame);
201 topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1); 201 topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1);
202 ++iii; 202 ++iii;
203 mWriteContactToSIM= new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget ); 203 mWriteContactToSIM = 0;//new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget );
204 QHBox* temphb = new QHBox( phoneWidget ); 204 QHBox* temphb = new QHBox( phoneWidget );
205 new QLabel( i18n("I/O device: "), temphb ); 205 new QLabel( i18n("I/O device: "), temphb );
206 mPhoneDevice = new QLineEdit( temphb); 206 mPhoneDevice = new QLineEdit( temphb);
207 button = new QPushButton( i18n("Help..."), temphb ); 207 button = new QPushButton( i18n("Help..."), temphb );
208 connect ( button, SIGNAL( clicked()), this, SLOT ( helpDevice() ) ); 208 connect ( button, SIGNAL( clicked()), this, SLOT ( helpDevice() ) );
209 209
210 210
211 temphb = new QHBox( phoneWidget ); 211 temphb = new QHBox( phoneWidget );
212 new QLabel( i18n("Connection: "), temphb ); 212 new QLabel( i18n("Connection: "), temphb );
213 mPhoneConnection = new QLineEdit( temphb); 213 mPhoneConnection = new QLineEdit( temphb);
214 button = new QPushButton( i18n("Help..."), temphb ); 214 button = new QPushButton( i18n("Help..."), temphb );
215 connect ( button, SIGNAL( clicked()), this, SLOT ( helpConnection() ) ); 215 connect ( button, SIGNAL( clicked()), this, SLOT ( helpConnection() ) );
216 216
217 217
218 temphb = new QHBox( phoneWidget ); 218 temphb = new QHBox( phoneWidget );
219 new QLabel( i18n("Model(opt.): "), temphb ); 219 new QLabel( i18n("Model(opt.): "), temphb );
220 mPhoneModel = new QLineEdit( temphb); 220 mPhoneModel = new QLineEdit( temphb);
221 button = new QPushButton( i18n("Help..."), temphb ); 221 button = new QPushButton( i18n("Help..."), temphb );
222 connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) ); 222 connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) );
223 223
224 // *** local 224 // *** local
225 localFileWidget = new QVBox( topFrame); 225 localFileWidget = new QVBox( topFrame);
226 topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1); 226 topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1);
227 ++iii; 227 ++iii;
228 temphb = new QHBox( localFileWidget ); 228 temphb = new QHBox( localFileWidget );
229 229
230 lab = new QLabel( i18n("Local file Cal:"), temphb ); 230 lab = new QLabel( i18n("Local file Cal:"), temphb );
231 lab = new QLabel( i18n("Local file ABook:"), temphb ); 231 lab = new QLabel( i18n("Local file ABook:"), temphb );
232 lab = new QLabel( i18n("Local file PWMgr:"), temphb ); 232 lab = new QLabel( i18n("Local file PWMgr:"), temphb );
233 temphb = new QHBox( localFileWidget ); 233 temphb = new QHBox( localFileWidget );
234 button = new QPushButton( i18n("Choose..."), temphb ); 234 button = new QPushButton( i18n("Choose..."), temphb );
235 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) ); 235 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) );
236 button = new QPushButton( i18n("Choose..."), temphb ); 236 button = new QPushButton( i18n("Choose..."), temphb );
237 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) ); 237 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) );
238 button = new QPushButton( i18n("Choose..."), temphb ); 238 button = new QPushButton( i18n("Choose..."), temphb );
239 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFilePWM() ) ); 239 connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFilePWM() ) );
240 temphb = new QHBox( localFileWidget ); 240 temphb = new QHBox( localFileWidget );
241 241
242 mRemoteFile = new QLineEdit( temphb); 242 mRemoteFile = new QLineEdit( temphb);
243 mRemoteFileAB = new QLineEdit( temphb); 243 mRemoteFileAB = new QLineEdit( temphb);
244 mRemoteFilePWM = new QLineEdit( temphb); 244 mRemoteFilePWM = new QLineEdit( temphb);
245 245
246 // *** remote 246 // *** remote
247 remoteFileWidget = new QVBox( topFrame); 247 remoteFileWidget = new QVBox( topFrame);
248 topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); 248 topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1);
249 ++iii; 249 ++iii;
250 temphb = new QHBox( remoteFileWidget ); 250 temphb = new QHBox( remoteFileWidget );
251 new QLabel( i18n("Calendar:"), temphb); 251 new QLabel( i18n("Calendar:"), temphb);
@@ -368,97 +368,98 @@ void KSyncPrefsDialog::textChanged( const QString & s )
368 if ( currentSelection < 3 ) { 368 if ( currentSelection < 3 ) {
369 //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error")); 369 //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error"));
370 mProfileBox->blockSignals( true ); 370 mProfileBox->blockSignals( true );
371 mProfileBox->setCurrentItem(mProfileBox-> currentItem ()); 371 mProfileBox->setCurrentItem(mProfileBox-> currentItem ());
372 mProfileBox->blockSignals( false ); 372 mProfileBox->blockSignals( false );
373 return; 373 return;
374 } 374 }
375 //qDebug("cur i %d ",mProfileBox-> currentItem () ); 375 //qDebug("cur i %d ",mProfileBox-> currentItem () );
376 mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ; 376 mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ;
377 KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ; 377 KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ;
378 prof->setName( s ); 378 prof->setName( s );
379 mSyncProfileNames[mProfileBox-> currentItem ()] = s; 379 mSyncProfileNames[mProfileBox-> currentItem ()] = s;
380} 380}
381void KSyncPrefsDialog::profileChanged( int item ) 381void KSyncPrefsDialog::profileChanged( int item )
382{ 382{
383 //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() ); 383 //qDebug("KSyncPrefsDialog::profileChanged before %d, count %d ", item, mProfileBox->count() );
384 KSyncProfile* prof; 384 KSyncProfile* prof;
385 saveProfile(); 385 saveProfile();
386 currentSelection = item; 386 currentSelection = item;
387 prof = mSyncProfiles.at(item) ; 387 prof = mSyncProfiles.at(item) ;
388 388
389 mRemotePw->setText(prof->getRemotePw()); 389 mRemotePw->setText(prof->getRemotePw());
390 mRemoteIP->setText(prof->getRemoteIP()); 390 mRemoteIP->setText(prof->getRemoteIP());
391 mRemotePort->setText(prof->getRemotePort()); 391 mRemotePort->setText(prof->getRemotePort());
392 392
393 mRemotePwAB->setText(prof->getRemotePwAB()); 393 mRemotePwAB->setText(prof->getRemotePwAB());
394 mRemoteIPAB->setText(prof->getRemoteIPAB()); 394 mRemoteIPAB->setText(prof->getRemoteIPAB());
395 mRemotePortAB->setText(prof->getRemotePortAB()); 395 mRemotePortAB->setText(prof->getRemotePortAB());
396 396
397 mRemotePwPWM->setText(prof->getRemotePwPWM()); 397 mRemotePwPWM->setText(prof->getRemotePwPWM());
398 mRemoteIPPWM->setText(prof->getRemoteIPPWM()); 398 mRemoteIPPWM->setText(prof->getRemoteIPPWM());
399 mRemotePortPWM->setText(prof->getRemotePortPWM()); 399 mRemotePortPWM->setText(prof->getRemotePortPWM());
400 400
401 mRemotePrecommand->setText(prof->getPreSyncCommand()); 401 mRemotePrecommand->setText(prof->getPreSyncCommand());
402 mRemotePostcommand->setText(prof->getPostSyncCommand()); 402 mRemotePostcommand->setText(prof->getPostSyncCommand());
403 mLocalTempFile->setText(prof->getLocalTempFile()); 403 mLocalTempFile->setText(prof->getLocalTempFile());
404 mRemoteFile->setText(prof->getRemoteFileName()) ; 404 mRemoteFile->setText(prof->getRemoteFileName()) ;
405 405
406 mRemotePrecommandAB->setText(prof->getPreSyncCommandAB()); 406 mRemotePrecommandAB->setText(prof->getPreSyncCommandAB());
407 mRemotePostcommandAB->setText(prof->getPostSyncCommandAB()); 407 mRemotePostcommandAB->setText(prof->getPostSyncCommandAB());
408 mLocalTempFileAB->setText(prof->getLocalTempFileAB()); 408 mLocalTempFileAB->setText(prof->getLocalTempFileAB());
409 mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ; 409 mRemoteFileAB->setText(prof->getRemoteFileNameAB()) ;
410 410
411 mRemotePrecommandPWM->setText(prof->getPreSyncCommandPWM()); 411 mRemotePrecommandPWM->setText(prof->getPreSyncCommandPWM());
412 mRemotePostcommandPWM->setText(prof->getPostSyncCommandPWM()); 412 mRemotePostcommandPWM->setText(prof->getPostSyncCommandPWM());
413 mLocalTempFilePWM->setText(prof->getLocalTempFilePWM()); 413 mLocalTempFilePWM->setText(prof->getLocalTempFilePWM());
414 mRemoteFilePWM->setText(prof->getRemoteFileNamePWM()) ; 414 mRemoteFilePWM->setText(prof->getRemoteFileNamePWM()) ;
415 415
416 mWriteContactToSIM->setChecked( prof->getWriteContactToSIM()); 416 if ( mWriteContactToSIM )
417 mWriteContactToSIM->setChecked( prof->getWriteContactToSIM());
417 mPhoneDevice->setText(prof->getPhoneDevice()); 418 mPhoneDevice->setText(prof->getPhoneDevice());
418 mPhoneConnection->setText(prof->getPhoneConnection()); 419 mPhoneConnection->setText(prof->getPhoneConnection());
419 mPhoneModel->setText(prof->getPhoneModel()); 420 mPhoneModel->setText(prof->getPhoneModel());
420 421
421 mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync()); 422 mShowSummaryAfterSync->setChecked( prof->getShowSummaryAfterSync());
422 mAskForPreferences->setChecked( prof->getAskForPreferences()); 423 mAskForPreferences->setChecked( prof->getAskForPreferences());
423 mWriteBackExisting->setChecked( prof->getWriteBackExisting() ); 424 mWriteBackExisting->setChecked( prof->getWriteBackExisting() );
424 mWriteBackFile->setChecked( prof->getWriteBackFile()); 425 mWriteBackFile->setChecked( prof->getWriteBackFile());
425 mIncludeInRing->setChecked( prof->getIncludeInRingSync() ); 426 mIncludeInRing->setChecked( prof->getIncludeInRingSync() );
426 mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() ); 427 mIncludeInRingAB->setChecked( prof->getIncludeInRingSyncAB() );
427 mIncludeInRingPWM->setChecked( prof->getIncludeInRingSyncPWM() ); 428 mIncludeInRingPWM->setChecked( prof->getIncludeInRingSyncPWM() );
428 mWriteBackFuture->setChecked( prof->getWriteBackFuture()); 429 mWriteBackFuture->setChecked( prof->getWriteBackFuture());
429 mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() ); 430 mWriteBackFutureWeeks->setValue( prof->getWriteBackFutureWeeks() );
430 431
431 switch ( prof->getSyncPrefs() ) { 432 switch ( prof->getSyncPrefs() ) {
432 case 0: 433 case 0:
433 loc->setChecked( true); 434 loc->setChecked( true);
434 break; 435 break;
435 case 1: 436 case 1:
436 rem->setChecked( true ); 437 rem->setChecked( true );
437 break; 438 break;
438 case 2: 439 case 2:
439 newest->setChecked( true); 440 newest->setChecked( true);
440 break; 441 break;
441 case 3: 442 case 3:
442 ask->setChecked( true); 443 ask->setChecked( true);
443 break; 444 break;
444 case 4: 445 case 4:
445 f_loc->setChecked( true); 446 f_loc->setChecked( true);
446 break; 447 break;
447 case 5: 448 case 5:
448 f_rem->setChecked( true); 449 f_rem->setChecked( true);
449 break; 450 break;
450 case 6: 451 case 6:
451 //both->setChecked( true); 452 //both->setChecked( true);
452 break; 453 break;
453 default: 454 default:
454 break; 455 break;
455 } 456 }
456 mIsLocal->setChecked(prof->getIsLocalFileSync()) ; 457 mIsLocal->setChecked(prof->getIsLocalFileSync()) ;
457 mIsPhone->setChecked(prof->getIsPhoneSync()) ; 458 mIsPhone->setChecked(prof->getIsPhoneSync()) ;
458 mIsPi->setChecked(prof->getIsPiSync()) ; 459 mIsPi->setChecked(prof->getIsPiSync()) ;
459 mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() &&!prof->getIsPiSync() ); 460 mIsNotLocal->setChecked(!prof->getIsLocalFileSync() && !prof->getIsPhoneSync() &&!prof->getIsPiSync() );
460 proGr->setEnabled( item > 2 ); 461 proGr->setEnabled( item > 2 );
461 if ( item < 3 ) { 462 if ( item < 3 ) {
462 localFileWidget->hide(); 463 localFileWidget->hide();
463 remoteFileWidget->hide(); 464 remoteFileWidget->hide();
464 phoneWidget->hide(); 465 phoneWidget->hide();
@@ -535,98 +536,98 @@ void KSyncPrefsDialog::deleteProfile()
535 insertProfiles(); 536 insertProfiles();
536 } 537 }
537} 538}
538 539
539void KSyncPrefsDialog::saveProfile() 540void KSyncPrefsDialog::saveProfile()
540{ 541{
541 KSyncProfile* prof; 542 KSyncProfile* prof;
542 if ( currentSelection >= 0 ) { 543 if ( currentSelection >= 0 ) {
543 prof = mSyncProfiles.at(currentSelection) ; 544 prof = mSyncProfiles.at(currentSelection) ;
544 545
545 prof->setRemotePw( mRemotePw->text()); 546 prof->setRemotePw( mRemotePw->text());
546 prof->setRemoteIP( mRemoteIP->text()); 547 prof->setRemoteIP( mRemoteIP->text());
547 prof->setRemotePort( mRemotePort->text()); 548 prof->setRemotePort( mRemotePort->text());
548 549
549 prof->setRemotePwAB( mRemotePwAB->text()); 550 prof->setRemotePwAB( mRemotePwAB->text());
550 prof->setRemoteIPAB( mRemoteIPAB->text()); 551 prof->setRemoteIPAB( mRemoteIPAB->text());
551 prof->setRemotePortAB( mRemotePortAB->text()); 552 prof->setRemotePortAB( mRemotePortAB->text());
552 553
553 prof->setRemotePwPWM( mRemotePwPWM->text()); 554 prof->setRemotePwPWM( mRemotePwPWM->text());
554 prof->setRemoteIPPWM( mRemoteIPPWM->text()); 555 prof->setRemoteIPPWM( mRemoteIPPWM->text());
555 prof->setRemotePortPWM( mRemotePortPWM->text()); 556 prof->setRemotePortPWM( mRemotePortPWM->text());
556 557
557 prof->setPreSyncCommand( mRemotePrecommand->text()); 558 prof->setPreSyncCommand( mRemotePrecommand->text());
558 prof->setPostSyncCommand( mRemotePostcommand->text() ); 559 prof->setPostSyncCommand( mRemotePostcommand->text() );
559 prof->setLocalTempFile( mLocalTempFile->text()); 560 prof->setLocalTempFile( mLocalTempFile->text());
560 prof->setRemoteFileName( mRemoteFile->text() ); 561 prof->setRemoteFileName( mRemoteFile->text() );
561 prof->setPreSyncCommandAB( mRemotePrecommandAB->text()); 562 prof->setPreSyncCommandAB( mRemotePrecommandAB->text());
562 prof->setPostSyncCommandAB( mRemotePostcommandAB->text() ); 563 prof->setPostSyncCommandAB( mRemotePostcommandAB->text() );
563 prof->setLocalTempFileAB( mLocalTempFileAB->text()); 564 prof->setLocalTempFileAB( mLocalTempFileAB->text());
564 prof->setRemoteFileNameAB( mRemoteFileAB->text() ); 565 prof->setRemoteFileNameAB( mRemoteFileAB->text() );
565 prof->setPreSyncCommandPWM( mRemotePrecommandPWM->text()); 566 prof->setPreSyncCommandPWM( mRemotePrecommandPWM->text());
566 prof->setPostSyncCommandPWM( mRemotePostcommandPWM->text() ); 567 prof->setPostSyncCommandPWM( mRemotePostcommandPWM->text() );
567 prof->setLocalTempFilePWM( mLocalTempFilePWM->text()); 568 prof->setLocalTempFilePWM( mLocalTempFilePWM->text());
568 prof->setRemoteFileNamePWM( mRemoteFilePWM->text() ); 569 prof->setRemoteFileNamePWM( mRemoteFilePWM->text() );
569 prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() ); 570 prof->setShowSummaryAfterSync( mShowSummaryAfterSync->isChecked() );
570 prof->setAskForPreferences( mAskForPreferences->isChecked()); 571 prof->setAskForPreferences( mAskForPreferences->isChecked());
571 prof->setWriteBackExisting(mWriteBackExisting->isChecked() ); 572 prof->setWriteBackExisting(mWriteBackExisting->isChecked() );
572 prof->setWriteBackFile( mWriteBackFile->isChecked()); 573 prof->setWriteBackFile( mWriteBackFile->isChecked());
573 prof->setIncludeInRingSync( mIncludeInRing->isChecked() ); 574 prof->setIncludeInRingSync( mIncludeInRing->isChecked() );
574 prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() ); 575 prof->setIncludeInRingSyncAB( mIncludeInRingAB->isChecked() );
575 prof->setIncludeInRingSyncPWM( mIncludeInRingPWM->isChecked() ); 576 prof->setIncludeInRingSyncPWM( mIncludeInRingPWM->isChecked() );
576 int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ; 577 int syncprefs = rem->isChecked()*1+newest->isChecked()*2+ ask->isChecked()*3+ f_loc->isChecked()*4+ f_rem->isChecked()*5 ;//+ both->isChecked()*6 ;
577 prof->setSyncPrefs( syncprefs); 578 prof->setSyncPrefs( syncprefs);
578 prof->setIsLocalFileSync( mIsLocal->isChecked() ); 579 prof->setIsLocalFileSync( mIsLocal->isChecked() );
579 prof->setIsPhoneSync( mIsPhone->isChecked() ); 580 prof->setIsPhoneSync( mIsPhone->isChecked() );
580 prof->setIsPiSync( mIsPi->isChecked() ); 581 prof->setIsPiSync( mIsPi->isChecked() );
581 prof->setWriteBackFuture(mWriteBackFuture->isChecked()); 582 prof->setWriteBackFuture(mWriteBackFuture->isChecked());
582 prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value()); 583 prof->setWriteBackFutureWeeks(mWriteBackFutureWeeks->value());
583 584 if ( mWriteContactToSIM )
584 prof->setWriteContactToSIM(mWriteContactToSIM->isChecked()); 585 prof->setWriteContactToSIM(mWriteContactToSIM->isChecked());
585 prof->setPhoneDevice( mPhoneDevice->text() ); 586 prof->setPhoneDevice( mPhoneDevice->text() );
586 prof->setPhoneConnection( mPhoneConnection->text() ); 587 prof->setPhoneConnection( mPhoneConnection->text() );
587 prof->setPhoneModel( mPhoneModel->text() ); 588 prof->setPhoneModel( mPhoneModel->text() );
588 589
589 } 590 }
590 591
591} 592}
592 593
593void KSyncPrefsDialog::insertProfiles() 594void KSyncPrefsDialog::insertProfiles()
594{ 595{
595 int curItem = mProfileBox->currentItem(); 596 int curItem = mProfileBox->currentItem();
596 mProfileBox->blockSignals( true ); 597 mProfileBox->blockSignals( true );
597 mProfileBox->clear(); 598 mProfileBox->clear();
598 mProfileBox->insertStringList (mSyncProfileNames ); 599 mProfileBox->insertStringList (mSyncProfileNames );
599 int item = mSyncProfileNames.count() -1; 600 int item = mSyncProfileNames.count() -1;
600 if ( curItem >= 0 && mSyncProfileNames.count() > 0 && curItem < mSyncProfileNames.count() ) 601 if ( curItem >= 0 && mSyncProfileNames.count() > 0 && curItem < mSyncProfileNames.count() )
601 mProfileBox->setCurrentItem( curItem ); 602 mProfileBox->setCurrentItem( curItem );
602 else if ( item >= 0 ) { 603 else if ( item >= 0 ) {
603 mProfileBox->setCurrentItem( item ); 604 mProfileBox->setCurrentItem( item );
604 } 605 }
605 currentSelection = -1; 606 currentSelection = -1;
606 if ( mSyncProfileNames.count() > 0 ) { 607 if ( mSyncProfileNames.count() > 0 ) {
607 //qDebug(" profileChanged( mProfileBox->currentItem() "); 608 //qDebug(" profileChanged( mProfileBox->currentItem() ");
608 profileChanged( mProfileBox->currentItem() ); 609 profileChanged( mProfileBox->currentItem() );
609 currentSelection = mProfileBox->currentItem(); 610 currentSelection = mProfileBox->currentItem();
610 } 611 }
611 mProfileBox->blockSignals( false ); 612 mProfileBox->blockSignals( false );
612} 613}
613 614
614void KSyncPrefsDialog::addProfile ( KSyncProfile* temp ) 615void KSyncPrefsDialog::addProfile ( KSyncProfile* temp )
615{ 616{
616 saveProfile(); 617 saveProfile();
617 mSyncProfiles.append( temp ); 618 mSyncProfiles.append( temp );
618 mSyncProfileNames << temp->getName(); 619 mSyncProfileNames << temp->getName();
619 insertProfiles(); 620 insertProfiles();
620 int last = mProfileBox->count() -1; 621 int last = mProfileBox->count() -1;
621 mProfileBox->blockSignals( true ); 622 mProfileBox->blockSignals( true );
622 mProfileBox->setCurrentItem( last ); 623 mProfileBox->setCurrentItem( last );
623 mProfileBox->blockSignals( false ); 624 mProfileBox->blockSignals( false );
624 profileChanged(last); 625 profileChanged(last);
625} 626}
626void KSyncPrefsDialog::newProfile() 627void KSyncPrefsDialog::newProfile()
627{ 628{
628 addProfile ( new KSyncProfile () ); 629 addProfile ( new KSyncProfile () );
629} 630}
630 631
631void KSyncPrefsDialog::cloneProfile() 632void KSyncPrefsDialog::cloneProfile()
632{ 633{
@@ -670,62 +671,62 @@ void KSyncPrefsDialog::usrReadConfig()
670 //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); 671 //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName );
671} 672}
672 673
673 674
674void KSyncPrefsDialog::usrWriteConfig() 675void KSyncPrefsDialog::usrWriteConfig()
675{ 676{
676 saveProfile(); 677 saveProfile();
677 if ( currentSelection >= 0 ) 678 if ( currentSelection >= 0 )
678 profileChanged(currentSelection); 679 profileChanged(currentSelection);
679 //KConfig *config = KOGlobals::config(); 680 //KConfig *config = KOGlobals::config();
680 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); 681 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) );
681 KSyncProfile* prof = mSyncProfiles.first(); 682 KSyncProfile* prof = mSyncProfiles.first();
682 QStringList externalSyncProfileNames; 683 QStringList externalSyncProfileNames;
683 externalSyncProfileNames.append("Sharp_DTM");; 684 externalSyncProfileNames.append("Sharp_DTM");;
684 while ( prof ) { 685 while ( prof ) {
685 prof->writeConfig(&config); 686 prof->writeConfig(&config);
686 if ( prof->getIsPhoneSync( ) ) 687 if ( prof->getIsPhoneSync( ) )
687 externalSyncProfileNames.append(prof->getName( ) ); 688 externalSyncProfileNames.append(prof->getName( ) );
688 prof = mSyncProfiles.next(); 689 prof = mSyncProfiles.next();
689 } 690 }
690 //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; 691 //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames;
691 //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); 692 //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text();
692 config.setGroup("General"); 693 config.setGroup("General");
693 config.writeEntry("SyncProfileNames",mSyncProfileNames); 694 config.writeEntry("SyncProfileNames",mSyncProfileNames);
694 config.writeEntry("ExternSyncProfiles",externalSyncProfileNames); 695 config.writeEntry("ExternSyncProfiles",externalSyncProfileNames);
695 config.writeEntry("LocalMachineName",mMyMachineName->text()); 696 config.writeEntry("LocalMachineName",mMyMachineName->text());
696 config.sync(); 697 config.sync();
697} 698}
698 699
699void KSyncPrefsDialog::helpDevice() 700void KSyncPrefsDialog::helpDevice()
700{ 701{
701 QString hint = i18n("Insert device where\nphone is connected. E.g.:\n"); 702 QString hint = i18n("Insert device where\nphone is connected. E.g.:\n");
702#ifdef _WIN32_ 703#ifdef _WIN32_
703 hint += "Leave empty for Irda.\n" 704 hint += "Leave empty for Irda.\n"
704 "com1:\n(first serial port)\n" 705 "com1:\n(first serial port)\n"
705 "usb not supported\n" 706 "usb not supported\n"
706 "???\n(bluetooth device address)\n"; 707 "???\n(bluetooth device address)\n";
707 708
708#else 709#else
709 hint += "/dev/ircomm\n(Irda)\n" 710 hint += "/dev/ircomm\n(Irda)\n"
710 "/dev/ttyS0\n(first serial port)\n" 711 "/dev/ttyS0\n(first serial port)\n"
711 "/dev/ttyUSB0\n(first device usb port)\n" 712 "/dev/ttyUSB0\n(first device usb port)\n"
712 "???\n(bluetooth device address)\n"; 713 "???\n(bluetooth device address)\n";
713#endif 714#endif
714 KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); 715 KMessageBox::information(this,hint,i18n("KDE-Pim sync config"));
715} 716}
716void KSyncPrefsDialog::helpModel() 717void KSyncPrefsDialog::helpModel()
717{ 718{
718 QString hint = i18n("Leave empty or\ninsert name of phone model:\n"); 719 QString hint = i18n("Recommended: Leave empty!\n(Such that model can\nbe auto detected)\nOr insert name of model:\n");
719 hint += "E.g. for Nokia 6310i:\n6310i\nAlso possible:\nobex\nfor Obex connection"; 720 hint += "E.g. for Nokia 6310i:\n6310i\nAlso possible:\nobex\nfor Obex connection";
720 KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); 721 KMessageBox::information(this,hint,i18n("KDE-Pim sync config"));
721 722
722} 723}
723void KSyncPrefsDialog::helpConnection() 724void KSyncPrefsDialog::helpConnection()
724{ 725{
725 QString hint = i18n("Insert kind of connection,e.g.:\n"); 726 QString hint = i18n("Insert kind of connection,e.g.:\n");
726 hint += "irda | Nokia FBUS over infrared\n" 727 hint += "irda | Nokia FBUS over infrared\n"
727 "irdaat | AT commands infrared\n(for Siemens/Sony-Erricsson)\n" 728 "irdaat | AT commands infrared\n(for Siemens/Sony-Erricsson)\n"
728 "irdaobex | set also model as obex\n" 729 "irdaobex | set also model as obex\n"
729 "fbus | Nokia FBUS2 serial\n"; 730 "fbus | Nokia FBUS2 serial\n";
730 KMessageBox::information(this,hint,i18n("KDE-Pim sync config")); 731 KMessageBox::information(this,hint,i18n("KDE-Pim sync config"));
731} 732}