summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2004-05-03 12:47:50 (UTC)
committer mickeyl <mickeyl>2004-05-03 12:47:50 (UTC)
commit0490226f4ed54fdeef5578255594830659a8d3bd (patch) (unidiff)
treee960e0d3d8f916927a9c7c911b1b496475b21e07
parentfb6f93892d4d0e0471d62f5b5ab6d9bdef0a5e76 (diff)
downloadopie-0490226f4ed54fdeef5578255594830659a8d3bd.zip
opie-0490226f4ed54fdeef5578255594830659a8d3bd.tar.gz
opie-0490226f4ed54fdeef5578255594830659a8d3bd.tar.bz2
write more settings into the .config file and read it
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp
index 89ed24c..ae149e2 100644
--- a/noncore/net/wellenreiter/gui/configwindow.cpp
+++ b/noncore/net/wellenreiter/gui/configwindow.cpp
@@ -372,112 +372,121 @@ void WellenreiterConfigWindow::load()
372#if QT_VERSION < 300 372#if QT_VERSION < 300
373 interfaceName->insertItem( interface, 0 ); 373 interfaceName->insertItem( interface, 0 );
374 interfaceName->setCurrentItem( 0 ); 374 interfaceName->setCurrentItem( 0 );
375#else 375#else
376 interfaceName->setCurrentText( interface ); 376 interfaceName->setCurrentText( interface );
377#endif 377#endif
378 378
379 QString device = c->readEntry( "type", "<select>" ); 379 QString device = c->readEntry( "type", "<select>" );
380#if QT_VERSION < 300 380#if QT_VERSION < 300
381 for ( int i = 0; i < deviceType->count(); ++i ) 381 for ( int i = 0; i < deviceType->count(); ++i )
382 { 382 {
383 if ( deviceType->text( i ) == device ) 383 if ( deviceType->text( i ) == device )
384 { 384 {
385 deviceType->setCurrentItem( i ); 385 deviceType->setCurrentItem( i );
386 break; 386 break;
387 } 387 }
388 } 388 }
389#else 389#else
390 deviceType->setCurrentText( device ); 390 deviceType->setCurrentText( device );
391#endif 391#endif
392 } 392 }
393 else 393 else
394 { 394 {
395 performAutodetection(); 395 performAutodetection();
396 } 396 }
397 397
398 prismHeader->setChecked( c->readBoolEntry( "prism", false ) ); 398 prismHeader->setChecked( c->readBoolEntry( "prism", false ) );
399 hopChannels->setChecked( c->readBoolEntry( "hop", true ) ); 399 hopChannels->setChecked( c->readBoolEntry( "hop", true ) );
400 hopInterval->setValue( c->readNumEntry( "interval", 250 ) ); 400 hopInterval->setValue( c->readNumEntry( "interval", 250 ) );
401 adaptiveHopping->setChecked( c->readBoolEntry( "adaptive", true ) ); 401 adaptiveHopping->setChecked( c->readBoolEntry( "adaptive", true ) );
402 402
403 c->setGroup( "Capture" ); 403 c->setGroup( "Capture" );
404 writeCaptureFile->setChecked( c->readBoolEntry( "writeCaptureFile", true ) );
405 captureFileName->setEnabled( writeCaptureFile->isChecked() );
406 getCaptureFileName->setEnabled( writeCaptureFile->isChecked() );
404 captureFileName->setText( c->readEntry( "filename", "/tmp/capture" ) ); 407 captureFileName->setText( c->readEntry( "filename", "/tmp/capture" ) );
408 hexViewBufferUnlimited->setChecked( c->readBoolEntry( "hexViewBufferUnlimited", true ) );
409 hexViewBufferLimited->setChecked( !c->readBoolEntry( "hexViewBufferUnlimited", true ) );
410 hexViewBufferSize->setValue( c->readNumEntry( "hexViewBufferSize", 2000 ) );
405 411
406 c->setGroup( "UI" ); 412 c->setGroup( "UI" );
407 lookupVendor->setChecked( c->readBoolEntry( "lookupVendor", true ) ); 413 lookupVendor->setChecked( c->readBoolEntry( "lookupVendor", true ) );
408 openTree->setChecked( c->readBoolEntry( "openTree", true ) ); 414 openTree->setChecked( c->readBoolEntry( "openTree", true ) );
409 disablePM->setChecked( c->readBoolEntry( "disablePM", true ) ); 415 disablePM->setChecked( c->readBoolEntry( "disablePM", true ) );
410 newNetworkAction->setCurrentItem( c->readNumEntry( "newNetworkAction", 1 ) ); // Default: Play Alarm 416 newNetworkAction->setCurrentItem( c->readNumEntry( "newNetworkAction", 1 ) ); // Default: Play Alarm
411 newNetworkScript->setText( c->readEntry( "newNetworkScript", "" ) ); 417 newNetworkScript->setText( c->readEntry( "newNetworkScript", "" ) );
412 newClientAction->setCurrentItem( c->readNumEntry( "newClientAction", 2 ) ); // Default: Play Click 418 newClientAction->setCurrentItem( c->readNumEntry( "newClientAction", 2 ) ); // Default: Play Click
413 newClientScript->setText( c->readEntry( "newClientScript", "" ) ); 419 newClientScript->setText( c->readEntry( "newClientScript", "" ) );
414 newStationAction->setCurrentItem( c->readNumEntry( "newStationAction", 2 ) ); // Default: Play Click 420 newStationAction->setCurrentItem( c->readNumEntry( "newStationAction", 2 ) ); // Default: Play Click
415 newStationScript->setText( c->readEntry( "newStationScript", "" ) ); 421 newStationScript->setText( c->readEntry( "newStationScript", "" ) );
416 synchronizeActionsAndScripts(); // needed for showing/hiding the script QLineEdit on demand 422 synchronizeActionsAndScripts(); // needed for showing/hiding the script QLineEdit on demand
417 423
418 c->setGroup( "GPS" ); 424 c->setGroup( "GPS" );
419 enableGPS->setChecked( c->readBoolEntry( "use", false ) ); 425 enableGPS->setChecked( c->readBoolEntry( "use", false ) );
420#if QT_VERSION < 300 426#if QT_VERSION < 300
421 gpsdHost->insertItem( c->readEntry( "host", "localhost" ), 0 ); 427 gpsdHost->insertItem( c->readEntry( "host", "localhost" ), 0 );
422 gpsdHost->setCurrentItem( 0 ); 428 gpsdHost->setCurrentItem( 0 );
423#else 429#else
424 gpsdHost->setCurrentText( c->readEntry( "host", "localhost" ) ); 430 gpsdHost->setCurrentText( c->readEntry( "host", "localhost" ) );
425#endif 431#endif
426 gpsdPort->setValue( c->readNumEntry( "port", 2947 ) ); 432 gpsdPort->setValue( c->readNumEntry( "port", 2947 ) );
427 startGPS->setChecked( c->readBoolEntry( "start", false ) ); 433 startGPS->setChecked( c->readBoolEntry( "start", false ) );
428 commandGPS->setText( c->readEntry( "command", "gpsd -p /dev/ttyS3 -s 57600" ) ); 434 commandGPS->setText( c->readEntry( "command", "gpsd -p /dev/ttyS3 -s 57600" ) );
429 435
430#endif 436#endif
431} 437}
432 438
433 439
434void WellenreiterConfigWindow::save() 440void WellenreiterConfigWindow::save()
435{ 441{
436#ifdef Q_WS_X11 442#ifdef Q_WS_X11
437 #warning Persistent Configuration not yet implemented for standalone X11 build 443 #warning Persistent Configuration not yet implemented for standalone X11 build
438#else 444#else
439 odebug << "saving configuration settings..." << oendl; 445 odebug << "saving configuration settings..." << oendl;
440 446
441 /* This is dumb monkey typing stuff... We _need_ to do this automatically! */ 447 /* This is dumb monkey typing stuff... We _need_ to do this automatically! */
442 448
443 OConfig* c = oApp->config(); 449 OConfig* c = oApp->config();
444 450
445 c->setGroup( "Interface" ); 451 c->setGroup( "Interface" );
446 c->writeEntry( "name", interfaceName->currentText() ); 452 c->writeEntry( "name", interfaceName->currentText() );
447 c->writeEntry( "type", deviceType->currentText() ); 453 c->writeEntry( "type", deviceType->currentText() );
448 c->writeEntry( "prism", prismHeader->isChecked() ); 454 c->writeEntry( "prism", prismHeader->isChecked() );
449 c->writeEntry( "hop", hopChannels->isChecked() ); 455 c->writeEntry( "hop", hopChannels->isChecked() );
450 c->writeEntry( "interval", hopInterval->value() ); 456 c->writeEntry( "interval", hopInterval->value() );
451 c->writeEntry( "adaptive", adaptiveHopping->isChecked() ); 457 c->writeEntry( "adaptive", adaptiveHopping->isChecked() );
452 458
453 c->setGroup( "Capture" ); 459 c->setGroup( "Capture" );
460 c->writeEntry( "writeCaptureFile", writeCaptureFile->isChecked() );
454 c->writeEntry( "filename", captureFileName->text() ); 461 c->writeEntry( "filename", captureFileName->text() );
462 c->writeEntry( "hexViewBufferUnlimited", hexViewBufferUnlimited->isChecked() );
463 c->writeEntry( "hexViewBufferSize", hexViewBufferSize->value() );
455 464
456 c->setGroup( "UI" ); 465 c->setGroup( "UI" );
457 c->writeEntry( "lookupVendor", lookupVendor->isChecked() ); 466 c->writeEntry( "lookupVendor", lookupVendor->isChecked() );
458 c->writeEntry( "openTree", openTree->isChecked() ); 467 c->writeEntry( "openTree", openTree->isChecked() );
459 c->writeEntry( "disablePM", disablePM->isChecked() ); 468 c->writeEntry( "disablePM", disablePM->isChecked() );
460 c->writeEntry( "newNetworkAction", newNetworkAction->currentItem() ); 469 c->writeEntry( "newNetworkAction", newNetworkAction->currentItem() );
461 c->writeEntry( "newNetworkScript", newNetworkScript->text() ); 470 c->writeEntry( "newNetworkScript", newNetworkScript->text() );
462 c->writeEntry( "newClientAction", newClientAction->currentItem() ); 471 c->writeEntry( "newClientAction", newClientAction->currentItem() );
463 c->writeEntry( "newClientScript", newClientScript->text() ); 472 c->writeEntry( "newClientScript", newClientScript->text() );
464 c->writeEntry( "newStationAction", newStationAction->currentItem() ); 473 c->writeEntry( "newStationAction", newStationAction->currentItem() );
465 c->writeEntry( "newStationScript", newStationScript->text() ); 474 c->writeEntry( "newStationScript", newStationScript->text() );
466 475
467 c->setGroup( "GPS" ); 476 c->setGroup( "GPS" );
468 c->writeEntry( "use", enableGPS->isChecked() ); 477 c->writeEntry( "use", enableGPS->isChecked() );
469 c->writeEntry( "host", gpsdHost->currentText() ); 478 c->writeEntry( "host", gpsdHost->currentText() );
470 c->writeEntry( "port", gpsdPort->value() ); 479 c->writeEntry( "port", gpsdPort->value() );
471 c->writeEntry( "start", startGPS->isChecked() ); 480 c->writeEntry( "start", startGPS->isChecked() );
472 c->writeEntry( "command", commandGPS->text() ); 481 c->writeEntry( "command", commandGPS->text() );
473 482
474 c->write(); 483 c->write();
475 484
476#endif 485#endif
477} 486}
478 487
479 488
480int WellenreiterConfigWindow::hexViewBuffer() const 489int WellenreiterConfigWindow::hexViewBuffer() const
481{ 490{
482 return hexViewBufferUnlimited->isChecked() ? -1 : hexViewBufferSize->value(); 491 return hexViewBufferUnlimited->isChecked() ? -1 : hexViewBufferSize->value();
483} 492}