summaryrefslogtreecommitdiff
path: root/noncore
authormickeyl <mickeyl>2003-04-09 10:37:19 (UTC)
committer mickeyl <mickeyl>2003-04-09 10:37:19 (UTC)
commit73f4014f0175c77b9bff8dd06f1c034eb80442f9 (patch) (unidiff)
treee402a7229190e3af5a090b7fdeadf43b78164061 /noncore
parent5cb59a3e8abdbb05fe4bbc9e549f264153168232 (diff)
downloadopie-73f4014f0175c77b9bff8dd06f1c034eb80442f9.zip
opie-73f4014f0175c77b9bff8dd06f1c034eb80442f9.tar.gz
opie-73f4014f0175c77b9bff8dd06f1c034eb80442f9.tar.bz2
display a fancy ascii-animation in the titlebar while scanning...
... no really, it's actually pretty useful, because you can see which channel we are currently monitoring :-D
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp37
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.h1
2 files changed, 30 insertions, 8 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index 8c2c315..0bfc8e9 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -34,7 +34,7 @@ using namespace Opie;
34#include <qmessagebox.h> 34#include <qmessagebox.h>
35#include <qcombobox.h> 35#include <qcombobox.h>
36#include <qspinbox.h> 36#include <qspinbox.h>
37#include <qsocketnotifier.h> 37#include <qmainwindow.h>
38 38
39// Standard 39// Standard
40 40
@@ -95,6 +95,7 @@ Wellenreiter::Wellenreiter( QWidget* parent )
95 95
96} 96}
97 97
98
98Wellenreiter::~Wellenreiter() 99Wellenreiter::~Wellenreiter()
99{ 100{
100 // no need to delete child widgets, Qt does it all for us 101 // no need to delete child widgets, Qt does it all for us
@@ -103,11 +104,33 @@ Wellenreiter::~Wellenreiter()
103 delete pcap; 104 delete pcap;
104} 105}
105 106
107
106void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) 108void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw )
107{ 109{
108 configwindow = cw; 110 configwindow = cw;
109} 111}
110 112
113
114void Wellenreiter::channelHopped(int c)
115{
116 QString title = "Wellenreiter II -scan- [";
117 QString left;
118 if ( c > 1 ) left.fill( '.', c-1 );
119 title.append( left );
120 title.append( '|' );
121 if ( c < iface->channels() )
122 {
123 QString right;
124 right.fill( '.', iface->channels()-c );
125 title.append( right );
126 }
127 title.append( "]" );
128 //title.append( QString().sprintf( " %02d", c ) );
129 assert( parent() );
130 ( (QMainWindow*) parent() )->setCaption( title );
131}
132
133
111void Wellenreiter::receivePacket(OPacket* p) 134void Wellenreiter::receivePacket(OPacket* p)
112{ 135{
113 hexWindow()->log( p->dump( 8 ) ); 136 hexWindow()->log( p->dump( 8 ) );
@@ -186,7 +209,7 @@ void Wellenreiter::receivePacket(OPacket* p)
186 (const char*) wlan->macAddress2().toString(true), 209 (const char*) wlan->macAddress2().toString(true),
187 (const char*) wlan->macAddress1().toString(true), 210 (const char*) wlan->macAddress1().toString(true),
188 (const char*) wlan->macAddress3().toString(true) ); 211 (const char*) wlan->macAddress3().toString(true) );
189 netView()->traffic( "fromDS", wlan->macAddress2().toString(), 212 netView()->traffic( "IBSS", wlan->macAddress2().toString(),
190 wlan->macAddress1().toString(), 213 wlan->macAddress1().toString(),
191 wlan->macAddress3().toString() ); 214 wlan->macAddress3().toString() );
192 } 215 }
@@ -199,7 +222,7 @@ void Wellenreiter::startStopClicked()
199 if ( sniffing ) 222 if ( sniffing )
200 { 223 {
201 disconnect( SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); 224 disconnect( SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) );
202 225 disconnect( SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) );
203 iface->setChannelHopping(); // stop hopping channels 226 iface->setChannelHopping(); // stop hopping channels
204 pcap->close(); 227 pcap->close();
205 sniffing = false; 228 sniffing = false;
@@ -221,6 +244,8 @@ void Wellenreiter::startStopClicked()
221 244
222 system( "cardctl reset; sleep 1" ); //FIXME: Use OProcess 245 system( "cardctl reset; sleep 1" ); //FIXME: Use OProcess
223 logwindow->log( "(i) Stopped Scanning." ); 246 logwindow->log( "(i) Stopped Scanning." );
247 assert( parent() );
248 ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II" );
224 249
225 // message the user 250 // message the user
226 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." );
@@ -281,13 +306,9 @@ void Wellenreiter::startStopClicked()
281 306
282 // connect 307 // connect
283 connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); 308 connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) );
309 connect( iface->channelHopper(), SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) );
284 310
285 logwindow->log( "(i) Started Scanning." ); 311 logwindow->log( "(i) Started Scanning." );
286 #ifdef QWS
287 oApp->setTitle( "Scanning ..." );
288 #else
289 qApp->mainWidget()->setCaption( "Wellenreiter II / Scanning ..." );
290 #endif
291 sniffing = true; 312 sniffing = true;
292 313
293 } 314 }
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h
index ff73dd4..85f889b 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.h
+++ b/noncore/net/wellenreiter/gui/wellenreiter.h
@@ -48,6 +48,7 @@ class Wellenreiter : public WellenreiterBase {
48 bool isDaemonRunning() const { return sniffing; }; 48 bool isDaemonRunning() const { return sniffing; };
49 49
50 public slots: 50 public slots:
51 void channelHopped(int);
51 void receivePacket(OPacket*); 52 void receivePacket(OPacket*);
52 void startStopClicked(); 53 void startStopClicked();
53 54