author | mickeyl <mickeyl> | 2003-04-09 10:37:19 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-04-09 10:37:19 (UTC) |
commit | 73f4014f0175c77b9bff8dd06f1c034eb80442f9 (patch) (unidiff) | |
tree | e402a7229190e3af5a090b7fdeadf43b78164061 | |
parent | 5cb59a3e8abdbb05fe4bbc9e549f264153168232 (diff) | |
download | opie-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
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 37 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.h | 1 |
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 | |||
@@ -36,3 +36,3 @@ using namespace Opie; | |||
36 | #include <qspinbox.h> | 36 | #include <qspinbox.h> |
37 | #include <qsocketnotifier.h> | 37 | #include <qmainwindow.h> |
38 | 38 | ||
@@ -97,2 +97,3 @@ Wellenreiter::Wellenreiter( QWidget* parent ) | |||
97 | 97 | ||
98 | |||
98 | Wellenreiter::~Wellenreiter() | 99 | Wellenreiter::~Wellenreiter() |
@@ -105,2 +106,3 @@ Wellenreiter::~Wellenreiter() | |||
105 | 106 | ||
107 | |||
106 | void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) | 108 | void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) |
@@ -110,2 +112,23 @@ void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) | |||
110 | 112 | ||
113 | |||
114 | void 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 | |||
111 | void Wellenreiter::receivePacket(OPacket* p) | 134 | void Wellenreiter::receivePacket(OPacket* p) |
@@ -188,3 +211,3 @@ void Wellenreiter::receivePacket(OPacket* p) | |||
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(), |
@@ -201,3 +224,3 @@ void Wellenreiter::startStopClicked() | |||
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 |
@@ -223,2 +246,4 @@ void Wellenreiter::startStopClicked() | |||
223 | logwindow->log( "(i) Stopped Scanning." ); | 246 | logwindow->log( "(i) Stopped Scanning." ); |
247 | assert( parent() ); | ||
248 | ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II" ); | ||
224 | 249 | ||
@@ -283,9 +308,5 @@ void Wellenreiter::startStopClicked() | |||
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; |
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 | |||
@@ -50,2 +50,3 @@ class Wellenreiter : public WellenreiterBase { | |||
50 | public slots: | 50 | public slots: |
51 | void channelHopped(int); | ||
51 | void receivePacket(OPacket*); | 52 | void receivePacket(OPacket*); |