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; #include <qspinbox.h> +#include <qtoolbutton.h> #include <qmainwindow.h> @@ -54,3 +55,3 @@ using namespace Opie; #include "configwindow.h" - +#include "statwindow.h" #include "manufacturers.h" @@ -219,5 +220,4 @@ void Wellenreiter::receivePacket(OPacket* p) -void Wellenreiter::startStopClicked() -{ - if ( sniffing ) + +void Wellenreiter::stopClicked() { @@ -251,5 +251,28 @@ void Wellenreiter::startStopClicked() QMessageBox::information( this, "Wellenreiter II", "Your wireless card\nshould now be usable again." ); + + sniffing = false; + emit( stoppedSniffing() ); + + // print out statistics + statwindow->log( "-----------------------------------------" ); + statwindow->log( "- Wellenreiter II Capturing Statistic -" ); + statwindow->log( "-----------------------------------------" ); + statwindow->log( "Packet Type | Receive Count" ); + + for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it ) + { + QString left; + left.sprintf( "%s", (const char*) it.key() ); + left = left.leftJustify( 20 ); + left.append( '|' ); + QString right; + right.sprintf( "%d", it.data() ); + right = right.rightJustify( 7 ); + statwindow->log( left + right ); } - else +} + + +void Wellenreiter::startClicked() { @@ -280,5 +303,7 @@ void Wellenreiter::startStopClicked() case 4: iface->setMonitoring( new OOrinocoMonitoringInterface( iface ) ); break; - default: assert( 0 ); // shouldn't happen + default: + QMessageBox::information( this, "Wellenreiter II", "Bring your device into\nmonitor mode now." ); } + if ( cardtype > 0 && cardtype < 5 ) iface->setMonitorMode( true ); @@ -312,4 +337,3 @@ void Wellenreiter::startStopClicked() sniffing = true; - - } + emit( startedSniffing() ); } |