Diffstat (limited to 'noncore/net/wellenreiter/gui/wellenreiter.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 0bfc8e9..3372883 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -36,2 +36,3 @@ using namespace Opie; | |||
36 | #include <qspinbox.h> | 36 | #include <qspinbox.h> |
37 | #include <qtoolbutton.h> | ||
37 | #include <qmainwindow.h> | 38 | #include <qmainwindow.h> |
@@ -54,3 +55,3 @@ using namespace Opie; | |||
54 | #include "configwindow.h" | 55 | #include "configwindow.h" |
55 | 56 | #include "statwindow.h" | |
56 | #include "manufacturers.h" | 57 | #include "manufacturers.h" |
@@ -219,5 +220,4 @@ void Wellenreiter::receivePacket(OPacket* p) | |||
219 | 220 | ||
220 | void Wellenreiter::startStopClicked() | 221 | |
221 | { | 222 | void Wellenreiter::stopClicked() |
222 | if ( sniffing ) | ||
223 | { | 223 | { |
@@ -251,5 +251,28 @@ void Wellenreiter::startStopClicked() | |||
251 | QMessageBox::information( this, "Wellenreiter II", "Your wireless card\nshould now be usable again." ); | 251 | QMessageBox::information( this, "Wellenreiter II", "Your wireless card\nshould now be usable again." ); |
252 | |||
253 | sniffing = false; | ||
254 | emit( stoppedSniffing() ); | ||
255 | |||
256 | // print out statistics | ||
257 | statwindow->log( "-----------------------------------------" ); | ||
258 | statwindow->log( "- Wellenreiter II Capturing Statistic -" ); | ||
259 | statwindow->log( "-----------------------------------------" ); | ||
260 | statwindow->log( "Packet Type | Receive Count" ); | ||
261 | |||
262 | for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it ) | ||
263 | { | ||
264 | QString left; | ||
265 | left.sprintf( "%s", (const char*) it.key() ); | ||
266 | left = left.leftJustify( 20 ); | ||
267 | left.append( '|' ); | ||
268 | QString right; | ||
269 | right.sprintf( "%d", it.data() ); | ||
270 | right = right.rightJustify( 7 ); | ||
271 | statwindow->log( left + right ); | ||
252 | } | 272 | } |
253 | 273 | ||
254 | else | 274 | } |
275 | |||
276 | |||
277 | void Wellenreiter::startClicked() | ||
255 | { | 278 | { |
@@ -280,5 +303,7 @@ void Wellenreiter::startStopClicked() | |||
280 | case 4: iface->setMonitoring( new OOrinocoMonitoringInterface( iface ) ); break; | 303 | case 4: iface->setMonitoring( new OOrinocoMonitoringInterface( iface ) ); break; |
281 | default: assert( 0 ); // shouldn't happen | 304 | default: |
305 | QMessageBox::information( this, "Wellenreiter II", "Bring your device into\nmonitor mode now." ); | ||
282 | } | 306 | } |
283 | 307 | ||
308 | if ( cardtype > 0 && cardtype < 5 ) | ||
284 | iface->setMonitorMode( true ); | 309 | iface->setMonitorMode( true ); |
@@ -312,4 +337,3 @@ void Wellenreiter::startStopClicked() | |||
312 | sniffing = true; | 337 | sniffing = true; |
313 | 338 | emit( startedSniffing() ); | |
314 | } | ||
315 | } | 339 | } |