Diffstat (limited to 'libkdepim/ksyncprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libkdepim/ksyncprefsdialog.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index 744a914..1f9afcb 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp | |||
@@ -244,257 +244,257 @@ void KSyncPrefsDialog::setupSyncAlgTab() | |||
244 | mIsPi = new QRadioButton ( i18n("Pi-Sync - all resources ( direct Kx/Pi to Kx/Pi sync )"), gr ); | 244 | mIsPi = new QRadioButton ( i18n("Pi-Sync - all resources ( direct Kx/Pi to Kx/Pi sync )"), gr ); |
245 | connect (mIsPi, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); | 245 | connect (mIsPi, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); |
246 | mIsPiSpecific = new QRadioButton ( i18n("Pi-Sync - selected resources ( direct Kx/Pi to Kx/Pi sync )"), gr ); | 246 | mIsPiSpecific = new QRadioButton ( i18n("Pi-Sync - selected resources ( direct Kx/Pi to Kx/Pi sync )"), gr ); |
247 | connect (mIsPiSpecific, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); | 247 | connect (mIsPiSpecific, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); |
248 | mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr ); | 248 | mIsNotLocal = new QRadioButton ( i18n("Remote file (w down/upload command)"), gr ); |
249 | connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); | 249 | connect (mIsLocal, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); |
250 | mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr ); | 250 | mIsPhone = new QRadioButton ( i18n("Mobile device (cell phone)"), gr ); |
251 | connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); | 251 | connect (mIsPhone, SIGNAL( toggled(bool)), this, SLOT (kindChanged(bool) ) ); |
252 | 252 | ||
253 | QVGroupBox* gb1 = new QVGroupBox( i18n("Profile kind specific settings"), topFrame); | 253 | QVGroupBox* gb1 = new QVGroupBox( i18n("Profile kind specific settings"), topFrame); |
254 | topLayout->addMultiCellWidget(gb1, iii,iii,0,1); | 254 | topLayout->addMultiCellWidget(gb1, iii,iii,0,1); |
255 | ++iii; | 255 | ++iii; |
256 | 256 | ||
257 | // ****************************************** | 257 | // ****************************************** |
258 | // Profile kind specific settings | 258 | // Profile kind specific settings |
259 | { | 259 | { |
260 | // *** phone ******************************* | 260 | // *** phone ******************************* |
261 | QVGroupBox* topFrame = gb1; | 261 | QVGroupBox* topFrame = gb1; |
262 | phoneWidget = new QVBox( topFrame); | 262 | phoneWidget = new QVBox( topFrame); |
263 | //topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1); | 263 | //topLayout->addMultiCellWidget(phoneWidget, iii,iii,0,1); |
264 | //++iii; | 264 | //++iii; |
265 | mWriteContactToSIM = 0;//new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget ); | 265 | mWriteContactToSIM = 0;//new QCheckBox( i18n("Sync contacts with phone SIM card (If not, sync with phone memory)"), phoneWidget ); |
266 | QHBox* temphb = new QHBox( phoneWidget ); | 266 | QHBox* temphb = new QHBox( phoneWidget ); |
267 | new QLabel( i18n("I/O device: "), temphb ); | 267 | new QLabel( i18n("I/O device: "), temphb ); |
268 | mPhoneDevice = new QLineEdit( temphb); | 268 | mPhoneDevice = new QLineEdit( temphb); |
269 | button = new QPushButton( i18n("Help..."), temphb ); | 269 | button = new QPushButton( i18n("Help..."), temphb ); |
270 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpDevice() ) ); | 270 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpDevice() ) ); |
271 | 271 | ||
272 | 272 | ||
273 | temphb = new QHBox( phoneWidget ); | 273 | temphb = new QHBox( phoneWidget ); |
274 | new QLabel( i18n("Connection: "), temphb ); | 274 | new QLabel( i18n("Connection: "), temphb ); |
275 | mPhoneConnection = new QLineEdit( temphb); | 275 | mPhoneConnection = new QLineEdit( temphb); |
276 | button = new QPushButton( i18n("Help..."), temphb ); | 276 | button = new QPushButton( i18n("Help..."), temphb ); |
277 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpConnection() ) ); | 277 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpConnection() ) ); |
278 | 278 | ||
279 | 279 | ||
280 | temphb = new QHBox( phoneWidget ); | 280 | temphb = new QHBox( phoneWidget ); |
281 | new QLabel( i18n("Model(opt.): "), temphb ); | 281 | new QLabel( i18n("Model(opt.): "), temphb ); |
282 | mPhoneModel = new QLineEdit( temphb); | 282 | mPhoneModel = new QLineEdit( temphb); |
283 | button = new QPushButton( i18n("Help..."), temphb ); | 283 | button = new QPushButton( i18n("Help..."), temphb ); |
284 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) ); | 284 | connect ( button, SIGNAL( clicked()), this, SLOT ( helpModel() ) ); |
285 | 285 | ||
286 | // *** local******************************* | 286 | // *** local******************************* |
287 | localFileWidget = new QVBox( topFrame); | 287 | localFileWidget = new QVBox( topFrame); |
288 | //topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1); | 288 | //topLayout->addMultiCellWidget(localFileWidget, iii,iii,0,1); |
289 | //++iii; | 289 | //++iii; |
290 | temphb = new QHBox( localFileWidget ); | 290 | temphb = new QHBox( localFileWidget ); |
291 | 291 | ||
292 | lab = new QLabel( i18n("Local file Cal:"), temphb ); | 292 | lab = new QLabel( i18n("Local file Cal:"), temphb ); |
293 | lab = new QLabel( i18n("Local file ABook:"), temphb ); | 293 | lab = new QLabel( i18n("Local file ABook:"), temphb ); |
294 | lab = new QLabel( i18n("Local file PWMgr:"), temphb ); | 294 | lab = new QLabel( i18n("Local file PWMgr:"), temphb ); |
295 | temphb = new QHBox( localFileWidget ); | 295 | temphb = new QHBox( localFileWidget ); |
296 | button = new QPushButton( i18n("Choose..."), temphb ); | 296 | button = new QPushButton( i18n("Choose..."), temphb ); |
297 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) ); | 297 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFile() ) ); |
298 | button = new QPushButton( i18n("Choose..."), temphb ); | 298 | button = new QPushButton( i18n("Choose..."), temphb ); |
299 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) ); | 299 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFileAB() ) ); |
300 | button = new QPushButton( i18n("Choose..."), temphb ); | 300 | button = new QPushButton( i18n("Choose..."), temphb ); |
301 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFilePWM() ) ); | 301 | connect ( button, SIGNAL( clicked()), this, SLOT ( chooseFilePWM() ) ); |
302 | temphb = new QHBox( localFileWidget ); | 302 | temphb = new QHBox( localFileWidget ); |
303 | 303 | ||
304 | mRemoteFile = new QLineEdit( temphb); | 304 | mRemoteFile = new QLineEdit( temphb); |
305 | mRemoteFileAB = new QLineEdit( temphb); | 305 | mRemoteFileAB = new QLineEdit( temphb); |
306 | mRemoteFilePWM = new QLineEdit( temphb); | 306 | mRemoteFilePWM = new QLineEdit( temphb); |
307 | mIsKapiFileL = new QCheckBox( i18n("Addressbook file (*.vcf) is used by KA/Pi"), localFileWidget ); | 307 | mIsKapiFileL = new QCheckBox( i18n("Addressbook file (*.vcf) is used by KA/Pi"), localFileWidget ); |
308 | 308 | ||
309 | 309 | ||
310 | // *** remote******************************* | 310 | // *** remote******************************* |
311 | remoteFileWidget = new QVBox( topFrame); | 311 | remoteFileWidget = new QVBox( topFrame); |
312 | //topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); | 312 | //topLayout->addMultiCellWidget(remoteFileWidget, iii,iii,0,1); |
313 | //++iii; | 313 | //++iii; |
314 | temphb = new QHBox( remoteFileWidget ); | 314 | temphb = new QHBox( remoteFileWidget ); |
315 | new QLabel( i18n("Calendar:"), temphb); | 315 | new QLabel( i18n("Calendar:"), temphb); |
316 | new QLabel( i18n("AddressBook:"), temphb); | 316 | new QLabel( i18n("AddressBook:"), temphb); |
317 | new QLabel( i18n("PWManager:"), temphb); | 317 | new QLabel( i18n("PWManager:"), temphb); |
318 | 318 | ||
319 | lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget); | 319 | lab = new QLabel( i18n("Pre sync (download) command:"), remoteFileWidget); |
320 | temphb = new QHBox( remoteFileWidget ); | 320 | temphb = new QHBox( remoteFileWidget ); |
321 | mRemotePrecommand = new QLineEdit(temphb); | 321 | mRemotePrecommand = new QLineEdit(temphb); |
322 | mRemotePrecommandAB = new QLineEdit(temphb); | 322 | mRemotePrecommandAB = new QLineEdit(temphb); |
323 | mRemotePrecommandPWM = new QLineEdit(temphb); | 323 | mRemotePrecommandPWM = new QLineEdit(temphb); |
324 | 324 | ||
325 | lab = new QLabel( i18n("Local temp file:"), remoteFileWidget); | 325 | lab = new QLabel( i18n("Local temp file:"), remoteFileWidget); |
326 | temphb = new QHBox( remoteFileWidget ); | 326 | temphb = new QHBox( remoteFileWidget ); |
327 | mLocalTempFile = new QLineEdit(temphb); | 327 | mLocalTempFile = new QLineEdit(temphb); |
328 | mLocalTempFileAB = new QLineEdit(temphb); | 328 | mLocalTempFileAB = new QLineEdit(temphb); |
329 | mLocalTempFilePWM = new QLineEdit(temphb); | 329 | mLocalTempFilePWM = new QLineEdit(temphb); |
330 | 330 | ||
331 | lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget); | 331 | lab = new QLabel( i18n("Post sync (upload) command:"), remoteFileWidget); |
332 | temphb = new QHBox( remoteFileWidget ); | 332 | temphb = new QHBox( remoteFileWidget ); |
333 | mRemotePostcommand = new QLineEdit(temphb ); | 333 | mRemotePostcommand = new QLineEdit(temphb ); |
334 | mRemotePostcommandAB = new QLineEdit(temphb ); | 334 | mRemotePostcommandAB = new QLineEdit(temphb ); |
335 | mRemotePostcommandPWM = new QLineEdit(temphb ); | 335 | mRemotePostcommandPWM = new QLineEdit(temphb ); |
336 | mIsKapiFileR = new QCheckBox( i18n("Addressbook file is used by KA/Pi"), remoteFileWidget ); | 336 | mIsKapiFileR = new QCheckBox( i18n("Addressbook file is used by KA/Pi"), remoteFileWidget ); |
337 | lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget); | 337 | lab = new QLabel( i18n("Fill in default values for:"), remoteFileWidget); |
338 | temphb = new QHBox( remoteFileWidget ); | 338 | temphb = new QHBox( remoteFileWidget ); |
339 | button = new QPushButton( i18n("ssh/scp"), temphb ); | 339 | button = new QPushButton( i18n("ssh/scp"), temphb ); |
340 | connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) ); | 340 | connect ( button, SIGNAL( clicked()), this, SLOT (fillSSH() ) ); |
341 | button = new QPushButton( i18n("ftp"), temphb ); | 341 | button = new QPushButton( i18n("ftp"), temphb ); |
342 | connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) ); | 342 | connect ( button, SIGNAL( clicked()), this, SLOT (fillFTP() ) ); |
343 | lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget); | 343 | lab = new QLabel( i18n("Hint: Use $PWD$ for placeholder of password!"), remoteFileWidget); |
344 | 344 | ||
345 | // *** pi-sync******************************* | 345 | // *** pi-sync******************************* |
346 | piWidget = new QVBox( topFrame); | 346 | piWidget = new QVBox( topFrame); |
347 | //topLayout->addMultiCellWidget(piWidget, iii,iii,0,1); | 347 | //topLayout->addMultiCellWidget(piWidget, iii,iii,0,1); |
348 | //++iii; | 348 | //++iii; |
349 | temphb = new QHBox( piWidget ); | 349 | temphb = new QHBox( piWidget ); |
350 | new QLabel( i18n("Calendar:"), temphb); | 350 | new QLabel( i18n("Calendar:"), temphb); |
351 | new QLabel( i18n("AddressBook:"), temphb); | 351 | new QLabel( i18n("AddressBook:"), temphb); |
352 | new QLabel( i18n("PWManager:"), temphb); | 352 | new QLabel( i18n("PWManager:"), temphb); |
353 | 353 | ||
354 | lab = new QLabel( i18n("Password for remote access: (could be the same for each)"), piWidget); | 354 | lab = new QLabel( i18n("Password for remote access: (could be the same for each)"), piWidget); |
355 | temphb = new QHBox( piWidget ); | 355 | temphb = new QHBox( piWidget ); |
356 | mRemotePw = new QLineEdit(temphb); | 356 | mRemotePw = new QLineEdit(temphb); |
357 | mRemotePwAB = new QLineEdit(temphb); | 357 | mRemotePwAB = new QLineEdit(temphb); |
358 | mRemotePwPWM = new QLineEdit(temphb); | 358 | mRemotePwPWM = new QLineEdit(temphb); |
359 | 359 | ||
360 | lab = new QLabel( i18n("Remote IP address: (could be the same for each)"), piWidget); | 360 | lab = new QLabel( i18n("Remote IP address: (could be the same for each)"), piWidget); |
361 | temphb = new QHBox( piWidget ); | 361 | temphb = new QHBox( piWidget ); |
362 | mRemoteIP = new QLineEdit(temphb); | 362 | mRemoteIP = new QLineEdit(temphb); |
363 | mRemoteIPAB = new QLineEdit(temphb); | 363 | mRemoteIPAB = new QLineEdit(temphb); |
364 | mRemoteIPPWM = new QLineEdit(temphb); | 364 | mRemoteIPPWM = new QLineEdit(temphb); |
365 | 365 | ||
366 | lab = new QLabel( i18n("Remote port number: (should be different for each)"), piWidget); | 366 | lab = new QLabel( i18n("Remote port number: (should be different for each)"), piWidget); |
367 | temphb = new QHBox( piWidget ); | 367 | temphb = new QHBox( piWidget ); |
368 | mRemotePort = new QLineEdit(temphb); | 368 | mRemotePort = new QLineEdit(temphb); |
369 | mRemotePortAB = new QLineEdit(temphb); | 369 | mRemotePortAB = new QLineEdit(temphb); |
370 | mRemotePortPWM = new QLineEdit(temphb); | 370 | mRemotePortPWM = new QLineEdit(temphb); |
371 | 371 | ||
372 | lab = new QLabel( i18n("Local/remote Resource sync partners"), piWidget); | 372 | lab = new QLabel( i18n("Local/remote Resource sync partners (Leave empty to not sync)"), piWidget); |
373 | mTableBox = new QHBox( piWidget ); | 373 | mTableBox = new QHBox( piWidget ); |
374 | mResTableKopi = new QTable( 1, 1, mTableBox ); | 374 | mResTableKopi = new QTable( 1, 1, mTableBox ); |
375 | mResTableKapi = new QTable( 1, 1, mTableBox ); | 375 | mResTableKapi = new QTable( 1, 1, mTableBox ); |
376 | mResTablePwmpi = new QTable( 1, 1, mTableBox ); | 376 | mResTablePwmpi = new QTable( 1, 1, mTableBox ); |
377 | mResTableKopi->horizontalHeader()->setLabel( 0, i18n("Remote") ); | 377 | mResTableKopi->horizontalHeader()->setLabel( 0, i18n("Remote") ); |
378 | mResTableKapi->horizontalHeader()->setLabel( 0, i18n("Remote") ); | 378 | mResTableKapi->horizontalHeader()->setLabel( 0, i18n("Remote") ); |
379 | mResTablePwmpi->horizontalHeader()->setLabel( 0, i18n("Remote") ); | 379 | mResTablePwmpi->horizontalHeader()->setLabel( 0, i18n("Remote") ); |
380 | mResTableKopi->setLeftMargin( 80 ); | 380 | mResTableKopi->setLeftMargin( 80 ); |
381 | } | 381 | } |
382 | // ****************************************** | 382 | // ****************************************** |
383 | // Profile kind specific settings END | 383 | // Profile kind specific settings END |
384 | 384 | ||
385 | } | 385 | } |
386 | 386 | ||
387 | void KSyncPrefsDialog::readResources() | 387 | void KSyncPrefsDialog::readResources() |
388 | { | 388 | { |
389 | mResourcesKopi.clear(); | 389 | mResourcesKopi.clear(); |
390 | mResourcesKapi.clear(); | 390 | mResourcesKapi.clear(); |
391 | KConfig fc(locateLocal("config","kopicalendarrc")); | 391 | KConfig fc(locateLocal("config","kopicalendarrc")); |
392 | fc.setGroup("CC"); | 392 | fc.setGroup("CC"); |
393 | int numCals = fc.readNumEntry("NumberCalendars",0 ); | 393 | int numCals = fc.readNumEntry("NumberCalendars",0 ); |
394 | int curCal = 1; | 394 | int curCal = 1; |
395 | while ( curCal <= numCals ) { | 395 | while ( curCal <= numCals ) { |
396 | QString prefix = "Cal_" +QString::number( curCal ); | 396 | QString prefix = "Cal_" +QString::number( curCal ); |
397 | QString name = fc.readEntry( prefix+"_Name", "Calendar"); | 397 | QString name = fc.readEntry( prefix+"_Name", "Calendar"); |
398 | mResourcesKopi.append( name ); | 398 | mResourcesKopi.append( name ); |
399 | ++curCal; | 399 | ++curCal; |
400 | } | 400 | } |
401 | mResTableKopi->setNumRows( mResourcesKopi.count() ); | 401 | mResTableKopi->setNumRows( mResourcesKopi.count() ); |
402 | int i; | 402 | int i; |
403 | for ( i = 0;i < mResourcesKopi.count(); ++i ) { | 403 | for ( i = 0;i < mResourcesKopi.count(); ++i ) { |
404 | mResTableKopi->verticalHeader ()->setLabel( i, mResourcesKopi[i] ); | 404 | mResTableKopi->verticalHeader ()->setLabel( i, mResourcesKopi[i] ); |
405 | } | 405 | } |
406 | } | 406 | } |
407 | void KSyncPrefsDialog::readFilter() | 407 | void KSyncPrefsDialog::readFilter() |
408 | { | 408 | { |
409 | mFilterKapi.clear(); | 409 | mFilterKapi.clear(); |
410 | mFilterKopi.clear(); | 410 | mFilterKopi.clear(); |
411 | KConfig cfgko(locateLocal("config","korganizerrc")); | 411 | KConfig cfgko(locateLocal("config","korganizerrc")); |
412 | KConfig cfgka(locateLocal("config","kaddressbookrc")); | 412 | KConfig cfgka(locateLocal("config","kaddressbookrc")); |
413 | cfgko.setGroup("General"); | 413 | cfgko.setGroup("General"); |
414 | mFilterKopi = cfgko.readListEntry("CalendarFilters"); | 414 | mFilterKopi = cfgko.readListEntry("CalendarFilters"); |
415 | cfgka.setGroup("Filter"); | 415 | cfgka.setGroup("Filter"); |
416 | int count = cfgka.readNumEntry( "Count", 0 ); | 416 | int count = cfgka.readNumEntry( "Count", 0 ); |
417 | for ( int i = 0; i < count; i++ ) { | 417 | for ( int i = 0; i < count; i++ ) { |
418 | cfgka.setGroup("Filter_"+QString::number( i ) ); | 418 | cfgka.setGroup("Filter_"+QString::number( i ) ); |
419 | mFilterKapi.append( cfgka.readEntry("Name", "internal error") ); | 419 | mFilterKapi.append( cfgka.readEntry("Name", "internal error") ); |
420 | } | 420 | } |
421 | mFilterOutCal->clear(); | 421 | mFilterOutCal->clear(); |
422 | mFilterInCal->clear(); | 422 | mFilterInCal->clear(); |
423 | mFilterOutAB->clear(); | 423 | mFilterOutAB->clear(); |
424 | mFilterInAB->clear(); | 424 | mFilterInAB->clear(); |
425 | QStringList temp = mFilterKopi; | 425 | QStringList temp = mFilterKopi; |
426 | temp.prepend(i18n("No Filter") ); | 426 | temp.prepend(i18n("No Filter") ); |
427 | mFilterOutCal->insertStringList( temp ); | 427 | mFilterOutCal->insertStringList( temp ); |
428 | mFilterInCal->insertStringList( temp ); | 428 | mFilterInCal->insertStringList( temp ); |
429 | temp = mFilterKapi; | 429 | temp = mFilterKapi; |
430 | temp.prepend(i18n("No Filter") ); | 430 | temp.prepend(i18n("No Filter") ); |
431 | mFilterOutAB->insertStringList( temp ); | 431 | mFilterOutAB->insertStringList( temp ); |
432 | mFilterInAB->insertStringList( temp ); | 432 | mFilterInAB->insertStringList( temp ); |
433 | } | 433 | } |
434 | 434 | ||
435 | void KSyncPrefsDialog::slotOK() | 435 | void KSyncPrefsDialog::slotOK() |
436 | { | 436 | { |
437 | if ( mMyMachineName->text() == "undefined" ) { | 437 | if ( mMyMachineName->text() == "undefined" ) { |
438 | KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error")); | 438 | KMessageBox::error(this,i18n("Local device name undefined!\nPlease define device name!"),i18n("KO/Pi config error")); |
439 | return; | 439 | return; |
440 | } | 440 | } |
441 | int i; | 441 | int i; |
442 | for (i = 0; i < mSyncProfileNames.count(); ++ i) { | 442 | for (i = 0; i < mSyncProfileNames.count(); ++ i) { |
443 | if ( mSyncProfileNames.contains( mSyncProfileNames[i]) > 1 ) { | 443 | if ( mSyncProfileNames.contains( mSyncProfileNames[i]) > 1 ) { |
444 | KMessageBox::error(this,i18n("Multiple profiles with same name!\nPlease use unique profile names!"),i18n("KO/Pi config error")); | 444 | KMessageBox::error(this,i18n("Multiple profiles with same name!\nPlease use unique profile names!"),i18n("KO/Pi config error")); |
445 | return; | 445 | return; |
446 | } | 446 | } |
447 | } | 447 | } |
448 | usrWriteConfig(); | 448 | usrWriteConfig(); |
449 | QDialog::accept(); | 449 | QDialog::accept(); |
450 | } | 450 | } |
451 | void KSyncPrefsDialog::accept() | 451 | void KSyncPrefsDialog::accept() |
452 | { | 452 | { |
453 | slotOK(); | 453 | slotOK(); |
454 | } | 454 | } |
455 | void KSyncPrefsDialog::chooseFile() | 455 | void KSyncPrefsDialog::chooseFile() |
456 | { | 456 | { |
457 | QString fn = QDir::homeDirPath(); | 457 | QString fn = QDir::homeDirPath(); |
458 | 458 | ||
459 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); | 459 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); |
460 | if ( fn == "" ) | 460 | if ( fn == "" ) |
461 | return; | 461 | return; |
462 | mRemoteFile->setText( fn ); | 462 | mRemoteFile->setText( fn ); |
463 | } | 463 | } |
464 | 464 | ||
465 | void KSyncPrefsDialog::chooseFileAB() | 465 | void KSyncPrefsDialog::chooseFileAB() |
466 | { | 466 | { |
467 | QString fn = QDir::homeDirPath(); | 467 | QString fn = QDir::homeDirPath(); |
468 | 468 | ||
469 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.vcf)"), this ); | 469 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.vcf)"), this ); |
470 | if ( fn == "" ) | 470 | if ( fn == "" ) |
471 | return; | 471 | return; |
472 | mRemoteFileAB->setText( fn ); | 472 | mRemoteFileAB->setText( fn ); |
473 | } | 473 | } |
474 | 474 | ||
475 | void KSyncPrefsDialog::chooseFilePWM() | 475 | void KSyncPrefsDialog::chooseFilePWM() |
476 | { | 476 | { |
477 | QString fn = QDir::homeDirPath(); | 477 | QString fn = QDir::homeDirPath(); |
478 | 478 | ||
479 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.pwm)"), this ); | 479 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.pwm)"), this ); |
480 | if ( fn == "" ) | 480 | if ( fn == "" ) |
481 | return; | 481 | return; |
482 | mRemoteFilePWM->setText( fn ); | 482 | mRemoteFilePWM->setText( fn ); |
483 | } | 483 | } |
484 | 484 | ||
485 | void KSyncPrefsDialog::textChanged( const QString & s ) | 485 | void KSyncPrefsDialog::textChanged( const QString & s ) |
486 | { | 486 | { |
487 | if ( mProfileBox->count() == 0 ) | 487 | if ( mProfileBox->count() == 0 ) |
488 | return; | 488 | return; |
489 | if ( currentSelection < 3 ) { | 489 | if ( currentSelection < 3 ) { |
490 | //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error")); | 490 | //KMessageBox::error(this,i18n("This profil name\ncannot be edited!\n"),i18n("KO/Pi config error")); |
491 | mProfileBox->blockSignals( true ); | 491 | mProfileBox->blockSignals( true ); |
492 | mProfileBox->setCurrentItem(mProfileBox-> currentItem ()); | 492 | mProfileBox->setCurrentItem(mProfileBox-> currentItem ()); |
493 | mProfileBox->blockSignals( false ); | 493 | mProfileBox->blockSignals( false ); |
494 | return; | 494 | return; |
495 | } | 495 | } |
496 | //qDebug("cur i %d ",mProfileBox-> currentItem () ); | 496 | //qDebug("cur i %d ",mProfileBox-> currentItem () ); |
497 | mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ; | 497 | mProfileBox->changeItem ( s, mProfileBox-> currentItem () ) ; |
498 | KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ; | 498 | KSyncProfile* prof = mSyncProfiles.at(mProfileBox-> currentItem ()) ; |
499 | prof->setName( s ); | 499 | prof->setName( s ); |
500 | mSyncProfileNames[mProfileBox-> currentItem ()] = s; | 500 | mSyncProfileNames[mProfileBox-> currentItem ()] = s; |