summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/wellenreiter.cpp
Unidiff
Diffstat (limited to 'noncore/net/wellenreiter/gui/wellenreiter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp18
1 files changed, 2 insertions, 16 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index 0105e09..5ec9ee4 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -23,24 +23,25 @@ using namespace Opie;
23#ifdef QWS 23#ifdef QWS
24#include <opie2/oapplication.h> 24#include <opie2/oapplication.h>
25#else 25#else
26#include <qapplication.h> 26#include <qapplication.h>
27#endif 27#endif
28#include <opie2/onetwork.h> 28#include <opie2/onetwork.h>
29#include <opie2/opcap.h> 29#include <opie2/opcap.h>
30 30
31// Qt 31// Qt
32 32
33#include <qcheckbox.h> 33#include <qcheckbox.h>
34#include <qcombobox.h> 34#include <qcombobox.h>
35#include <qdatetime.h>
35#include <qpushbutton.h> 36#include <qpushbutton.h>
36#include <qlineedit.h> 37#include <qlineedit.h>
37#include <qmessagebox.h> 38#include <qmessagebox.h>
38#include <qregexp.h> 39#include <qregexp.h>
39#include <qspinbox.h> 40#include <qspinbox.h>
40#include <qtoolbutton.h> 41#include <qtoolbutton.h>
41#include <qmainwindow.h> 42#include <qmainwindow.h>
42 43
43// Standard 44// Standard
44 45
45#include <assert.h> 46#include <assert.h>
46#include <errno.h> 47#include <errno.h>
@@ -248,41 +249,26 @@ void Wellenreiter::stopClicked()
248 249
249 logwindow->log( "(i) Stopped Scanning." ); 250 logwindow->log( "(i) Stopped Scanning." );
250 assert( parent() ); 251 assert( parent() );
251 ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II" ); 252 ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II" );
252 253
253 // message the user 254 // message the user
254 QMessageBox::information( this, "Wellenreiter II", "Your wireless card\nshould now be usable again." ); 255 QMessageBox::information( this, "Wellenreiter II", "Your wireless card\nshould now be usable again." );
255 256
256 sniffing = false; 257 sniffing = false;
257 emit( stoppedSniffing() ); 258 emit( stoppedSniffing() );
258 259
259 // print out statistics 260 // print out statistics
260 statwindow->log( "-----------------------------------------" );
261 statwindow->log( "- Wellenreiter II Capturing Statistic -" );
262 statwindow->log( "-----------------------------------------" );
263 statwindow->log( "Packet Type | Receive Count" );
264
265 for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it ) 261 for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it )
266 { 262 statwindow->updateCounter( it.key(), it.data() );
267 QString left;
268 left.sprintf( "%s", (const char*) it.key() );
269 left = left.leftJustify( 20 );
270 left.append( '|' );
271 QString right;
272 right.sprintf( "%d", it.data() );
273 right = right.rightJustify( 7 );
274 statwindow->log( left + right );
275 }
276
277} 263}
278 264
279 265
280void Wellenreiter::startClicked() 266void Wellenreiter::startClicked()
281{ 267{
282 // get configuration from config window 268 // get configuration from config window
283 269
284 const QString& interface = configwindow->interfaceName->currentText(); 270 const QString& interface = configwindow->interfaceName->currentText();
285 const int cardtype = configwindow->daemonDeviceType(); 271 const int cardtype = configwindow->daemonDeviceType();
286 const int interval = configwindow->daemonHopInterval(); 272 const int interval = configwindow->daemonHopInterval();
287 273
288 if ( ( interface == "" ) || ( cardtype == 0 ) ) 274 if ( ( interface == "" ) || ( cardtype == 0 ) )