summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.cpp16
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.h3
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp3
3 files changed, 16 insertions, 6 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 ) );
diff --git a/noncore/net/wellenreiter/gui/configwindow.h b/noncore/net/wellenreiter/gui/configwindow.h
index 5c998cb..d31d1e8 100644
--- a/noncore/net/wellenreiter/gui/configwindow.h
+++ b/noncore/net/wellenreiter/gui/configwindow.h
@@ -59,23 +59,24 @@ class WellenreiterConfigWindow : public WellenreiterConfigBase
59 void load(); 59 void load();
60 60
61 public slots: 61 public slots:
62 void changedDeviceType(int); 62 void changedDeviceType(int);
63 void changedNetworkAction(int t); 63 void changedNetworkAction(int t);
64 void changedClientAction(int t); 64 void changedClientAction(int t);
65 void changedStationAction(int t); 65 void changedStationAction(int t);
66 void getCaptureFileNameClicked(); 66 void getCaptureFileNameClicked();
67 void performAutodetection(); 67 void performAutodetection();
68 void channelAllClicked(int); 68 void channelAllClicked(int);
69 void performAction( const QString&, const QString&, const QString&, bool, int, int /* , const GpsLocation& */ ); 69 void performAction( const QString&, const QString&, const QString&, bool, int, int /* , const GpsLocation& */ );
70 70
71 protected: 71 protected slots:
72 void synchronizeActionsAndScripts(); 72 void synchronizeActionsAndScripts();
73 virtual void accept();
73 74
74 protected: 75 protected:
75 QMap<QString, int> _devicetype; 76 QMap<QString, int> _devicetype;
76 static WellenreiterConfigWindow* _instance; 77 static WellenreiterConfigWindow* _instance;
77 int _guess; 78 int _guess;
78 79
79}; 80};
80 81
81#endif 82#endif
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index fd88b63..10ead53 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -423,24 +423,27 @@ MScanListItem::MScanListItem( QListView* parent, const QString& type, const QStr
423 WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here 423 WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here
424 424
425 decorateItem( type, essid, macaddr, wep, channel, signal, probed ); 425 decorateItem( type, essid, macaddr, wep, channel, signal, probed );
426} 426}
427 427
428MScanListItem::MScanListItem( QListViewItem* parent, const QString& type, const QString& essid, const QString& macaddr, 428MScanListItem::MScanListItem( QListViewItem* parent, const QString& type, const QString& essid, const QString& macaddr,
429 bool wep, int channel, int signal ) 429 bool wep, int channel, int signal )
430 :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) 430 :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null )
431{ 431{
432 #ifdef DEBUG 432 #ifdef DEBUG
433 qDebug( "creating scanlist item" ); 433 qDebug( "creating scanlist item" );
434 #endif 434 #endif
435 if ( WellenreiterConfigWindow::instance() )
436 WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here
437
435 decorateItem( type, essid, macaddr, wep, channel, signal, false ); 438 decorateItem( type, essid, macaddr, wep, channel, signal, false );
436} 439}
437 440
438const QString& MScanListItem::essid() const 441const QString& MScanListItem::essid() const
439{ 442{
440 if ( type == "network" ) 443 if ( type == "network" )
441 return _essid; 444 return _essid;
442 else 445 else
443 return ( (MScanListItem*) parent() )->essid(); 446 return ( (MScanListItem*) parent() )->essid();
444} 447}
445 448
446OListViewItem* MScanListItem::childFactory() 449OListViewItem* MScanListItem::childFactory()