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) (side-by-side diff)
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;
#include <qmessagebox.h>
#include <qcombobox.h>
#include <qspinbox.h>
-#include <qsocketnotifier.h>
+#include <qmainwindow.h>
// Standard
@@ -95,6 +95,7 @@ Wellenreiter::Wellenreiter( QWidget* parent )
}
+
Wellenreiter::~Wellenreiter()
{
// no need to delete child widgets, Qt does it all for us
@@ -103,11 +104,33 @@ Wellenreiter::~Wellenreiter()
delete pcap;
}
+
void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw )
{
configwindow = cw;
}
+
+void Wellenreiter::channelHopped(int c)
+{
+ QString title = "Wellenreiter II -scan- [";
+ QString left;
+ if ( c > 1 ) left.fill( '.', c-1 );
+ title.append( left );
+ title.append( '|' );
+ if ( c < iface->channels() )
+ {
+ QString right;
+ right.fill( '.', iface->channels()-c );
+ title.append( right );
+ }
+ title.append( "]" );
+ //title.append( QString().sprintf( " %02d", c ) );
+ assert( parent() );
+ ( (QMainWindow*) parent() )->setCaption( title );
+}
+
+
void Wellenreiter::receivePacket(OPacket* p)
{
hexWindow()->log( p->dump( 8 ) );
@@ -186,7 +209,7 @@ void Wellenreiter::receivePacket(OPacket* p)
(const char*) wlan->macAddress2().toString(true),
(const char*) wlan->macAddress1().toString(true),
(const char*) wlan->macAddress3().toString(true) );
- netView()->traffic( "fromDS", wlan->macAddress2().toString(),
+ netView()->traffic( "IBSS", wlan->macAddress2().toString(),
wlan->macAddress1().toString(),
wlan->macAddress3().toString() );
}
@@ -199,7 +222,7 @@ void Wellenreiter::startStopClicked()
if ( sniffing )
{
disconnect( SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) );
-
+ disconnect( SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) );
iface->setChannelHopping(); // stop hopping channels
pcap->close();
sniffing = false;
@@ -221,6 +244,8 @@ void Wellenreiter::startStopClicked()
system( "cardctl reset; sleep 1" ); //FIXME: Use OProcess
logwindow->log( "(i) Stopped Scanning." );
+ assert( parent() );
+ ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II" );
// message the user
QMessageBox::information( this, "Wellenreiter II", "Your wireless card\nshould now be usable again." );
@@ -281,13 +306,9 @@ void Wellenreiter::startStopClicked()
// connect
connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) );
+ connect( iface->channelHopper(), SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) );
logwindow->log( "(i) Started Scanning." );
- #ifdef QWS
- oApp->setTitle( "Scanning ..." );
- #else
- qApp->mainWidget()->setCaption( "Wellenreiter II / Scanning ..." );
- #endif
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
@@ -48,6 +48,7 @@ class Wellenreiter : public WellenreiterBase {
bool isDaemonRunning() const { return sniffing; };
public slots:
+ void channelHopped(int);
void receivePacket(OPacket*);
void startStopClicked();