-rw-r--r-- | noncore/net/wellenreiter/gui/configwindow.cpp | 16 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/graphwindow.cpp | 34 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/graphwindow.h | 26 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/logwindow.cpp | 12 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.cpp | 9 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/packetview.cpp | 16 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/protolistview.cpp | 10 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/resource.cpp | 8 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.cpp | 61 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 70 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.h | 5 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiterbase.cpp | 2 | ||||
-rw-r--r-- | noncore/net/wellenreiter/opie-wellenreiter.control | 2 | ||||
-rw-r--r-- | noncore/net/wellenreiter/wellenreiter.pro | 1 |
14 files changed, 154 insertions, 118 deletions
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp index ae149e2..1670f93 100644 --- a/noncore/net/wellenreiter/gui/configwindow.cpp +++ b/noncore/net/wellenreiter/gui/configwindow.cpp | |||
@@ -11,16 +11,17 @@ | |||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | /* LOCAL */ | 16 | /* LOCAL */ |
17 | #include "configwindow.h" | 17 | #include "configwindow.h" |
18 | #include "mainwindow.h" | 18 | #include "mainwindow.h" |
19 | #include "protolistview.h" | ||
19 | 20 | ||
20 | /* OPIE */ | 21 | /* OPIE */ |
21 | #include <opie2/onetwork.h> | 22 | #include <opie2/onetwork.h> |
22 | #ifdef QWS | 23 | #ifdef QWS |
23 | #include <opie2/oapplication.h> | 24 | #include <opie2/oapplication.h> |
24 | #include <opie2/oconfig.h> | 25 | #include <opie2/oconfig.h> |
25 | #include <opie2/odevice.h> | 26 | #include <opie2/odevice.h> |
26 | #include <opie2/odebug.h> | 27 | #include <opie2/odebug.h> |
@@ -179,17 +180,20 @@ bool WellenreiterConfigWindow::isChannelChecked( int channel ) const | |||
179 | case 7: return channel7->isOn(); | 180 | case 7: return channel7->isOn(); |
180 | case 8: return channel8->isOn(); | 181 | case 8: return channel8->isOn(); |
181 | case 9: return channel9->isOn(); | 182 | case 9: return channel9->isOn(); |
182 | case 10: return channel10->isOn(); | 183 | case 10: return channel10->isOn(); |
183 | case 11: return channel11->isOn(); | 184 | case 11: return channel11->isOn(); |
184 | case 12: return channel12->isOn(); | 185 | case 12: return channel12->isOn(); |
185 | case 13: return channel13->isOn(); | 186 | case 13: return channel13->isOn(); |
186 | case 14: return channel14->isOn(); | 187 | case 14: return channel14->isOn(); |
188 | default: return false; | ||
187 | } | 189 | } |
190 | |||
191 | |||
188 | } | 192 | } |
189 | 193 | ||
190 | 194 | ||
191 | void WellenreiterConfigWindow::changedDeviceType(int t) | 195 | void WellenreiterConfigWindow::changedDeviceType(int t) |
192 | { | 196 | { |
193 | if ( t != DEVTYPE_FILE ) return; | 197 | if ( t != DEVTYPE_FILE ) return; |
194 | QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(false); | 198 | QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(false); |
195 | if ( !name.isEmpty() && QFile::exists( name ) ) | 199 | if ( !name.isEmpty() && QFile::exists( name ) ) |
@@ -212,29 +216,29 @@ void WellenreiterConfigWindow::synchronizeActionsAndScripts() | |||
212 | if ( newStationAction->currentItem() == 4 ) newStationScript->show(); else newStationScript->hide(); | 216 | if ( newStationAction->currentItem() == 4 ) newStationScript->show(); else newStationScript->hide(); |
213 | 217 | ||
214 | //newNetworkScript->setEnabled( newNetworkAction->currentItem() == 4 ); | 218 | //newNetworkScript->setEnabled( newNetworkAction->currentItem() == 4 ); |
215 | //newClientScript->setEnabled( newClientAction->currentItem() == 4 ); | 219 | //newClientScript->setEnabled( newClientAction->currentItem() == 4 ); |
216 | //newStationScript->setEnabled( newStationAction->currentItem() == 4 ); | 220 | //newStationScript->setEnabled( newStationAction->currentItem() == 4 ); |
217 | } | 221 | } |
218 | 222 | ||
219 | 223 | ||
220 | void WellenreiterConfigWindow::changedNetworkAction(int t) | 224 | void WellenreiterConfigWindow::changedNetworkAction(int ) |
221 | { | 225 | { |
222 | synchronizeActionsAndScripts(); | 226 | synchronizeActionsAndScripts(); |
223 | } | 227 | } |
224 | 228 | ||
225 | 229 | ||
226 | void WellenreiterConfigWindow::changedClientAction(int t) | 230 | void WellenreiterConfigWindow::changedClientAction(int ) |
227 | { | 231 | { |
228 | synchronizeActionsAndScripts(); | 232 | synchronizeActionsAndScripts(); |
229 | } | 233 | } |
230 | 234 | ||
231 | 235 | ||
232 | void WellenreiterConfigWindow::changedStationAction(int t) | 236 | void WellenreiterConfigWindow::changedStationAction(int ) |
233 | { | 237 | { |
234 | synchronizeActionsAndScripts(); | 238 | synchronizeActionsAndScripts(); |
235 | } | 239 | } |
236 | 240 | ||
237 | 241 | ||
238 | void WellenreiterConfigWindow::getCaptureFileNameClicked() | 242 | void WellenreiterConfigWindow::getCaptureFileNameClicked() |
239 | { | 243 | { |
240 | QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(true); | 244 | QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(true); |
@@ -275,27 +279,26 @@ bool WellenreiterConfigWindow::useGPS() const | |||
275 | const QString WellenreiterConfigWindow::gpsHost() const | 279 | const QString WellenreiterConfigWindow::gpsHost() const |
276 | { | 280 | { |
277 | return useGPS() ? gpsdHost->currentText() : QString::null; | 281 | return useGPS() ? gpsdHost->currentText() : QString::null; |
278 | } | 282 | } |
279 | 283 | ||
280 | 284 | ||
281 | int WellenreiterConfigWindow::gpsPort() const | 285 | int WellenreiterConfigWindow::gpsPort() const |
282 | { | 286 | { |
283 | bool ok; | ||
284 | return useGPS() ? gpsdPort->value() : -1; | 287 | return useGPS() ? gpsdPort->value() : -1; |
285 | } | 288 | } |
286 | 289 | ||
287 | 290 | ||
288 | void WellenreiterConfigWindow::performAction( const QString& type, | 291 | void WellenreiterConfigWindow::performAction( const QString& type, |
289 | const QString& essid, | 292 | const QString& essid, |
290 | const QString& mac, | 293 | const QString& mac, |
291 | bool wep, | 294 | bool wep, |
292 | int channel, | 295 | int channel, |
293 | int signal | 296 | int /* signal */ |
294 | /* , const GpsLocation& loc */ ) | 297 | /* , const GpsLocation& loc */ ) |
295 | { | 298 | { |
296 | int action; | 299 | int action; |
297 | QString script; | 300 | QString script; |
298 | 301 | ||
299 | if ( type == "network" ) | 302 | if ( type == "network" ) |
300 | { | 303 | { |
301 | action = newNetworkAction->currentItem(); | 304 | action = newNetworkAction->currentItem(); |
@@ -312,17 +315,17 @@ void WellenreiterConfigWindow::performAction( const QString& type, | |||
312 | script = newStationScript->text(); | 315 | script = newStationScript->text(); |
313 | } | 316 | } |
314 | else | 317 | else |
315 | { | 318 | { |
316 | owarn << "WellenreiterConfigWindow::performAction(): unknown type '" << type << "'" << oendl; | 319 | owarn << "WellenreiterConfigWindow::performAction(): unknown type '" << type << "'" << oendl; |
317 | return; | 320 | return; |
318 | } | 321 | } |
319 | 322 | ||
320 | odebug << "for event '" << (const char*) type << "' I'm going to perform action " << action << " (script='" << script << "')" << oendl; | 323 | odebug << "for event '" << type << "' I'm going to perform action " << action << " (script='" << script << "')" << oendl; |
321 | 324 | ||
322 | switch( action ) | 325 | switch( action ) |
323 | { | 326 | { |
324 | case 0: /* Ignore */ return; | 327 | case 0: /* Ignore */ return; |
325 | case 1: /* Play Alarm */ ODevice::inst()->playAlarmSound(); return; | 328 | case 1: /* Play Alarm */ ODevice::inst()->playAlarmSound(); return; |
326 | case 2: /* Play Click */ ODevice::inst()->playTouchSound(); return; | 329 | case 2: /* Play Click */ ODevice::inst()->playTouchSound(); return; |
327 | case 3: /* Blink LED */ break; //FIXME: Implement this | 330 | case 3: /* Blink LED */ break; //FIXME: Implement this |
328 | case 4: /* Run Script */ | 331 | case 4: /* Run Script */ |
@@ -399,16 +402,17 @@ void WellenreiterConfigWindow::load() | |||
399 | hopChannels->setChecked( c->readBoolEntry( "hop", true ) ); | 402 | hopChannels->setChecked( c->readBoolEntry( "hop", true ) ); |
400 | hopInterval->setValue( c->readNumEntry( "interval", 250 ) ); | 403 | hopInterval->setValue( c->readNumEntry( "interval", 250 ) ); |
401 | adaptiveHopping->setChecked( c->readBoolEntry( "adaptive", true ) ); | 404 | adaptiveHopping->setChecked( c->readBoolEntry( "adaptive", true ) ); |
402 | 405 | ||
403 | c->setGroup( "Capture" ); | 406 | c->setGroup( "Capture" ); |
404 | writeCaptureFile->setChecked( c->readBoolEntry( "writeCaptureFile", true ) ); | 407 | writeCaptureFile->setChecked( c->readBoolEntry( "writeCaptureFile", true ) ); |
405 | captureFileName->setEnabled( writeCaptureFile->isChecked() ); | 408 | captureFileName->setEnabled( writeCaptureFile->isChecked() ); |
406 | getCaptureFileName->setEnabled( writeCaptureFile->isChecked() ); | 409 | getCaptureFileName->setEnabled( writeCaptureFile->isChecked() ); |
410 | parsePackets->setEnabled( writeCaptureFile->isChecked() ); | ||
407 | captureFileName->setText( c->readEntry( "filename", "/tmp/capture" ) ); | 411 | captureFileName->setText( c->readEntry( "filename", "/tmp/capture" ) ); |
408 | hexViewBufferUnlimited->setChecked( c->readBoolEntry( "hexViewBufferUnlimited", true ) ); | 412 | hexViewBufferUnlimited->setChecked( c->readBoolEntry( "hexViewBufferUnlimited", true ) ); |
409 | hexViewBufferLimited->setChecked( !c->readBoolEntry( "hexViewBufferUnlimited", true ) ); | 413 | hexViewBufferLimited->setChecked( !c->readBoolEntry( "hexViewBufferUnlimited", true ) ); |
410 | hexViewBufferSize->setValue( c->readNumEntry( "hexViewBufferSize", 2000 ) ); | 414 | hexViewBufferSize->setValue( c->readNumEntry( "hexViewBufferSize", 2000 ) ); |
411 | 415 | ||
412 | c->setGroup( "UI" ); | 416 | c->setGroup( "UI" ); |
413 | lookupVendor->setChecked( c->readBoolEntry( "lookupVendor", true ) ); | 417 | lookupVendor->setChecked( c->readBoolEntry( "lookupVendor", true ) ); |
414 | openTree->setChecked( c->readBoolEntry( "openTree", true ) ); | 418 | openTree->setChecked( c->readBoolEntry( "openTree", true ) ); |
diff --git a/noncore/net/wellenreiter/gui/graphwindow.cpp b/noncore/net/wellenreiter/gui/graphwindow.cpp index b4174d3..d53421c 100644 --- a/noncore/net/wellenreiter/gui/graphwindow.cpp +++ b/noncore/net/wellenreiter/gui/graphwindow.cpp | |||
@@ -14,16 +14,43 @@ | |||
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #include "graphwindow.h" | 16 | #include "graphwindow.h" |
17 | 17 | ||
18 | #include <qpainter.h> | 18 | #include <qpainter.h> |
19 | #include <qpixmap.h> | 19 | #include <qpixmap.h> |
20 | #include <qtimer.h> | 20 | #include <qtimer.h> |
21 | 21 | ||
22 | /* XPM */ | ||
23 | static char * background[] = { | ||
24 | "16 16 6 1", | ||
25 | " c None", | ||
26 | ".c #52676E", | ||
27 | "+c #3F545B", | ||
28 | "@c #394E56", | ||
29 | "#c #2F454C", | ||
30 | "$c #364B52", | ||
31 | ".+++++++++++++++", | ||
32 | "@###############", | ||
33 | "+$$$$$$$$$$$$$$$", | ||
34 | "@###############", | ||
35 | "+$$$$$$$$$$$$$$$", | ||
36 | "@###############", | ||
37 | "+$$$$$$$$$$$$$$$", | ||
38 | "@###############", | ||
39 | "+$$$$$$$$$$$$$$$", | ||
40 | "@###############", | ||
41 | "+$$$$$$$$$$$$$$$", | ||
42 | "@###############", | ||
43 | "+$$$$$$$$$$$$$$$", | ||
44 | "@###############", | ||
45 | "+$$$$$$$$$$$$$$$", | ||
46 | "@###############"}; | ||
47 | |||
48 | |||
22 | MFrequencySpectrum::MFrequencySpectrum( int channels, QWidget* parent, const char* name, WFlags f) | 49 | MFrequencySpectrum::MFrequencySpectrum( int channels, QWidget* parent, const char* name, WFlags f) |
23 | :QWidget( parent, name,f ), _channels( channels ) | 50 | :QWidget( parent, name,f ), _channels( channels ) |
24 | { | 51 | { |
25 | _values = new int[_channels]; | 52 | _values = new int[_channels]; |
26 | _dirty = new bool[_channels]; | 53 | _dirty = new bool[_channels]; |
27 | for ( int i = 0; i < channels; ++i ) | 54 | for ( int i = 0; i < channels; ++i ) |
28 | { _values[i] = 0; | 55 | { _values[i] = 0; |
29 | _dirty[i] = true; | 56 | _dirty[i] = true; |
@@ -80,17 +107,17 @@ void MFrequencySpectrum::drawBar( QPainter* p, int x, int y, int width, int heig | |||
80 | else if ( i == height-1 ) | 107 | else if ( i == height-1 ) |
81 | drawTopLine( p, x, y-i, width, QColor( h,s,v, QColor::Hsv ) ); | 108 | drawTopLine( p, x, y-i, width, QColor( h,s,v, QColor::Hsv ) ); |
82 | else | 109 | else |
83 | drawLine( p, x, y-i, width, QColor( h,s,v, QColor::Hsv ) ); | 110 | drawLine( p, x, y-i, width, QColor( h,s,v, QColor::Hsv ) ); |
84 | } | 111 | } |
85 | } | 112 | } |
86 | 113 | ||
87 | 114 | ||
88 | void MFrequencySpectrum::paintEvent( QPaintEvent* e ) | 115 | void MFrequencySpectrum::paintEvent( QPaintEvent* ) |
89 | { | 116 | { |
90 | QPixmap pm( size() ); | 117 | QPixmap pm( size() ); |
91 | QPainter p; | 118 | QPainter p; |
92 | p.begin( &pm ); | 119 | p.begin( &pm ); |
93 | p.drawTiledPixmap( 0, 0, size().width(), size().height(), QPixmap( (const char**) &background ) ); | 120 | p.drawTiledPixmap( 0, 0, size().width(), size().height(), QPixmap( (const char**) &background ) ); |
94 | 121 | ||
95 | int xmargin = 5; | 122 | int xmargin = 5; |
96 | int ymargin = 2; | 123 | int ymargin = 2; |
@@ -113,17 +140,16 @@ void MFrequencySpectrum::paintEvent( QPaintEvent* e ) | |||
113 | } | 140 | } |
114 | 141 | ||
115 | 142 | ||
116 | void MFrequencySpectrum::mousePressEvent( QMouseEvent* e ) | 143 | void MFrequencySpectrum::mousePressEvent( QMouseEvent* e ) |
117 | { | 144 | { |
118 | int xmargin = 5; | 145 | int xmargin = 5; |
119 | int ymargin = 2; | 146 | int ymargin = 2; |
120 | int y = size().height() - 2 * ymargin; | 147 | int y = size().height() - 2 * ymargin; |
121 | int x = 0; | ||
122 | int width = ( size().width() - 2 * xmargin ) / _channels; | 148 | int width = ( size().width() - 2 * xmargin ) / _channels; |
123 | 149 | ||
124 | QPoint pos = e->pos(); | 150 | QPoint pos = e->pos(); |
125 | int channel = ( pos.x()-xmargin ) / width; | 151 | int channel = ( pos.x()-xmargin ) / width; |
126 | int height = 100 - ( pos.y()-ymargin )*100/y; | 152 | int height = 100 - ( pos.y()-ymargin )*100/y; |
127 | if ( channel < 15 ) _values[channel] = height; | 153 | if ( channel < 15 ) _values[channel] = height; |
128 | 154 | ||
129 | } | 155 | } |
@@ -137,18 +163,16 @@ Legende::Legende( int channels, QWidget* parent, const char* name, WFlags f ) | |||
137 | setFixedHeight( 16 ); | 163 | setFixedHeight( 16 ); |
138 | 164 | ||
139 | } | 165 | } |
140 | 166 | ||
141 | 167 | ||
142 | void Legende::drawContents( QPainter* p ) | 168 | void Legende::drawContents( QPainter* p ) |
143 | { | 169 | { |
144 | int xmargin = 5; | 170 | int xmargin = 5; |
145 | int ymargin = 2; | ||
146 | int x = 0; | ||
147 | int width = ( contentsRect().width() - 2 * xmargin ) / _channels; | 171 | int width = ( contentsRect().width() - 2 * xmargin ) / _channels; |
148 | 172 | ||
149 | for ( int i = 0; i < _channels; ++i ) | 173 | for ( int i = 0; i < _channels; ++i ) |
150 | p->drawText( xmargin + (width*i), 12, QString().sprintf( "%02d", i+1 ) ); | 174 | p->drawText( xmargin + (width*i), 12, QString().sprintf( "%02d", i+1 ) ); |
151 | } | 175 | } |
152 | 176 | ||
153 | 177 | ||
154 | MGraphWindow::MGraphWindow( QWidget* parent, const char* name, WFlags f ) | 178 | MGraphWindow::MGraphWindow( QWidget* parent, const char* name, WFlags f ) |
@@ -165,17 +189,17 @@ void MGraphWindow::testGraph() | |||
165 | static int i = 0; | 189 | static int i = 0; |
166 | spectrum->setValue( i++, 100 ); | 190 | spectrum->setValue( i++, 100 ); |
167 | if ( i == 14 ) i = 0; | 191 | if ( i == 14 ) i = 0; |
168 | QTimer::singleShot( 2000, this, SLOT( testGraph() ) ); | 192 | QTimer::singleShot( 2000, this, SLOT( testGraph() ) ); |
169 | 193 | ||
170 | } | 194 | } |
171 | 195 | ||
172 | 196 | ||
173 | void MGraphWindow::timerEvent( QTimerEvent* e ) | 197 | void MGraphWindow::timerEvent( QTimerEvent* ) |
174 | { | 198 | { |
175 | for ( int i = 0; i < 14; i++ ) | 199 | for ( int i = 0; i < 14; i++ ) |
176 | { | 200 | { |
177 | spectrum->decrease( i, 1 ); | 201 | spectrum->decrease( i, 1 ); |
178 | } | 202 | } |
179 | spectrum->repaint(); | 203 | spectrum->repaint(); |
180 | } | 204 | } |
181 | 205 | ||
diff --git a/noncore/net/wellenreiter/gui/graphwindow.h b/noncore/net/wellenreiter/gui/graphwindow.h index fafcab1..392d85b 100644 --- a/noncore/net/wellenreiter/gui/graphwindow.h +++ b/noncore/net/wellenreiter/gui/graphwindow.h | |||
@@ -85,37 +85,11 @@ class MGraphWindow : public QVBox | |||
85 | virtual void testGraph(); | 85 | virtual void testGraph(); |
86 | 86 | ||
87 | protected: | 87 | protected: |
88 | MFrequencySpectrum* spectrum; | 88 | MFrequencySpectrum* spectrum; |
89 | Legende* legende; | 89 | Legende* legende; |
90 | 90 | ||
91 | }; | 91 | }; |
92 | 92 | ||
93 | /* XPM */ | ||
94 | static char * background[] = { | ||
95 | "16 16 6 1", | ||
96 | " c None", | ||
97 | ".c #52676E", | ||
98 | "+c #3F545B", | ||
99 | "@c #394E56", | ||
100 | "#c #2F454C", | ||
101 | "$c #364B52", | ||
102 | ".+++++++++++++++", | ||
103 | "@###############", | ||
104 | "+$$$$$$$$$$$$$$$", | ||
105 | "@###############", | ||
106 | "+$$$$$$$$$$$$$$$", | ||
107 | "@###############", | ||
108 | "+$$$$$$$$$$$$$$$", | ||
109 | "@###############", | ||
110 | "+$$$$$$$$$$$$$$$", | ||
111 | "@###############", | ||
112 | "+$$$$$$$$$$$$$$$", | ||
113 | "@###############", | ||
114 | "+$$$$$$$$$$$$$$$", | ||
115 | "@###############", | ||
116 | "+$$$$$$$$$$$$$$$", | ||
117 | "@###############"}; | ||
118 | |||
119 | 93 | ||
120 | #endif | 94 | #endif |
121 | 95 | ||
diff --git a/noncore/net/wellenreiter/gui/logwindow.cpp b/noncore/net/wellenreiter/gui/logwindow.cpp index 714a9a9..a83f700 100644 --- a/noncore/net/wellenreiter/gui/logwindow.cpp +++ b/noncore/net/wellenreiter/gui/logwindow.cpp | |||
@@ -25,31 +25,29 @@ using namespace Opie::Core; | |||
25 | 25 | ||
26 | MLogWindow* MLogWindow::_instance; | 26 | MLogWindow* MLogWindow::_instance; |
27 | 27 | ||
28 | MLogWindow::MLogWindow( QWidget * parent, const char * name, WFlags f ) | 28 | MLogWindow::MLogWindow( QWidget * parent, const char * name, WFlags f ) |
29 | :QVBox( parent, name, f ) | 29 | :QVBox( parent, name, f ) |
30 | { | 30 | { |
31 | ledit = new QMultiLineEdit( this ); | 31 | ledit = new QMultiLineEdit( this ); |
32 | ledit->setReadOnly( true ); | 32 | ledit->setReadOnly( true ); |
33 | ledit->setUndoEnabled( false ); | ||
34 | |||
33 | 35 | ||
34 | MLogWindow::_instance = this; | 36 | MLogWindow::_instance = this; |
35 | } | 37 | } |
36 | 38 | ||
37 | 39 | ||
38 | void MLogWindow::log( QString text ) | 40 | void MLogWindow::log( QString text ) |
39 | { | 41 | { |
40 | QTime time = QTime::currentTime(); | 42 | QTime time = QTime::currentTime(); |
41 | QString line; | 43 | QString line = QString( "[%1] %2\n" ).arg(time.toString() ).arg( text ); |
42 | line.sprintf( "[%s] %s\n", (const char*) time.toString(), (const char*) text ); | 44 | ledit->insertLine( line ); |
43 | int col; | 45 | odebug << line << oendl; |
44 | int row; | ||
45 | ledit->getCursorPosition( &col, &row ); | ||
46 | ledit->insertAt( line, col, row ); | ||
47 | odebug << line << oendl; | ||
48 | } | 46 | } |
49 | 47 | ||
50 | 48 | ||
51 | void MLogWindow::clear() | 49 | void MLogWindow::clear() |
52 | { | 50 | { |
53 | ledit->clear(); | 51 | ledit->clear(); |
54 | } | 52 | } |
55 | 53 | ||
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp index ef7ffcf..3e18531 100644 --- a/noncore/net/wellenreiter/gui/mainwindow.cpp +++ b/noncore/net/wellenreiter/gui/mainwindow.cpp | |||
@@ -26,19 +26,16 @@ | |||
26 | #include <qpe/resource.h> | 26 | #include <qpe/resource.h> |
27 | #include <opie2/odebug.h> | 27 | #include <opie2/odebug.h> |
28 | #include <opie2/ofiledialog.h> | 28 | #include <opie2/ofiledialog.h> |
29 | #else | 29 | #else |
30 | #include "resource.h" | 30 | #include "resource.h" |
31 | #include <qapplication.h> | 31 | #include <qapplication.h> |
32 | #include <qfiledialog.h> | 32 | #include <qfiledialog.h> |
33 | #endif | 33 | #endif |
34 | using namespace Opie::Core; | ||
35 | using namespace Opie::Net; | ||
36 | using namespace Opie::Ui; | ||
37 | 34 | ||
38 | /* QT */ | 35 | /* QT */ |
39 | #include <qcombobox.h> | 36 | #include <qcombobox.h> |
40 | #include <qdatastream.h> | 37 | #include <qdatastream.h> |
41 | #include <qfile.h> | 38 | #include <qfile.h> |
42 | #include <qfileinfo.h> | 39 | #include <qfileinfo.h> |
43 | #include <qlabel.h> | 40 | #include <qlabel.h> |
44 | #include <qlayout.h> | 41 | #include <qlayout.h> |
@@ -52,16 +49,20 @@ using namespace Opie::Ui; | |||
52 | #include <qspinbox.h> | 49 | #include <qspinbox.h> |
53 | #include <qtextstream.h> | 50 | #include <qtextstream.h> |
54 | #include <qtoolbutton.h> | 51 | #include <qtoolbutton.h> |
55 | #include <qwhatsthis.h> | 52 | #include <qwhatsthis.h> |
56 | 53 | ||
57 | /* STD */ | 54 | /* STD */ |
58 | #include <unistd.h> | 55 | #include <unistd.h> |
59 | 56 | ||
57 | using namespace Opie::Core; | ||
58 | using namespace Opie::Net; | ||
59 | using namespace Opie::Ui; | ||
60 | |||
60 | WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * name, WFlags f ) | 61 | WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * name, WFlags f ) |
61 | :QMainWindow( parent, name, f ) | 62 | :QMainWindow( parent, name, f ) |
62 | { | 63 | { |
63 | cw = new WellenreiterConfigWindow( this ); | 64 | cw = new WellenreiterConfigWindow( this ); |
64 | mw = new Wellenreiter( this ); | 65 | mw = new Wellenreiter( this ); |
65 | mw->setConfigWindow( cw ); | 66 | mw->setConfigWindow( cw ); |
66 | setCentralWidget( mw ); | 67 | setCentralWidget( mw ); |
67 | 68 | ||
@@ -463,17 +464,17 @@ void WellenreiterMainWindow::uploadSession() | |||
463 | 464 | ||
464 | QFile f( mw->captureFileName() ); | 465 | QFile f( mw->captureFileName() ); |
465 | if ( !f.open( IO_ReadOnly ) ) | 466 | if ( !f.open( IO_ReadOnly ) ) |
466 | { | 467 | { |
467 | QMessageBox::warning( 0, tr( "Error" ), tr( "<p>Can't open Logfile '%1'</p>").arg( mw->captureFileName() ) ); | 468 | QMessageBox::warning( 0, tr( "Error" ), tr( "<p>Can't open Logfile '%1'</p>").arg( mw->captureFileName() ) ); |
468 | return; | 469 | return; |
469 | } | 470 | } |
470 | 471 | ||
471 | int content_length = f.size(); | 472 | // int content_length = f.size(); |
472 | 473 | ||
473 | ::memset( &raddr, 0, sizeof (struct sockaddr_in) ); | 474 | ::memset( &raddr, 0, sizeof (struct sockaddr_in) ); |
474 | ::memcpy( &raddr. sin_addr, rhost_info-> h_addr, rhost_info-> h_length ); | 475 | ::memcpy( &raddr. sin_addr, rhost_info-> h_addr, rhost_info-> h_length ); |
475 | raddr.sin_family = rhost_info-> h_addrtype; | 476 | raddr.sin_family = rhost_info-> h_addrtype; |
476 | raddr.sin_port = htons ( 80 ); | 477 | raddr.sin_port = htons ( 80 ); |
477 | 478 | ||
478 | sock = ::socket( AF_INET, SOCK_STREAM, 0 ); | 479 | sock = ::socket( AF_INET, SOCK_STREAM, 0 ); |
479 | 480 | ||
diff --git a/noncore/net/wellenreiter/gui/packetview.cpp b/noncore/net/wellenreiter/gui/packetview.cpp index 69438fa..d71111f 100644 --- a/noncore/net/wellenreiter/gui/packetview.cpp +++ b/noncore/net/wellenreiter/gui/packetview.cpp | |||
@@ -66,33 +66,44 @@ PacketView::PacketView( QWidget * parent, const char * name, WFlags f ) | |||
66 | connect( parent, SIGNAL( currentChanged( QWidget *) ), this, SLOT( activated( QWidget* ) ) ); | 66 | connect( parent, SIGNAL( currentChanged( QWidget *) ), this, SLOT( activated( QWidget* ) ) ); |
67 | 67 | ||
68 | clear(); | 68 | clear(); |
69 | 69 | ||
70 | } | 70 | } |
71 | 71 | ||
72 | void PacketView::add( const OPacket* p, int size ) | 72 | void PacketView::add( const OPacket* p, int size ) |
73 | { | 73 | { |
74 | /* | ||
75 | * don't scroll away when somebody views packages | ||
76 | * while scanning | ||
77 | */ | ||
78 | int value = _number->value(); | ||
79 | bool last = (value == static_cast<int>( _packets.count() ) ); | ||
80 | |||
74 | odebug << "PacketView::add() size = " << size << oendl; | 81 | odebug << "PacketView::add() size = " << size << oendl; |
75 | if ( size == -1 ) // unlimited buffer | 82 | if ( size == -1 ) // unlimited buffer |
76 | { | 83 | { |
77 | _packets.append( p ); | 84 | _packets.append( p ); |
78 | } | 85 | } |
79 | else | 86 | else |
80 | { // limited buffer, limit = size | 87 | { // limited buffer, limit = size |
81 | while ( _packets.count() >= size ) | 88 | while ( _packets.count() >= static_cast<uint>( size ) ) |
82 | { | 89 | { |
83 | _packets.removeFirst(); | 90 | _packets.removeFirst(); |
91 | --value; | ||
84 | } | 92 | } |
93 | |||
94 | /* check if we lost our packet */ | ||
95 | last = ( value < 1 ); | ||
85 | _packets.append( p ); | 96 | _packets.append( p ); |
86 | } | 97 | } |
87 | 98 | ||
88 | _number->setMinValue( 1 ); | 99 | _number->setMinValue( 1 ); |
89 | _number->setMaxValue( _packets.count() ); | 100 | _number->setMaxValue( _packets.count() ); |
90 | _number->setValue( _packets.count() ); | 101 | _number->setValue( last ? _packets.count() : value ); |
91 | } | 102 | } |
92 | 103 | ||
93 | void PacketView::showPacket( int number ) | 104 | void PacketView::showPacket( int number ) |
94 | { | 105 | { |
95 | _list->clear(); | 106 | _list->clear(); |
96 | _hex->setText(""); | 107 | _hex->setText(""); |
97 | const OPacket* p = _packets.at( number-1 ); | 108 | const OPacket* p = _packets.at( number-1 ); |
98 | 109 | ||
@@ -134,16 +145,17 @@ void PacketView::_doHexPacket( const OPacket* p ) | |||
134 | if ( oApp->desktop()->width() > 320 ) | 145 | if ( oApp->desktop()->width() > 320 ) |
135 | _hex->setText( p->dump( 16 ) ); | 146 | _hex->setText( p->dump( 16 ) ); |
136 | else | 147 | else |
137 | _hex->setText( p->dump( 8 ) ); | 148 | _hex->setText( p->dump( 8 ) ); |
138 | } | 149 | } |
139 | 150 | ||
140 | const QString PacketView::getLog() const | 151 | const QString PacketView::getLog() const |
141 | { | 152 | { |
153 | return QString::null; | ||
142 | } | 154 | } |
143 | 155 | ||
144 | void PacketView::clear() | 156 | void PacketView::clear() |
145 | { | 157 | { |
146 | _packets.clear(); | 158 | _packets.clear(); |
147 | _number->setMinValue( 0 ); | 159 | _number->setMinValue( 0 ); |
148 | _number->setMaxValue( 0 ); | 160 | _number->setMaxValue( 0 ); |
149 | _label->setText( "---" ); | 161 | _label->setText( "---" ); |
diff --git a/noncore/net/wellenreiter/gui/protolistview.cpp b/noncore/net/wellenreiter/gui/protolistview.cpp index 635e174..1e3d195 100644 --- a/noncore/net/wellenreiter/gui/protolistview.cpp +++ b/noncore/net/wellenreiter/gui/protolistview.cpp | |||
@@ -67,54 +67,54 @@ ProtocolListView::ProtocolListView( QWidget* parent, const char* name, WFlags f | |||
67 | ProtocolListView::~ProtocolListView() | 67 | ProtocolListView::~ProtocolListView() |
68 | { | 68 | { |
69 | } | 69 | } |
70 | 70 | ||
71 | 71 | ||
72 | void ProtocolListView::addProtocol( const QString& name ) | 72 | void ProtocolListView::addProtocol( const QString& name ) |
73 | { | 73 | { |
74 | QHBox* hbox = new QHBox( vbox ); | 74 | QHBox* hbox = new QHBox( vbox ); |
75 | new QCheckBox( name, hbox, (const char*) name ); | 75 | new QCheckBox( name, hbox, name.local8Bit() ); |
76 | 76 | ||
77 | if ( parse ) | 77 | if ( parse ) |
78 | { | 78 | { |
79 | QComboBox* combo = new QComboBox( hbox, (const char*) name ); | 79 | QComboBox* combo = new QComboBox( hbox, name.local8Bit() ); |
80 | #ifdef QWS | 80 | #ifdef QWS |
81 | combo->setFixedWidth( 75 ); | 81 | combo->setFixedWidth( 75 ); |
82 | #endif | 82 | #endif |
83 | combo->insertItem( "Pass" ); | 83 | combo->insertItem( "Pass" ); |
84 | combo->insertItem( "Discard!" ); | 84 | combo->insertItem( "Discard!" ); |
85 | combo->insertItem( "TouchSound" ); | 85 | combo->insertItem( "TouchSound" ); |
86 | combo->insertItem( "AlarmSound" ); | 86 | combo->insertItem( "AlarmSound" ); |
87 | combo->insertItem( "KeySound" ); | 87 | combo->insertItem( "KeySound" ); |
88 | combo->insertItem( "LedOn" ); | 88 | combo->insertItem( "LedOn" ); |
89 | combo->insertItem( "LedOff" ); | 89 | combo->insertItem( "LedOff" ); |
90 | combo->insertItem( "LogMessage" ); | 90 | combo->insertItem( "LogMessage" ); |
91 | combo->insertItem( "MessageBox" ); | 91 | combo->insertItem( "MessageBox" ); |
92 | } | 92 | } |
93 | else | 93 | else |
94 | { | 94 | { |
95 | QComboBox* combo = new QComboBox( hbox, (const char*) name ); | 95 | QComboBox* combo = new QComboBox( hbox, name.local8Bit() ); |
96 | #ifdef QWS | 96 | #ifdef QWS |
97 | combo->setFixedWidth( 75 ); | 97 | combo->setFixedWidth( 75 ); |
98 | #endif | 98 | #endif |
99 | combo->insertItem( "Pass" ); | 99 | combo->insertItem( "Pass" ); |
100 | combo->insertItem( "Discard!" ); | 100 | combo->insertItem( "Discard!" ); |
101 | } | 101 | } |
102 | } | 102 | } |
103 | 103 | ||
104 | 104 | ||
105 | bool ProtocolListView::isProtocolChecked( const QString& name ) | 105 | bool ProtocolListView::isProtocolChecked( const QString& name ) |
106 | { | 106 | { |
107 | QCheckBox* box = (QCheckBox*) child( (const char*) name ); | 107 | QCheckBox* box = (QCheckBox*) child( name.local8Bit() ); |
108 | return ( box && box->isOn() ); | 108 | return ( box && box->isOn() ); |
109 | } | 109 | } |
110 | 110 | ||
111 | 111 | ||
112 | QString ProtocolListView::protocolAction( const QString& name ) | 112 | QString ProtocolListView::protocolAction( const QString& name ) |
113 | { | 113 | { |
114 | QComboBox* combo = (QComboBox*) child( (const char*) name, "QComboBox" ); | 114 | QComboBox* combo = (QComboBox*) child( name.local8Bit(), "QComboBox" ); |
115 | if ( combo ) | 115 | if ( combo ) |
116 | return combo->currentText(); | 116 | return combo->currentText(); |
117 | else | 117 | else |
118 | return "<unknown>"; | 118 | return "<unknown>"; |
119 | } | 119 | } |
120 | 120 | ||
diff --git a/noncore/net/wellenreiter/gui/resource.cpp b/noncore/net/wellenreiter/gui/resource.cpp index cb17f51..13096f2 100644 --- a/noncore/net/wellenreiter/gui/resource.cpp +++ b/noncore/net/wellenreiter/gui/resource.cpp | |||
@@ -20,30 +20,30 @@ | |||
20 | #include <qiconset.h> | 20 | #include <qiconset.h> |
21 | 21 | ||
22 | namespace Resource | 22 | namespace Resource |
23 | { | 23 | { |
24 | 24 | ||
25 | QPixmap loadPixmap( const QString& pix ) | 25 | QPixmap loadPixmap( const QString& pix ) |
26 | { | 26 | { |
27 | QString filename; | 27 | QString filename; |
28 | filename.sprintf( "%s/%s.png", (const char*) PIXMAPPATH, (const char*) pix ); | 28 | filename.sprintf( "%s/%s.png", PIXMAPPATH, pix.local8Bit() ); |
29 | QPixmap pixmap( filename ); | 29 | QPixmap pixmap( filename ); |
30 | if ( pixmap.isNull() ) | 30 | if ( pixmap.isNull() ) |
31 | { | 31 | { |
32 | odebug << "Wellenreiter::Resource: can't find pixmap " + filename << oendl; | 32 | odebug << "Wellenreiter::Resource: can't find pixmap " + filename << oendl; |
33 | } | 33 | } |
34 | return pixmap; | 34 | return pixmap; |
35 | }; | 35 | }; |
36 | 36 | ||
37 | QIconSet loadIconSet( const QString& pix ) | 37 | QIconSet loadIconSet( const QString& pix ) |
38 | { | 38 | { |
39 | QString filename; | 39 | QString filename; |
40 | filename.sprintf( "%s/%s.png", (const char*) PIXMAPPATH, (const char*) pix ); | 40 | filename.sprintf( "%s/%s.png", PIXMAPPATH, pix.local8Bit() ); |
41 | QPixmap pixmap( filename ); | 41 | QPixmap pixmap( filename ); |
42 | if ( pixmap.isNull() ) | 42 | if ( pixmap.isNull() ) |
43 | { | 43 | { |
44 | odebug << "Wellenreiter::Resource: can't find pixmap " + filename << oendl; | 44 | odebug << "Wellenreiter::Resource: can't find pixmap " + filename << oendl; |
45 | } | 45 | } |
46 | return QIconSet( pixmap ); | 46 | return QIconSet( pixmap ); |
47 | }; | 47 | }; |
48 | 48 | ||
49 | }; | 49 | }; |
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp index 9e907d8..fa1d724 100644 --- a/noncore/net/wellenreiter/gui/scanlist.cpp +++ b/noncore/net/wellenreiter/gui/scanlist.cpp | |||
@@ -20,42 +20,46 @@ | |||
20 | /* OPIE */ | 20 | /* OPIE */ |
21 | #ifdef QWS | 21 | #ifdef QWS |
22 | #include <opie2/odebug.h> | 22 | #include <opie2/odebug.h> |
23 | #include <qpe/qpeapplication.h> | 23 | #include <qpe/qpeapplication.h> |
24 | #include <qpe/resource.h> | 24 | #include <qpe/resource.h> |
25 | #else | 25 | #else |
26 | #include "resource.h" | 26 | #include "resource.h" |
27 | #endif | 27 | #endif |
28 | using namespace Opie::Core; | 28 | |
29 | using namespace Opie::Ui; | ||
30 | using namespace Opie::Net; | ||
31 | 29 | ||
32 | /* QT */ | 30 | /* QT */ |
33 | #include <qcursor.h> | 31 | #include <qcursor.h> |
34 | #include <qdatetime.h> | 32 | #include <qdatetime.h> |
35 | #include <qpopupmenu.h> | 33 | #include <qpopupmenu.h> |
36 | #include <qcheckbox.h> | 34 | #include <qcheckbox.h> |
37 | 35 | ||
38 | /* STD */ | 36 | /* STD */ |
39 | #include <assert.h> | 37 | #include <assert.h> |
40 | 38 | ||
39 | using namespace Opie::Core; | ||
40 | using namespace Opie::Ui; | ||
41 | using namespace Opie::Net; | ||
42 | |||
41 | const int col_type = 0; | 43 | const int col_type = 0; |
42 | const int col_essid = 0; | 44 | const int col_essid = 0; |
43 | const int col_sig = 1; | 45 | const int col_sig = 1; |
44 | const int col_ap = 2; | 46 | const int col_ap = 2; |
45 | const int col_channel = 3; | 47 | const int col_channel = 3; |
46 | const int col_wep = 4; | 48 | const int col_wep = 4; |
47 | const int col_traffic = 5; | 49 | const int col_traffic = 5; |
48 | const int col_ip = 6; | 50 | const int col_ip = 6; |
49 | const int col_manuf = 7; | 51 | const int col_manuf = 7; |
50 | const int col_firstseen = 8; | 52 | const int col_firstseen = 8; |
51 | const int col_lastseen = 9; | 53 | const int col_lastseen = 9; |
52 | const int col_location = 10; | 54 | const int col_location = 10; |
53 | 55 | ||
56 | #define DEBUG | ||
57 | |||
54 | MScanListView::MScanListView( QWidget* parent, const char* name ) | 58 | MScanListView::MScanListView( QWidget* parent, const char* name ) |
55 | :OListView( parent, name ) | 59 | :OListView( parent, name ) |
56 | { | 60 | { |
57 | setFrameShape( QListView::StyledPanel ); | 61 | setFrameShape( QListView::StyledPanel ); |
58 | setFrameShadow( QListView::Sunken ); | 62 | setFrameShadow( QListView::Sunken ); |
59 | 63 | ||
60 | addColumn( tr( "Net/Station" ) ); | 64 | addColumn( tr( "Net/Station" ) ); |
61 | setColumnAlignment( col_essid, AlignLeft || AlignVCenter ); | 65 | setColumnAlignment( col_essid, AlignLeft || AlignVCenter ); |
@@ -171,17 +175,17 @@ void MScanListView::addNewItem( const QString& type, | |||
171 | odebug << "" << macaddr << " is a dupe - ignoring..." << oendl; | 175 | odebug << "" << macaddr << " is a dupe - ignoring..." << oendl; |
172 | #endif | 176 | #endif |
173 | item->receivedBeacon(); | 177 | item->receivedBeacon(); |
174 | return; | 178 | return; |
175 | } | 179 | } |
176 | } | 180 | } |
177 | else | 181 | else |
178 | { | 182 | { |
179 | s.sprintf( "(i) New network: ESSID '%s'", (const char*) essid ); | 183 | s = QString( "(i) New network: ESSID '%1'" ).arg( essid ); |
180 | MLogWindow::logwindow()->log( s ); | 184 | MLogWindow::logwindow()->log( s ); |
181 | network = new MScanListItem( this, "network", essid, QString::null, 0, 0, 0, probe ); | 185 | network = new MScanListItem( this, "network", essid, QString::null, 0, 0, 0, probe ); |
182 | } | 186 | } |
183 | 187 | ||
184 | 188 | ||
185 | // insert new station as child from network | 189 | // insert new station as child from network |
186 | // no essid to reduce clutter, maybe later we have a nick or stationname to display!? | 190 | // no essid to reduce clutter, maybe later we have a nick or stationname to display!? |
187 | 191 | ||
@@ -190,21 +194,21 @@ void MScanListView::addNewItem( const QString& type, | |||
190 | #endif | 194 | #endif |
191 | 195 | ||
192 | MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal ); | 196 | MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal ); |
193 | station->setManufacturer( mac.manufacturer() ); | 197 | station->setManufacturer( mac.manufacturer() ); |
194 | station->setLocation( loc.dmsPosition() ); | 198 | station->setLocation( loc.dmsPosition() ); |
195 | 199 | ||
196 | if ( type == "managed" ) | 200 | if ( type == "managed" ) |
197 | { | 201 | { |
198 | s.sprintf( "(i) New Access Point in '%s' [%d]", (const char*) essid, channel ); | 202 | s = QString( "(i) New Access Point in '%1' [%2]" ).arg( essid ).arg( channel ); |
199 | } | 203 | } |
200 | else | 204 | else |
201 | { | 205 | { |
202 | s.sprintf( "(i) New AdHoc station in '%s' [%d]", (const char*) essid, channel ); | 206 | s = QString( "(i) New AdHoc station in '%1' [%2]" ).arg( essid ).arg( channel ); |
203 | } | 207 | } |
204 | MLogWindow::logwindow()->log( s ); | 208 | MLogWindow::logwindow()->log( s ); |
205 | } | 209 | } |
206 | 210 | ||
207 | 211 | ||
208 | void MScanListView::addIfNotExisting( MScanListItem* network, const OMacAddress& addr, const QString& type ) | 212 | void MScanListView::addIfNotExisting( MScanListItem* network, const OMacAddress& addr, const QString& type ) |
209 | { | 213 | { |
210 | MScanListItem* subitem = static_cast<MScanListItem*>( network->firstChild() ); | 214 | MScanListItem* subitem = static_cast<MScanListItem*>( network->firstChild() ); |
@@ -229,31 +233,31 @@ void MScanListView::addIfNotExisting( MScanListItem* network, const OMacAddress& | |||
229 | 233 | ||
230 | // Hey, it seems to be a new item :-D | 234 | // Hey, it seems to be a new item :-D |
231 | MScanListItem* station = new MScanListItem( network, type, /* network->text( col_essid ) */ "", addr.toString(true), false, -1, -1 ); | 235 | MScanListItem* station = new MScanListItem( network, type, /* network->text( col_essid ) */ "", addr.toString(true), false, -1, -1 ); |
232 | station->setManufacturer( addr.manufacturer() ); | 236 | station->setManufacturer( addr.manufacturer() ); |
233 | 237 | ||
234 | QString s; | 238 | QString s; |
235 | if ( type == "station" ) | 239 | if ( type == "station" ) |
236 | { | 240 | { |
237 | s.sprintf( "(i) New Station in '%s' [xx]", (const char*) network->text( col_essid ) ); | 241 | s = QString( "(i) New Station in '%1' [xx]" ).arg( network->text( col_essid ) ); |
238 | } | 242 | } |
239 | else | 243 | else |
240 | { | 244 | { |
241 | s.sprintf( "(i) New Wireless Station in '%s' [xx]", (const char*) network->text( col_essid ) ); | 245 | s = QString( "(i) New Wireless Station in '%1' [xx]" ).arg( network->text( col_essid ) ); |
242 | } | 246 | } |
243 | MLogWindow::logwindow()->log( s ); | 247 | MLogWindow::logwindow()->log( s ); |
244 | } | 248 | } |
245 | 249 | ||
246 | 250 | ||
247 | void MScanListView::WDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& viaFrom, const OMacAddress& viaTo ) | 251 | void MScanListView::WDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& viaFrom, const OMacAddress& viaTo ) |
248 | { | 252 | { |
249 | odebug << "WDSTraffic: " << (const char*) viaFrom.toString() << " and " << viaTo.toString() << " seem to form a WDS" << oendl; | 253 | odebug << "WDSTraffic: " << viaFrom.toString() << " and " << viaTo.toString() << " seem to form a WDS" << oendl; |
250 | QString s; | 254 | QString s; |
251 | MScanListItem* network; | 255 | // MScanListItem* network; |
252 | 256 | ||
253 | QListViewItemIterator it( this ); | 257 | QListViewItemIterator it( this ); |
254 | while ( it.current() && | 258 | while ( it.current() && |
255 | it.current()->text( col_ap ) != viaFrom.toString(true) && | 259 | it.current()->text( col_ap ) != viaFrom.toString(true) && |
256 | it.current()->text( col_ap ) != viaTo.toString(true) ) ++it; | 260 | it.current()->text( col_ap ) != viaTo.toString(true) ) ++it; |
257 | 261 | ||
258 | MScanListItem* item = static_cast<MScanListItem*>( it.current() ); | 262 | MScanListItem* item = static_cast<MScanListItem*>( it.current() ); |
259 | 263 | ||
@@ -265,20 +269,20 @@ void MScanListView::WDStraffic( const OMacAddress& from, const OMacAddress& to, | |||
265 | else | 269 | else |
266 | { | 270 | { |
267 | odebug << "D'Oh! Stations without AP... ignoring for now... will handle this in 1.1 version :-D" << oendl; | 271 | odebug << "D'Oh! Stations without AP... ignoring for now... will handle this in 1.1 version :-D" << oendl; |
268 | MLogWindow::logwindow()->log( "WARNING: Unhandled WSD traffic!" ); | 272 | MLogWindow::logwindow()->log( "WARNING: Unhandled WSD traffic!" ); |
269 | } | 273 | } |
270 | } | 274 | } |
271 | 275 | ||
272 | 276 | ||
273 | void MScanListView::toDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ) | 277 | void MScanListView::toDStraffic( const OMacAddress& from, const OMacAddress& /*to*/, const OMacAddress& via ) |
274 | { | 278 | { |
275 | QString s; | 279 | QString s; |
276 | MScanListItem* network; | 280 | // MScanListItem* network; |
277 | 281 | ||
278 | QListViewItemIterator it( this ); | 282 | QListViewItemIterator it( this ); |
279 | while ( it.current() && it.current()->text( col_ap ) != via.toString(true) ) ++it; | 283 | while ( it.current() && it.current()->text( col_ap ) != via.toString(true) ) ++it; |
280 | 284 | ||
281 | MScanListItem* item = static_cast<MScanListItem*>( it.current() ); | 285 | MScanListItem* item = static_cast<MScanListItem*>( it.current() ); |
282 | 286 | ||
283 | if ( item ) // AP has shown up yet, so just add our new "from" - station | 287 | if ( item ) // AP has shown up yet, so just add our new "from" - station |
284 | { | 288 | { |
@@ -288,20 +292,20 @@ void MScanListView::toDStraffic( const OMacAddress& from, const OMacAddress& to, | |||
288 | { | 292 | { |
289 | odebug << "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" << oendl; | 293 | odebug << "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" << oendl; |
290 | MLogWindow::logwindow()->log( "WARNING: Unhandled toDS traffic!" ); | 294 | MLogWindow::logwindow()->log( "WARNING: Unhandled toDS traffic!" ); |
291 | 295 | ||
292 | } | 296 | } |
293 | } | 297 | } |
294 | 298 | ||
295 | 299 | ||
296 | void MScanListView::fromDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ) | 300 | void MScanListView::fromDStraffic( const OMacAddress& from, const OMacAddress& /*to*/, const OMacAddress& via ) |
297 | { | 301 | { |
298 | QString s; | 302 | QString s; |
299 | MScanListItem* network; | 303 | // MScanListItem* network; |
300 | 304 | ||
301 | QListViewItemIterator it( this ); | 305 | QListViewItemIterator it( this ); |
302 | while ( it.current() && it.current()->text( col_ap ) != via.toString(true) ) ++it; | 306 | while ( it.current() && it.current()->text( col_ap ) != via.toString(true) ) ++it; |
303 | 307 | ||
304 | MScanListItem* item = static_cast<MScanListItem*>( it.current() ); | 308 | MScanListItem* item = static_cast<MScanListItem*>( it.current() ); |
305 | 309 | ||
306 | if ( item ) // AP has shown up yet, so just add our new "from" - station | 310 | if ( item ) // AP has shown up yet, so just add our new "from" - station |
307 | { | 311 | { |
@@ -310,45 +314,45 @@ void MScanListView::fromDStraffic( const OMacAddress& from, const OMacAddress& t | |||
310 | else | 314 | else |
311 | { | 315 | { |
312 | odebug << "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" << oendl; | 316 | odebug << "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" << oendl; |
313 | MLogWindow::logwindow()->log( "WARNING: Unhandled fromDS traffic!" ); | 317 | MLogWindow::logwindow()->log( "WARNING: Unhandled fromDS traffic!" ); |
314 | } | 318 | } |
315 | } | 319 | } |
316 | 320 | ||
317 | 321 | ||
318 | void MScanListView::IBSStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ) | 322 | void MScanListView::IBSStraffic( const OMacAddress& /*from*/, const OMacAddress& /*to*/, const OMacAddress& /*via*/ ) |
319 | { | 323 | { |
320 | owarn << "D'oh! Not yet implemented..." << oendl; | 324 | owarn << "D'oh! Not yet implemented..." << oendl; |
321 | MLogWindow::logwindow()->log( "WARNING: Unhandled IBSS traffic!" ); | 325 | MLogWindow::logwindow()->log( "WARNING: Unhandled IBSS traffic!" ); |
322 | } | 326 | } |
323 | 327 | ||
324 | 328 | ||
325 | void MScanListView::identify( const OMacAddress& macaddr, const QString& ip ) | 329 | void MScanListView::identify( const OMacAddress& macaddr, const QString& ip ) |
326 | { | 330 | { |
327 | odebug << "identify " << (const char*) macaddr.toString() << " = " << ip << "" << oendl; | 331 | odebug << "identify " << macaddr.toString() << " = " << ip << "" << oendl; |
328 | 332 | ||
329 | QListViewItemIterator it( this ); | 333 | QListViewItemIterator it( this ); |
330 | for ( ; it.current(); ++it ) | 334 | for ( ; it.current(); ++it ) |
331 | { | 335 | { |
332 | if ( it.current()->text( col_ap ) == macaddr.toString(true) ) | 336 | if ( it.current()->text( col_ap ) == macaddr.toString(true) ) |
333 | { | 337 | { |
334 | it.current()->setText( col_ip, ip ); | 338 | it.current()->setText( col_ip, ip ); |
335 | return; | 339 | return; |
336 | } | 340 | } |
337 | } | 341 | } |
338 | odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl; | 342 | odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl; |
339 | MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled identification %s = %s!", | 343 | MLogWindow::logwindow()->log( QString( "WARNING: Unhandled identification %1 = %2!" ) |
340 | (const char*) macaddr.toString(), (const char*) ip ) ); | 344 | .arg( macaddr.toString() ).arg( ip ) ); |
341 | } | 345 | } |
342 | 346 | ||
343 | 347 | ||
344 | void MScanListView::addService( const QString& name, const OMacAddress& macaddr, const QString& ip ) | 348 | void MScanListView::addService( const QString& name, const OMacAddress& macaddr, const QString& ip ) |
345 | { | 349 | { |
346 | odebug << "addService '" << (const char*) name << "', Server = " << (const char*) macaddr.toString() << " = " << ip << "" << oendl; | 350 | odebug << "addService '" << name << "', Server = " << macaddr.toString() << " = " << ip << "" << oendl; |
347 | 351 | ||
348 | //TODO: Refactor that out, we need it all over the place. | 352 | //TODO: Refactor that out, we need it all over the place. |
349 | // Best to do it in a more comfortable abstraction in OListView | 353 | // Best to do it in a more comfortable abstraction in OListView |
350 | // (Hmm, didn't I already start something in this direction?) | 354 | // (Hmm, didn't I already start something in this direction?) |
351 | 355 | ||
352 | QListViewItemIterator it( this ); | 356 | QListViewItemIterator it( this ); |
353 | for ( ; it.current(); ++it ) | 357 | for ( ; it.current(); ++it ) |
354 | { | 358 | { |
@@ -379,33 +383,33 @@ void MScanListView::addService( const QString& name, const OMacAddress& macaddr, | |||
379 | 383 | ||
380 | MScanListItem* item = new MScanListItem( it.current(), "service", "N/A", " ", false, -1, -1 ); | 384 | MScanListItem* item = new MScanListItem( it.current(), "service", "N/A", " ", false, -1, -1 ); |
381 | item->setText( col_essid, name ); | 385 | item->setText( col_essid, name ); |
382 | 386 | ||
383 | return; | 387 | return; |
384 | } | 388 | } |
385 | } | 389 | } |
386 | odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl; | 390 | odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl; |
387 | MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled service addition %s = %s!", | 391 | MLogWindow::logwindow()->log( QString("WARNING: Unhandled service addition %s = %s!") |
388 | (const char*) macaddr.toString(), (const char*) ip ) ); | 392 | .arg( macaddr.toString() ).arg( ip ) ); |
389 | } | 393 | } |
390 | 394 | ||
391 | 395 | ||
392 | void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, int col ) | 396 | void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, int col ) |
393 | { | 397 | { |
394 | if ( !item ) return; | 398 | if ( !item ) return; |
395 | 399 | ||
396 | MScanListItem* itm = static_cast<MScanListItem*>( item ); | 400 | MScanListItem* itm = static_cast<MScanListItem*>( item ); |
397 | 401 | ||
398 | odebug << "contextMenuRequested on item '" << (const char*) itm->text(0) << "' (" | 402 | odebug << "contextMenuRequested on item '" << itm->text(0) << "' (" |
399 | << (const char*) itm->type << ") in column: '" << col << "'" << oendl; | 403 | << itm->type << ") in column: '" << col << "'" << oendl; |
400 | 404 | ||
401 | if ( itm->type == "adhoc" || itm->type == "managed" ) | 405 | if ( itm->type == "adhoc" || itm->type == "managed" ) |
402 | { | 406 | { |
403 | QString entry = QString().sprintf( "&Join %s Net '%s'...", (const char*) itm->type, (const char*) itm->essid() ); | 407 | QString entry = QString( "&Join %1 Net '%2'..." ).arg( itm->type ).arg( itm->essid() ); |
404 | 408 | ||
405 | QPopupMenu m( this ); | 409 | QPopupMenu m( this ); |
406 | m.insertItem( entry, 37773, 0 ); | 410 | m.insertItem( entry, 37773, 0 ); |
407 | int result = m.exec( QCursor::pos() ); | 411 | int result = m.exec( QCursor::pos() ); |
408 | if ( result == 37773 ) | 412 | if ( result == 37773 ) |
409 | emit joinNetwork( itm->type, itm->essid(), itm->channel(), itm->macaddr() ); | 413 | emit joinNetwork( itm->type, itm->essid(), itm->channel(), itm->macaddr() ); |
410 | } | 414 | } |
411 | } | 415 | } |
@@ -474,35 +478,34 @@ void MScanListItem::serializeFrom( QDataStream& s ) | |||
474 | #endif | 478 | #endif |
475 | OListViewItem::serializeFrom( s ); | 479 | OListViewItem::serializeFrom( s ); |
476 | 480 | ||
477 | Q_UINT8 wep; | 481 | Q_UINT8 wep; |
478 | s >> _type; | 482 | s >> _type; |
479 | s >> wep; | 483 | s >> wep; |
480 | _wep = (wep == 'y'); | 484 | _wep = (wep == 'y'); |
481 | 485 | ||
482 | QString name; | 486 | QString name = QString( "wellenreiter/"+ _type ); |
483 | name.sprintf( "wellenreiter/%s", (const char*) _type ); | ||
484 | setPixmap( col_type, Resource::loadPixmap( name ) ); | 487 | setPixmap( col_type, Resource::loadPixmap( name ) ); |
485 | if ( _wep ) | 488 | if ( _wep ) |
486 | setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap! | 489 | setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap! |
487 | listView()->triggerUpdate(); | 490 | listView()->triggerUpdate(); |
488 | } | 491 | } |
489 | 492 | ||
490 | void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal, bool probed ) | 493 | void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal, bool probed ) |
491 | { | 494 | { |
492 | #ifdef DEBUG | 495 | #ifdef DEBUG |
493 | odebug << "decorating scanlist item " << (const char*) type << " / " | 496 | odebug << "decorating scanlist item " << type << " / " |
494 | << (const char*) essid << " / " << (const char*) macaddr | 497 | << essid << " / " << macaddr |
495 | << "[" << channel << "]" << oendl; | 498 | << "[" << channel << "]" << oendl; |
496 | #endif | 499 | #endif |
497 | 500 | ||
498 | // set icon for managed or adhoc mode | 501 | // set icon for managed or adhoc mode |
499 | QString name; | 502 | QString name; |
500 | name.sprintf( "wellenreiter/%s", (const char*) type ); | 503 | name.sprintf( "wellenreiter/"+ type ); |
501 | setPixmap( col_type, Resource::loadPixmap( name ) ); | 504 | setPixmap( col_type, Resource::loadPixmap( name ) ); |
502 | 505 | ||
503 | // special case for probed networks FIXME: This is ugly at present | 506 | // special case for probed networks FIXME: This is ugly at present |
504 | if ( type == "network" && probed ) | 507 | if ( type == "network" && probed ) |
505 | { | 508 | { |
506 | setPixmap( col_type, Resource::loadPixmap( "wellenreiter/network-probed.png" ) ); | 509 | setPixmap( col_type, Resource::loadPixmap( "wellenreiter/network-probed.png" ) ); |
507 | } | 510 | } |
508 | 511 | ||
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index e801ce7..df8e9c3 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -28,19 +28,16 @@ | |||
28 | #include <opie2/odevice.h> | 28 | #include <opie2/odevice.h> |
29 | #else | 29 | #else |
30 | #include <qapplication.h> | 30 | #include <qapplication.h> |
31 | #endif | 31 | #endif |
32 | #include <opie2/omanufacturerdb.h> | 32 | #include <opie2/omanufacturerdb.h> |
33 | #include <opie2/onetwork.h> | 33 | #include <opie2/onetwork.h> |
34 | #include <opie2/opcap.h> | 34 | #include <opie2/opcap.h> |
35 | #include <qpe/qcopenvelope_qws.h> | 35 | #include <qpe/qcopenvelope_qws.h> |
36 | using namespace Opie::Core; | ||
37 | using namespace Opie::Net; | ||
38 | using namespace Opie::Ui; | ||
39 | 36 | ||
40 | /* QT */ | 37 | /* QT */ |
41 | #include <qcheckbox.h> | 38 | #include <qcheckbox.h> |
42 | #include <qcombobox.h> | 39 | #include <qcombobox.h> |
43 | #include <qdatetime.h> | 40 | #include <qdatetime.h> |
44 | #include <qpushbutton.h> | 41 | #include <qpushbutton.h> |
45 | #include <qlineedit.h> | 42 | #include <qlineedit.h> |
46 | #include <qmessagebox.h> | 43 | #include <qmessagebox.h> |
@@ -55,32 +52,36 @@ using namespace Opie::Ui; | |||
55 | #include <assert.h> | 52 | #include <assert.h> |
56 | #include <errno.h> | 53 | #include <errno.h> |
57 | #include <unistd.h> | 54 | #include <unistd.h> |
58 | #include <string.h> | 55 | #include <string.h> |
59 | #include <sys/types.h> | 56 | #include <sys/types.h> |
60 | #include <stdlib.h> | 57 | #include <stdlib.h> |
61 | #include <signal.h> | 58 | #include <signal.h> |
62 | 59 | ||
60 | |||
61 | using namespace Opie::Core; | ||
62 | using namespace Opie::Net; | ||
63 | using namespace Opie::Ui; | ||
64 | |||
63 | Wellenreiter* Wellenreiter::instance = 0; | 65 | Wellenreiter* Wellenreiter::instance = 0; |
64 | 66 | ||
65 | Wellenreiter::Wellenreiter( QWidget* parent ) | 67 | Wellenreiter::Wellenreiter( QWidget* parent ) |
66 | : WellenreiterBase( parent, 0, 0 ), | 68 | : WellenreiterBase( parent, 0, 0 ), |
67 | sniffing( false ), iface( 0 ), configwindow( 0 ) | 69 | sniffing( false ), iface( 0 ), configwindow( 0 ) |
68 | { | 70 | { |
69 | 71 | ||
70 | logwindow->log( "(i) Wellenreiter has been started." ); | 72 | logwindow->log( "(i) Wellenreiter has been started." ); |
71 | 73 | ||
72 | // | 74 | // |
73 | // detect operating system | 75 | // detect operating system |
74 | // | 76 | // |
75 | 77 | ||
76 | #ifdef QWS | 78 | #ifdef QWS |
77 | QString sys; | 79 | QString sys = QString( "(i) Running on '%1'.").arg( ODevice::inst()->systemString() ); |
78 | sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() ); | ||
79 | _system = ODevice::inst()->system(); | 80 | _system = ODevice::inst()->system(); |
80 | logwindow->log( sys ); | 81 | logwindow->log( sys ); |
81 | #endif | 82 | #endif |
82 | 83 | ||
83 | netview->setColumnWidthMode( 1, QListView::Manual ); | 84 | netview->setColumnWidthMode( 1, QListView::Manual ); |
84 | connect( netview, SIGNAL( joinNetwork(const QString&,const QString&,int,const QString&) ), | 85 | connect( netview, SIGNAL( joinNetwork(const QString&,const QString&,int,const QString&) ), |
85 | this, SLOT( joinNetwork(const QString&,const QString&,int,const QString&) ) ); | 86 | this, SLOT( joinNetwork(const QString&,const QString&,int,const QString&) ) ); |
86 | pcap = new OPacketCapturer(); | 87 | pcap = new OPacketCapturer(); |
@@ -105,16 +106,17 @@ void Wellenreiter::initialTimer() | |||
105 | { | 106 | { |
106 | odebug << "preloading manufacturer database..." << oendl; | 107 | odebug << "preloading manufacturer database..." << oendl; |
107 | OManufacturerDB::instance(); | 108 | OManufacturerDB::instance(); |
108 | } | 109 | } |
109 | 110 | ||
110 | 111 | ||
111 | void Wellenreiter::signalHandler( int sig ) | 112 | void Wellenreiter::signalHandler( int sig ) |
112 | { | 113 | { |
114 | Q_UNUSED( sig ) | ||
113 | oerr << "Aye! Received SIGSEGV or SIGBUS! Trying to exit gracefully..." << oendl; | 115 | oerr << "Aye! Received SIGSEGV or SIGBUS! Trying to exit gracefully..." << oendl; |
114 | if ( Wellenreiter::instance->sniffing ) | 116 | if ( Wellenreiter::instance->sniffing ) |
115 | { | 117 | { |
116 | Wellenreiter::instance->pcap->closeDumpFile(); | 118 | Wellenreiter::instance->pcap->closeDumpFile(); |
117 | Wellenreiter::instance->pcap->close(); | 119 | Wellenreiter::instance->pcap->close(); |
118 | Wellenreiter::instance->stopClicked(); | 120 | Wellenreiter::instance->stopClicked(); |
119 | } | 121 | } |
120 | oerr << "Phew. Seemed to work." << oendl; | 122 | oerr << "Phew. Seemed to work." << oendl; |
@@ -171,17 +173,17 @@ void Wellenreiter::handleNotification( OPacket* p ) | |||
171 | QObject* o; | 173 | QObject* o; |
172 | 174 | ||
173 | while ( (o = it.current()) != 0 ) | 175 | while ( (o = it.current()) != 0 ) |
174 | { | 176 | { |
175 | QString name = it.current()->name(); | 177 | QString name = it.current()->name(); |
176 | if ( configwindow->parsePackets->isProtocolChecked( name ) ) | 178 | if ( configwindow->parsePackets->isProtocolChecked( name ) ) |
177 | { | 179 | { |
178 | QString action = configwindow->parsePackets->protocolAction( name ); | 180 | QString action = configwindow->parsePackets->protocolAction( name ); |
179 | odebug << "parsePacket-action for '" << (const char*) name << "' seems to be '" << action << "'" << oendl; | 181 | odebug << "parsePacket-action for '" << name << "' seems to be '" << action << "'" << oendl; |
180 | doAction( action, name, p ); | 182 | doAction( action, name, p ); |
181 | } | 183 | } |
182 | else | 184 | else |
183 | { | 185 | { |
184 | odebug << "protocol '" << name << "' not checked in parsePackets." << oendl; | 186 | odebug << "protocol '" << name << "' not checked in parsePackets." << oendl; |
185 | } | 187 | } |
186 | ++it; | 188 | ++it; |
187 | } | 189 | } |
@@ -192,22 +194,22 @@ void Wellenreiter::handleManagementFrame( OPacket* p, OWaveLanManagementPacket* | |||
192 | { | 194 | { |
193 | if ( manage->managementType() == "Beacon" ) handleManagementFrameBeacon( p, manage ); | 195 | if ( manage->managementType() == "Beacon" ) handleManagementFrameBeacon( p, manage ); |
194 | else if ( manage->managementType() == "ProbeRequest" ) handleManagementFrameProbeRequest( p, manage ); | 196 | else if ( manage->managementType() == "ProbeRequest" ) handleManagementFrameProbeRequest( p, manage ); |
195 | else if ( manage->managementType() == "ProbeResponse" ) handleManagementFrameProbeResponse( p, manage ); | 197 | else if ( manage->managementType() == "ProbeResponse" ) handleManagementFrameProbeResponse( p, manage ); |
196 | else owarn << "Wellenreiter::handleManagementFrame(): '" << manage->managementType() << "' - please handle me!" << oendl; | 198 | else owarn << "Wellenreiter::handleManagementFrame(): '" << manage->managementType() << "' - please handle me!" << oendl; |
197 | } | 199 | } |
198 | 200 | ||
199 | 201 | ||
200 | void Wellenreiter::handleManagementFrameProbeRequest( OPacket* p, OWaveLanManagementPacket* request ) | 202 | void Wellenreiter::handleManagementFrameProbeRequest( OPacket* p, OWaveLanManagementPacket* /* request */ ) |
201 | { | 203 | { |
202 | OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); | 204 | OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); |
203 | QString essid = ssid ? ssid->ID( true /* decloak */ ) : QString("<unknown>"); | 205 | QString essid = ssid ? ssid->ID( true /* decloak */ ) : QString("<unknown>"); |
204 | OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) ); | 206 | // OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) ); |
205 | int channel = ds ? ds->channel() : -1; | 207 | // int channel = ds ? ds->channel() : -1; |
206 | OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); | 208 | OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); |
207 | 209 | ||
208 | GpsLocation loc( -111, -111 ); | 210 | GpsLocation loc( -111, -111 ); |
209 | if ( configwindow->enableGPS->isChecked() ) | 211 | if ( configwindow->enableGPS->isChecked() ) |
210 | { | 212 | { |
211 | // TODO: add check if GPS is working!? | 213 | // TODO: add check if GPS is working!? |
212 | odebug << "Wellenreiter::gathering GPS data..." << oendl; | 214 | odebug << "Wellenreiter::gathering GPS data..." << oendl; |
213 | loc = gps->position(); | 215 | loc = gps->position(); |
@@ -215,22 +217,22 @@ void Wellenreiter::handleManagementFrameProbeRequest( OPacket* p, OWaveLanManage | |||
215 | } | 217 | } |
216 | 218 | ||
217 | if ( essid.length() ) | 219 | if ( essid.length() ) |
218 | netView()->addNewItem( "adhoc", essid, header->macAddress2(), false /* should check FrameControl field */, -1, 0, loc, true /* only probed */ ); | 220 | netView()->addNewItem( "adhoc", essid, header->macAddress2(), false /* should check FrameControl field */, -1, 0, loc, true /* only probed */ ); |
219 | odebug << "Wellenreiter::invalid frame [possibly noise] detected!" << oendl; | 221 | odebug << "Wellenreiter::invalid frame [possibly noise] detected!" << oendl; |
220 | } | 222 | } |
221 | 223 | ||
222 | 224 | ||
223 | void Wellenreiter::handleManagementFrameProbeResponse( OPacket* p, OWaveLanManagementPacket* response ) | 225 | void Wellenreiter::handleManagementFrameProbeResponse( OPacket* /* p */, OWaveLanManagementPacket* /* response */ ) |
224 | { | 226 | { |
225 | } | 227 | } |
226 | 228 | ||
227 | 229 | ||
228 | void Wellenreiter::handleManagementFrameBeacon( OPacket* p, OWaveLanManagementPacket* beacon ) | 230 | void Wellenreiter::handleManagementFrameBeacon( OPacket* p, OWaveLanManagementPacket* beacon ) |
229 | { | 231 | { |
230 | QString type; | 232 | QString type; |
231 | if ( beacon->canIBSS() ) | 233 | if ( beacon->canIBSS() ) |
232 | { | 234 | { |
233 | type = "adhoc"; | 235 | type = "adhoc"; |
234 | } | 236 | } |
235 | else if ( beacon->canESS() ) | 237 | else if ( beacon->canESS() ) |
236 | { | 238 | { |
@@ -282,17 +284,17 @@ void Wellenreiter::handleControlFrame( OPacket* p, OWaveLanControlPacket* contro | |||
282 | } | 284 | } |
283 | else | 285 | else |
284 | { | 286 | { |
285 | odebug << "Wellenreiter::handleControlFrame - please handle " << control->controlType() << " in a future version! :D" << oendl; | 287 | odebug << "Wellenreiter::handleControlFrame - please handle " << control->controlType() << " in a future version! :D" << oendl; |
286 | } | 288 | } |
287 | } | 289 | } |
288 | 290 | ||
289 | 291 | ||
290 | void Wellenreiter::handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to ) | 292 | void Wellenreiter::handleWlanData( OPacket* p, OWaveLanDataPacket* /* data */ , OMacAddress& from, OMacAddress& to ) |
291 | { | 293 | { |
292 | OWaveLanPacket* wlan = (OWaveLanPacket*) p->child( "802.11" ); | 294 | OWaveLanPacket* wlan = (OWaveLanPacket*) p->child( "802.11" ); |
293 | if ( wlan->fromDS() && !wlan->toDS() ) | 295 | if ( wlan->fromDS() && !wlan->toDS() ) |
294 | { | 296 | { |
295 | netView()->fromDStraffic( wlan->macAddress3(), wlan->macAddress1(), wlan->macAddress2() ); | 297 | netView()->fromDStraffic( wlan->macAddress3(), wlan->macAddress1(), wlan->macAddress2() ); |
296 | from = wlan->macAddress3(); | 298 | from = wlan->macAddress3(); |
297 | to = wlan->macAddress2(); | 299 | to = wlan->macAddress2(); |
298 | } | 300 | } |
@@ -312,26 +314,26 @@ void Wellenreiter::handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAdd | |||
312 | { | 314 | { |
313 | netView()->IBSStraffic( wlan->macAddress2(), wlan->macAddress1(), wlan->macAddress3() ); | 315 | netView()->IBSStraffic( wlan->macAddress2(), wlan->macAddress1(), wlan->macAddress3() ); |
314 | from = wlan->macAddress2(); | 316 | from = wlan->macAddress2(); |
315 | to = wlan->macAddress1(); | 317 | to = wlan->macAddress1(); |
316 | } | 318 | } |
317 | } | 319 | } |
318 | 320 | ||
319 | 321 | ||
320 | void Wellenreiter::handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAddress& from, OMacAddress& to ) | 322 | void Wellenreiter::handleEthernetData( OPacket* /* p */, OEthernetPacket* data, OMacAddress& from, OMacAddress& to ) |
321 | { | 323 | { |
322 | from = data->sourceAddress(); | 324 | from = data->sourceAddress(); |
323 | to = data->destinationAddress(); | 325 | to = data->destinationAddress(); |
324 | 326 | ||
325 | netView()->addNewItem( "station", "<wired>", from, false, -1, 0, GpsLocation( -111, -111 ) ); | 327 | netView()->addNewItem( "station", "<wired>", from, false, -1, 0, GpsLocation( -111, -111 ) ); |
326 | } | 328 | } |
327 | 329 | ||
328 | 330 | ||
329 | void Wellenreiter::handleARPData( OPacket* p, OARPPacket*, OMacAddress& source, OMacAddress& dest ) | 331 | void Wellenreiter::handleARPData( OPacket* p, OARPPacket*, OMacAddress& /* source */, OMacAddress& /* dest */ ) |
330 | { | 332 | { |
331 | OARPPacket* arp = (OARPPacket*) p->child( "ARP" ); | 333 | OARPPacket* arp = (OARPPacket*) p->child( "ARP" ); |
332 | if ( arp ) | 334 | if ( arp ) |
333 | { | 335 | { |
334 | odebug << "Received ARP traffic (type '" << arp->type() << "'): " << oendl; | 336 | odebug << "Received ARP traffic (type '" << arp->type() << "'): " << oendl; |
335 | if ( arp->type() == "REQUEST" ) | 337 | if ( arp->type() == "REQUEST" ) |
336 | { | 338 | { |
337 | netView()->identify( arp->senderMacAddress(), arp->senderIPV4Address().toString() ); | 339 | netView()->identify( arp->senderMacAddress(), arp->senderIPV4Address().toString() ); |
@@ -340,33 +342,33 @@ void Wellenreiter::handleARPData( OPacket* p, OARPPacket*, OMacAddress& source, | |||
340 | { | 342 | { |
341 | netView()->identify( arp->senderMacAddress(), arp->senderIPV4Address().toString() ); | 343 | netView()->identify( arp->senderMacAddress(), arp->senderIPV4Address().toString() ); |
342 | netView()->identify( arp->targetMacAddress(), arp->targetIPV4Address().toString() ); | 344 | netView()->identify( arp->targetMacAddress(), arp->targetIPV4Address().toString() ); |
343 | } | 345 | } |
344 | } | 346 | } |
345 | } | 347 | } |
346 | 348 | ||
347 | 349 | ||
348 | void Wellenreiter::handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& source, OMacAddress& dest ) | 350 | void Wellenreiter::handleIPData( OPacket* p, OIPPacket* /* ip */, OMacAddress& source, OMacAddress& /* dest */ ) |
349 | { | 351 | { |
350 | //TODO: Implement more IP based protocols | 352 | //TODO: Implement more IP based protocols |
351 | 353 | ||
352 | ODHCPPacket* dhcp = (ODHCPPacket*) p->child( "DHCP" ); | 354 | ODHCPPacket* dhcp = (ODHCPPacket*) p->child( "DHCP" ); |
353 | if ( dhcp ) | 355 | if ( dhcp ) |
354 | { | 356 | { |
355 | odebug << "Received DHCP '" << dhcp->type() << "' packet" << oendl; | 357 | odebug << "Received DHCP '" << dhcp->type() << "' packet" << oendl; |
356 | if ( dhcp->type() == "OFFER" ) | 358 | if ( dhcp->type() == "OFFER" ) |
357 | { | 359 | { |
358 | odebug << "DHCP: '" << (const char*) source.toString() << "' ('" << dhcp->serverAddress().toString() << "') seems to be a DHCP server." << oendl; | 360 | odebug << "DHCP: '" << source.toString() << "' ('" << dhcp->serverAddress().toString() << "') seems to be a DHCP server." << oendl; |
359 | netView()->identify( source, dhcp->serverAddress().toString() ); | 361 | netView()->identify( source, dhcp->serverAddress().toString() ); |
360 | netView()->addService( "DHCP", source, dhcp->serverAddress().toString() ); | 362 | netView()->addService( "DHCP", source, dhcp->serverAddress().toString() ); |
361 | } | 363 | } |
362 | else if ( dhcp->type() == "ACK" ) | 364 | else if ( dhcp->type() == "ACK" ) |
363 | { | 365 | { |
364 | odebug << "DHCP: '" << (const char*) dhcp->clientMacAddress().toString() << "' ('" << dhcp->yourAddress().toString() << "') accepted the offered DHCP address." << oendl; | 366 | odebug << "DHCP: '" << dhcp->clientMacAddress().toString() << "' ('" << dhcp->yourAddress().toString() << "') accepted the offered DHCP address." << oendl; |
365 | netView()->identify( dhcp->clientMacAddress(), dhcp->yourAddress().toString() ); | 367 | netView()->identify( dhcp->clientMacAddress(), dhcp->yourAddress().toString() ); |
366 | } | 368 | } |
367 | } | 369 | } |
368 | } | 370 | } |
369 | 371 | ||
370 | 372 | ||
371 | QObject* Wellenreiter::childIfToParse( OPacket* p, const QString& protocol ) | 373 | QObject* Wellenreiter::childIfToParse( OPacket* p, const QString& protocol ) |
372 | { | 374 | { |
@@ -390,20 +392,20 @@ bool Wellenreiter::checkDumpPacket( OPacket* p ) | |||
390 | QObject* o; | 392 | QObject* o; |
391 | 393 | ||
392 | while ( (o = it.current()) != 0 ) | 394 | while ( (o = it.current()) != 0 ) |
393 | { | 395 | { |
394 | QString name = it.current()->name(); | 396 | QString name = it.current()->name(); |
395 | if ( configwindow->capturePackets->isProtocolChecked( name ) ) | 397 | if ( configwindow->capturePackets->isProtocolChecked( name ) ) |
396 | { | 398 | { |
397 | QString action = configwindow->capturePackets->protocolAction( name ); | 399 | QString action = configwindow->capturePackets->protocolAction( name ); |
398 | odebug << "capturePackets-action for '" << (const char*) name << "' seems to be '" << action << "'" << oendl; | 400 | odebug << "capturePackets-action for '" << name << "' seems to be '" << action << "'" << oendl; |
399 | if ( action == "Discard" ) | 401 | if ( action == "Discard" ) |
400 | { | 402 | { |
401 | logwindow->log( QString().sprintf( "(i) dump-discarding of '%s' packet requested.", (const char*) name ) ); | 403 | logwindow->log( QString("(i) dump-discarding of '%1' packet requested." ).arg( name ) ); |
402 | return false; | 404 | return false; |
403 | } | 405 | } |
404 | } | 406 | } |
405 | else | 407 | else |
406 | { | 408 | { |
407 | odebug << "protocol '" << name << "' not checked in capturePackets." << oendl; | 409 | odebug << "protocol '" << name << "' not checked in capturePackets." << oendl; |
408 | } | 410 | } |
409 | ++it; | 411 | ++it; |
@@ -515,29 +517,27 @@ void Wellenreiter::stopClicked() | |||
515 | if ( WellenreiterConfigWindow::instance()->disablePM->isChecked() ) | 517 | if ( WellenreiterConfigWindow::instance()->disablePM->isChecked() ) |
516 | { | 518 | { |
517 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; | 519 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; |
518 | } | 520 | } |
519 | #else | 521 | #else |
520 | #warning FIXME: setScreenSaverMode is not operational on the X11 build | 522 | #warning FIXME: setScreenSaverMode is not operational on the X11 build |
521 | #endif | 523 | #endif |
522 | 524 | ||
523 | // print out statistics | 525 | updateStatistics(); |
524 | for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it ) | ||
525 | statwindow->updateCounter( it.key(), it.data() ); | ||
526 | } | 526 | } |
527 | 527 | ||
528 | 528 | ||
529 | void Wellenreiter::startClicked() | 529 | void Wellenreiter::startClicked() |
530 | { | 530 | { |
531 | // get configuration from config window | 531 | // get configuration from config window |
532 | 532 | ||
533 | const QString& interface = configwindow->interfaceName->currentText(); | 533 | const QString& interface = configwindow->interfaceName->currentText(); |
534 | const int cardtype = configwindow->driverType(); | 534 | const int cardtype = configwindow->driverType(); |
535 | const int interval = configwindow->hoppingInterval(); | 535 | // const int interval = configwindow->hoppingInterval(); |
536 | 536 | ||
537 | if ( ( interface == "" ) || ( cardtype == 0 ) ) | 537 | if ( ( interface == "" ) || ( cardtype == 0 ) ) |
538 | { | 538 | { |
539 | QMessageBox::information( this, "Wellenreiter II", | 539 | QMessageBox::information( this, "Wellenreiter II", |
540 | tr( "No device configured.\nPlease reconfigure!" ) ); | 540 | tr( "No device configured.\nPlease reconfigure!" ) ); |
541 | return; | 541 | return; |
542 | } | 542 | } |
543 | 543 | ||
@@ -699,34 +699,34 @@ void Wellenreiter::timerEvent( QTimerEvent* ) | |||
699 | receivePacket( p ); | 699 | receivePacket( p ); |
700 | // We no longer delete packets here. Ownership of the packets is | 700 | // We no longer delete packets here. Ownership of the packets is |
701 | // transferred to the PacketView. | 701 | // transferred to the PacketView. |
702 | //delete p; | 702 | //delete p; |
703 | } | 703 | } |
704 | } | 704 | } |
705 | 705 | ||
706 | 706 | ||
707 | void Wellenreiter::doAction( const QString& action, const QString& protocol, OPacket* p ) | 707 | void Wellenreiter::doAction( const QString& action, const QString& protocol, OPacket* /* p */ ) |
708 | { | 708 | { |
709 | #ifdef QWS | 709 | #ifdef QWS |
710 | if ( action == "TouchSound" ) | 710 | if ( action == "TouchSound" ) |
711 | ODevice::inst()->playTouchSound(); | 711 | ODevice::inst()->playTouchSound(); |
712 | else if ( action == "AlarmSound" ) | 712 | else if ( action == "AlarmSound" ) |
713 | ODevice::inst()->playAlarmSound(); | 713 | ODevice::inst()->playAlarmSound(); |
714 | else if ( action == "KeySound" ) | 714 | else if ( action == "KeySound" ) |
715 | ODevice::inst()->playKeySound(); | 715 | ODevice::inst()->playKeySound(); |
716 | else if ( action == "LedOn" ) | 716 | else if ( action == "LedOn" ) |
717 | ODevice::inst()->setLedState( Led_Mail, Led_On ); | 717 | ODevice::inst()->setLedState( Led_Mail, Led_On ); |
718 | else if ( action == "LedOff" ) | 718 | else if ( action == "LedOff" ) |
719 | ODevice::inst()->setLedState( Led_Mail, Led_Off ); | 719 | ODevice::inst()->setLedState( Led_Mail, Led_Off ); |
720 | else if ( action == "LogMessage" ) | 720 | else if ( action == "LogMessage" ) |
721 | logwindow->log( QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) ); | 721 | logwindow->log( QString(tr("Got packet with protocol '%1'","Protocol Name" ) ).arg( protocol ) ); |
722 | else if ( action == "MessageBox" ) | 722 | else if ( action == "MessageBox" ) |
723 | QMessageBox::information( this, "Notification!", | 723 | QMessageBox::information( this, "Notification!", |
724 | QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) ); | 724 | QString(tr( "Got packet with protocol '%1'", "Protocol Name" ) ).arg( protocol ) ); |
725 | #else | 725 | #else |
726 | #warning Actions do not work with Qt/X11 yet | 726 | #warning Actions do not work with Qt/X11 yet |
727 | #endif | 727 | #endif |
728 | } | 728 | } |
729 | 729 | ||
730 | void Wellenreiter::joinNetwork(const QString& type, const QString& essid, int channel, const QString& macaddr) | 730 | void Wellenreiter::joinNetwork(const QString& type, const QString& essid, int channel, const QString& macaddr) |
731 | { | 731 | { |
732 | #ifdef QWS | 732 | #ifdef QWS |
@@ -737,19 +737,19 @@ void Wellenreiter::joinNetwork(const QString& type, const QString& essid, int ch | |||
737 | } | 737 | } |
738 | 738 | ||
739 | if ( sniffing ) | 739 | if ( sniffing ) |
740 | { | 740 | { |
741 | QMessageBox::warning( this, tr( "Can't do that!" ), tr( "Stop sniffing before\njoining a net." ) ); | 741 | QMessageBox::warning( this, tr( "Can't do that!" ), tr( "Stop sniffing before\njoining a net." ) ); |
742 | return; | 742 | return; |
743 | } | 743 | } |
744 | 744 | ||
745 | odebug << "joinNetwork() with Interface " << (const char*) iface->name() | 745 | odebug << "joinNetwork() with Interface " << iface->name() |
746 | << ": " << (const char*) type << ", " << (const char*) essid | 746 | << ": " << type << ", " << essid |
747 | << ", " << channel << ", " << (const char*) macaddr << oendl; | 747 | << ", " << channel << ", " << macaddr << oendl; |
748 | 748 | ||
749 | QCopEnvelope msg( "QPE/Application/networksettings", "wlan(QString,QString,QString)" ); | 749 | QCopEnvelope msg( "QPE/Application/networksettings", "wlan(QString,QString,QString)" ); |
750 | int count = 3; | 750 | int count = 3; |
751 | odebug << "sending " << count << " messages" << oendl; | 751 | odebug << "sending " << count << " messages" << oendl; |
752 | msg << QString("count") << QString::number(count); | 752 | msg << QString("count") << QString::number(count); |
753 | odebug << "msg >" << iface->name() << "< Mode >" << type.latin1() << "<" << oendl; | 753 | odebug << "msg >" << iface->name() << "< Mode >" << type.latin1() << "<" << oendl; |
754 | msg << QString(iface->name()) << QString("Mode") << type; | 754 | msg << QString(iface->name()) << QString("Mode") << type; |
755 | odebug << "msg >" << iface->name() << "< essid >" << essid.latin1() << "<" << oendl; | 755 | odebug << "msg >" << iface->name() << "< essid >" << essid.latin1() << "<" << oendl; |
@@ -759,8 +759,20 @@ void Wellenreiter::joinNetwork(const QString& type, const QString& essid, int ch | |||
759 | // odebug << "msg >" << iface->name() << "< mac >" << macaddr << "<" << oendl; | 759 | // odebug << "msg >" << iface->name() << "< mac >" << macaddr << "<" << oendl; |
760 | // msg << QString(iface->name()) << QString("MacAddr") << macaddr; | 760 | // msg << QString(iface->name()) << QString("MacAddr") << macaddr; |
761 | #else | 761 | #else |
762 | QMessageBox::warning( this, tr( "Can't do that!" ), tr( "Function only available on Embedded build" ) ); | 762 | QMessageBox::warning( this, tr( "Can't do that!" ), tr( "Function only available on Embedded build" ) ); |
763 | #endif | 763 | #endif |
764 | 764 | ||
765 | } | 765 | } |
766 | 766 | ||
767 | void Wellenreiter::updateStatistics() | ||
768 | { | ||
769 | // print out statistics | ||
770 | for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it ) | ||
771 | statwindow->updateCounter( it.key(), it.data() ); | ||
772 | } | ||
773 | |||
774 | void Wellenreiter::slotTabChanged( QWidget* wid ) | ||
775 | { | ||
776 | if ( wid == statwindow ) | ||
777 | updateStatistics(); | ||
778 | } | ||
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h index f582a5f..5ac389e 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.h +++ b/noncore/net/wellenreiter/gui/wellenreiter.h | |||
@@ -88,17 +88,22 @@ class Wellenreiter : public WellenreiterBase { | |||
88 | void handleARPData( Opie::Net::OPacket* p, Opie::Net::OARPPacket* arp, Opie::Net::OMacAddress& from, Opie::Net::OMacAddress& to ); | 88 | void handleARPData( Opie::Net::OPacket* p, Opie::Net::OARPPacket* arp, Opie::Net::OMacAddress& from, Opie::Net::OMacAddress& to ); |
89 | void handleIPData( Opie::Net::OPacket* p, Opie::Net::OIPPacket* ip, Opie::Net::OMacAddress& from, Opie::Net::OMacAddress& to ); | 89 | void handleIPData( Opie::Net::OPacket* p, Opie::Net::OIPPacket* ip, Opie::Net::OMacAddress& from, Opie::Net::OMacAddress& to ); |
90 | void handleNotification( Opie::Net::OPacket* p ); | 90 | void handleNotification( Opie::Net::OPacket* p ); |
91 | void doAction( const QString& action, const QString& protocol, Opie::Net::OPacket* p ); | 91 | void doAction( const QString& action, const QString& protocol, Opie::Net::OPacket* p ); |
92 | QObject* childIfToParse( Opie::Net::OPacket* p, const QString& protocol ); | 92 | QObject* childIfToParse( Opie::Net::OPacket* p, const QString& protocol ); |
93 | bool checkDumpPacket( Opie::Net::OPacket* p ); | 93 | bool checkDumpPacket( Opie::Net::OPacket* p ); |
94 | void registerSignalHandler(); | 94 | void registerSignalHandler(); |
95 | 95 | ||
96 | private slots: | ||
97 | void slotTabChanged( QWidget* ); | ||
98 | |||
96 | private: | 99 | private: |
100 | void updateStatistics(); | ||
101 | |||
97 | #ifdef QWS | 102 | #ifdef QWS |
98 | Opie::Core::OSystem _system; // Opie Operating System identifier | 103 | Opie::Core::OSystem _system; // Opie Operating System identifier |
99 | #endif | 104 | #endif |
100 | 105 | ||
101 | Opie::Net::OWirelessNetworkInterface* iface; | 106 | Opie::Net::OWirelessNetworkInterface* iface; |
102 | Opie::Net::OPacketCapturer* pcap; | 107 | Opie::Net::OPacketCapturer* pcap; |
103 | WellenreiterConfigWindow* configwindow; | 108 | WellenreiterConfigWindow* configwindow; |
104 | GPS* gps; | 109 | GPS* gps; |
diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp index a29d520..0ca0bd7 100644 --- a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp | |||
@@ -153,16 +153,18 @@ WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags f | |||
153 | TabWidget->addTab( about, /* "wellenreiter/about", */ tr( "About" ) ); | 153 | TabWidget->addTab( about, /* "wellenreiter/about", */ tr( "About" ) ); |
154 | #endif | 154 | #endif |
155 | WellenreiterBaseLayout->addWidget( TabWidget ); | 155 | WellenreiterBaseLayout->addWidget( TabWidget ); |
156 | 156 | ||
157 | #ifdef QWS | 157 | #ifdef QWS |
158 | TabWidget->setCurrentTab( tr( "Nets" ) ); | 158 | TabWidget->setCurrentTab( tr( "Nets" ) ); |
159 | #endif | 159 | #endif |
160 | 160 | ||
161 | connect(TabWidget, SIGNAL(currentChanged(QWidget*)), | ||
162 | this, SLOT(slotTabChanged(QWidget*))); | ||
161 | } | 163 | } |
162 | 164 | ||
163 | /* | 165 | /* |
164 | * Destroys the object and frees any allocated resources | 166 | * Destroys the object and frees any allocated resources |
165 | */ | 167 | */ |
166 | WellenreiterBase::~WellenreiterBase() | 168 | WellenreiterBase::~WellenreiterBase() |
167 | { | 169 | { |
168 | // no need to delete child widgets, Qt does it all for us | 170 | // no need to delete child widgets, Qt does it all for us |
diff --git a/noncore/net/wellenreiter/opie-wellenreiter.control b/noncore/net/wellenreiter/opie-wellenreiter.control index cbc287a..e7bc25d 100644 --- a/noncore/net/wellenreiter/opie-wellenreiter.control +++ b/noncore/net/wellenreiter/opie-wellenreiter.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-wellenreiter | 1 | Package: opie-wellenreiter |
2 | Files: bin/wellenreiter pics/wellenreiter apps/Applications/wellenreiter.desktop | 2 | Files: bin/wellenreiter pics/wellenreiter apps/Applications/wellenreiter.desktop |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/applications | 4 | Section: opie/applications |
5 | Maintainer: Michael 'Mickey' Lauer <mickeyl@handhelds.org> | 5 | Maintainer: Michael 'Mickey' Lauer <mickeyl@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: 1.0.3 | 7 | Version: 1.0.3-cvs |
8 | Depends: libqpe1, libpcap0 (>=0.7.2), libopiecore2, libopienet2, libopieui2 | 8 | Depends: libqpe1, libpcap0 (>=0.7.2), libopiecore2, libopienet2, libopieui2 |
9 | Description: A WaveLAN Network Monitor | 9 | Description: A WaveLAN Network Monitor |
10 | A WaveLAN Network Monitor/Sniffer for the Opie Environment. | 10 | A WaveLAN Network Monitor/Sniffer for the Opie Environment. |
diff --git a/noncore/net/wellenreiter/wellenreiter.pro b/noncore/net/wellenreiter/wellenreiter.pro index eb60c4a..53b762a 100644 --- a/noncore/net/wellenreiter/wellenreiter.pro +++ b/noncore/net/wellenreiter/wellenreiter.pro | |||
@@ -1,9 +1,10 @@ | |||
1 | TEMPLATE = subdirs | 1 | TEMPLATE = subdirs |
2 | VERSION = 1.0.3-cvs | ||
2 | 3 | ||
3 | !contains( platform, x11 ) { | 4 | !contains( platform, x11 ) { |
4 | message( Configuring Wellenreiter for build on Opie ) | 5 | message( Configuring Wellenreiter for build on Opie ) |
5 | SUBDIRS = gui | 6 | SUBDIRS = gui |
6 | include ( $(OPIEDIR)/include.pro ) | 7 | include ( $(OPIEDIR)/include.pro ) |
7 | } | 8 | } |
8 | 9 | ||
9 | contains( platform, x11 ) { | 10 | contains( platform, x11 ) { |