summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show 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
@@ -89,15 +89,21 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char
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
@@ -305,13 +311,13 @@ void WellenreiterConfigWindow::performAction( const QString& type,
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;
@@ -395,17 +401,17 @@ void WellenreiterConfigWindow::load()
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
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
@@ -65,14 +65,15 @@ class WellenreiterConfigWindow : public WellenreiterConfigBase
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
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
@@ -429,12 +429,15 @@ MScanListItem::MScanListItem( QListViewItem* parent, const QString& type, const
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" )