author | mickeyl <mickeyl> | 2003-12-09 19:24:37 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-12-09 19:24:37 (UTC) |
commit | 04d6caa37743a1957b9ffa061a58a71a3909ea3d (patch) (side-by-side diff) | |
tree | 04a692f57263d0573f2b2c704e4a6e1057aa7d40 | |
parent | 1642df2b072858b5eec9ad007a23475cc5270bfe (diff) | |
download | opie-04d6caa37743a1957b9ffa061a58a71a3909ea3d.zip opie-04d6caa37743a1957b9ffa061a58a71a3909ea3d.tar.gz opie-04d6caa37743a1957b9ffa061a58a71a3909ea3d.tar.bz2 |
preload the manufacturer library during startup (nice trick, btw.)
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 12 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 365efb0..1d4a98b 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -25,46 +25,48 @@ #include "graphwindow.h" #include "protolistview.h" // Opie #ifdef QWS #include <opie/odevice.h> #include <qpe/qcopenvelope_qws.h> using namespace Opie; #endif #ifdef QWS #include <opie2/oapplication.h> #else #include <qapplication.h> #endif +#include <opie2/omanufacturerdb.h> #include <opie2/onetwork.h> #include <opie2/opcap.h> // Qt #include <qcheckbox.h> #include <qcombobox.h> #include <qdatetime.h> #include <qpushbutton.h> #include <qlineedit.h> #include <qmessagebox.h> #include <qobjectlist.h> #include <qregexp.h> #include <qspinbox.h> +#include <qtimer.h> #include <qtoolbutton.h> #include <qmainwindow.h> // Standard #include <assert.h> #include <errno.h> #include <unistd.h> #include <string.h> #include <sys/types.h> #include <stdlib.h> Wellenreiter::Wellenreiter( QWidget* parent ) : WellenreiterBase( parent, 0, 0 ), sniffing( false ), iface( 0 ), configwindow( 0 ) { @@ -75,41 +77,51 @@ Wellenreiter::Wellenreiter( QWidget* parent ) // detect operating system // #ifdef QWS QString sys; sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() ); _system = ODevice::inst()->system(); logwindow->log( sys ); #endif netview->setColumnWidthMode( 1, QListView::Manual ); connect( netview, SIGNAL( joinNetwork(const QString&,const QString&,int,const QString&) ), this, SLOT( joinNetwork(const QString&,const QString&,int,const QString&) ) ); pcap = new OPacketCapturer(); gps = new GPS( this ); + + QTimer::singleShot( 1000, this, SLOT( initialTimer() ) ); + } Wellenreiter::~Wellenreiter() { delete pcap; } +void Wellenreiter::initialTimer() +{ + qDebug( "Wellenreiter::preloading manufacturer database..." ); + OManufacturerDB::instance(); +} + + 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; diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h index 25a5e8d..d882500 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.h +++ b/noncore/net/wellenreiter/gui/wellenreiter.h @@ -46,32 +46,34 @@ class Wellenreiter : public WellenreiterBase { Wellenreiter( QWidget* parent = 0 ); ~Wellenreiter(); void setConfigWindow( WellenreiterConfigWindow* cw ); MScanListView* netView() const { return netview; }; MLogWindow* logWindow() const { return logwindow; }; MHexWindow* hexWindow() const { return hexwindow; }; bool isDaemonRunning() const { return sniffing; }; public: bool sniffing; protected: virtual void timerEvent( QTimerEvent* ); public slots: + void initialTimer(); + void channelHopped(int); void receivePacket(OPacket*); void startClicked(); void stopClicked(); void joinNetwork(const QString&,const QString&,int,const QString&); signals: void startedSniffing(); void stoppedSniffing(); private: void handleBeacon( OPacket* p, OWaveLanManagementPacket* beacon ); void handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to ); void handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAddress& from, OMacAddress& to ); void handleARPData( OPacket* p, OARPPacket* arp, OMacAddress& from, OMacAddress& to ); |