summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/configwindow.cpp
Unidiff
Diffstat (limited to 'noncore/net/wellenreiter/gui/configwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp
index 7f39230..9358866 100644
--- a/noncore/net/wellenreiter/gui/configwindow.cpp
+++ b/noncore/net/wellenreiter/gui/configwindow.cpp
@@ -83,27 +83,33 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char
83 connect( getCaptureFileName, SIGNAL( clicked() ), this, SLOT( getCaptureFileNameClicked() ) ); 83 connect( getCaptureFileName, SIGNAL( clicked() ), this, SLOT( getCaptureFileNameClicked() ) );
84 84
85 // make the checkbox 'channelAll' control all other channels 85 // make the checkbox 'channelAll' control all other channels
86 connect( channelAll, SIGNAL( stateChanged(int) ), this, SLOT( channelAllClicked(int) ) ); 86 connect( channelAll, SIGNAL( stateChanged(int) ), this, SLOT( channelAllClicked(int) ) );
87 87
88 connect( autodetect, SIGNAL( clicked() ), this, SLOT( performAutodetection() ) ); 88 connect( autodetect, SIGNAL( clicked() ), this, SLOT( performAutodetection() ) );
89 89
90 // hide tab4 (parse) until Wellenreiter 1.2 90 // hide tab4 (parse) until Wellenreiter 1.2
91 tab->removePage( tab_4 ); 91 tab->removePage( tab_4 );
92}; 92};
93 93
94 94
95WellenreiterConfigWindow::~WellenreiterConfigWindow() 95void WellenreiterConfigWindow::accept()
96{ 96{
97 save(); 97 save();
98 QDialog::accept();
99}
100
101
102WellenreiterConfigWindow::~WellenreiterConfigWindow()
103{
98} 104}
99 105
100 106
101void WellenreiterConfigWindow::performAutodetection() 107void WellenreiterConfigWindow::performAutodetection()
102{ 108{
103 //TODO: insert modal splash screen here 109 //TODO: insert modal splash screen here
104 // and sleep a second, so that it looks 110 // and sleep a second, so that it looks
105 // like we're actually doing something fancy... ;-) 111 // like we're actually doing something fancy... ;-)
106 112
107 qDebug( "WellenreiterConfigWindow::performAutodetection()" ); 113 qDebug( "WellenreiterConfigWindow::performAutodetection()" );
108 114
109 // try to guess device type 115 // try to guess device type
@@ -299,25 +305,25 @@ void WellenreiterConfigWindow::performAction( const QString& type,
299 } 305 }
300 else if ( type == "station" ) 306 else if ( type == "station" )
301 { 307 {
302 action = newStationAction->currentItem(); 308 action = newStationAction->currentItem();
303 script = newStationScript->text(); 309 script = newStationScript->text();
304 } 310 }
305 else 311 else
306 { 312 {
307 qWarning( "WellenreiterConfigWindow::performAction(): unknown type '%s'", (const char*) type ); 313 qWarning( "WellenreiterConfigWindow::performAction(): unknown type '%s'", (const char*) type );
308 return; 314 return;
309 } 315 }
310 316
311 qDebug( "going to perform action %d (script='%s')", action, (const char*) script ); 317 qDebug( "for event '%s' I'm going to perform action %d (script='%s')", (const char*) type, action, (const char*) script );
312 318
313 switch( action ) 319 switch( action )
314 { 320 {
315 case 0: /* Ignore */ return; 321 case 0: /* Ignore */ return;
316 case 1: /* Play Alarm */ ODevice::inst()->alarmSound(); return; 322 case 1: /* Play Alarm */ ODevice::inst()->alarmSound(); return;
317 case 2: /* Play Click */ ODevice::inst()->touchSound(); return; 323 case 2: /* Play Click */ ODevice::inst()->touchSound(); return;
318 case 3: /* Blink LED */ break; //FIXME: Implement this 324 case 3: /* Blink LED */ break; //FIXME: Implement this
319 case 4: /* Run Script */ 325 case 4: /* Run Script */
320 { 326 {
321 /** 327 /**
322 * 328 *
323 * Script Substitution Information: 329 * Script Substitution Information:
@@ -389,29 +395,29 @@ void WellenreiterConfigWindow::load()
389 prismHeader->setChecked( c->readBoolEntry( "prism", false ) ); 395 prismHeader->setChecked( c->readBoolEntry( "prism", false ) );
390 hopChannels->setChecked( c->readBoolEntry( "hop", true ) ); 396 hopChannels->setChecked( c->readBoolEntry( "hop", true ) );
391 hopInterval->setValue( c->readNumEntry( "interval", 250 ) ); 397 hopInterval->setValue( c->readNumEntry( "interval", 250 ) );
392 adaptiveHopping->setChecked( c->readBoolEntry( "adaptive", true ) ); 398 adaptiveHopping->setChecked( c->readBoolEntry( "adaptive", true ) );
393 399
394 c->setGroup( "Capture" ); 400 c->setGroup( "Capture" );
395 captureFileName->setText( c->readEntry( "filename", "/tmp/capture" ) ); 401 captureFileName->setText( c->readEntry( "filename", "/tmp/capture" ) );
396 402
397 c->setGroup( "UI" ); 403 c->setGroup( "UI" );
398 lookupVendor->setChecked( c->readBoolEntry( "lookupVendor", true ) ); 404 lookupVendor->setChecked( c->readBoolEntry( "lookupVendor", true ) );
399 openTree->setChecked( c->readBoolEntry( "openTree", true ) ); 405 openTree->setChecked( c->readBoolEntry( "openTree", true ) );
400 disablePM->setChecked( c->readBoolEntry( "disablePM", true ) ); 406 disablePM->setChecked( c->readBoolEntry( "disablePM", true ) );
401 newNetworkAction->setCurrentItem( c->readNumEntry( "newNetworkAction", 0 ) ); 407 newNetworkAction->setCurrentItem( c->readNumEntry( "newNetworkAction", 1 ) ); // Default: Play Alarm
402 newNetworkScript->setText( c->readEntry( "newNetworkScript", "" ) ); 408 newNetworkScript->setText( c->readEntry( "newNetworkScript", "" ) );
403 newClientAction->setCurrentItem( c->readNumEntry( "newClientAction", 0 ) ); 409 newClientAction->setCurrentItem( c->readNumEntry( "newClientAction", 2 ) ); // Default: Play Click
404 newClientScript->setText( c->readEntry( "newClientScript", "" ) ); 410 newClientScript->setText( c->readEntry( "newClientScript", "" ) );
405 newStationAction->setCurrentItem( c->readNumEntry( "newStationAction", 0 ) ); 411 newStationAction->setCurrentItem( c->readNumEntry( "newStationAction", 2 ) ); // Default: Play Click
406 newStationScript->setText( c->readEntry( "newStationScript", "" ) ); 412 newStationScript->setText( c->readEntry( "newStationScript", "" ) );
407 synchronizeActionsAndScripts(); // needed for showing/hiding the script QLineEdit on demand 413 synchronizeActionsAndScripts(); // needed for showing/hiding the script QLineEdit on demand
408 414
409 c->setGroup( "GPS" ); 415 c->setGroup( "GPS" );
410 enableGPS->setChecked( c->readBoolEntry( "use", false ) ); 416 enableGPS->setChecked( c->readBoolEntry( "use", false ) );
411#if QT_VERSION < 300 417#if QT_VERSION < 300
412 gpsdHost->insertItem( c->readEntry( "host", "localhost" ), 0 ); 418 gpsdHost->insertItem( c->readEntry( "host", "localhost" ), 0 );
413 gpsdHost->setCurrentItem( 0 ); 419 gpsdHost->setCurrentItem( 0 );
414#else 420#else
415 gpsdHost->setCurrentText( c->readEntry( "host", "localhost" ) ); 421 gpsdHost->setCurrentText( c->readEntry( "host", "localhost" ) );
416#endif 422#endif
417 gpsdPort->setValue( c->readNumEntry( "port", 2947 ) ); 423 gpsdPort->setValue( c->readNumEntry( "port", 2947 ) );