author | mickeyl <mickeyl> | 2002-12-16 23:38:55 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2002-12-16 23:38:55 (UTC) |
commit | 3f28b7e0edb6115699b19f9db37b55f775b91dc7 (patch) (side-by-side diff) | |
tree | 6cfcd1e3175c5a2e02e00851803a24280bc1ac32 | |
parent | 9cb9007f211c22349e3183ba20bb7f817d811005 (diff) | |
download | opie-3f28b7e0edb6115699b19f9db37b55f775b91dc7.zip opie-3f28b7e0edb6115699b19f9db37b55f775b91dc7.tar.gz opie-3f28b7e0edb6115699b19f9db37b55f775b91dc7.tar.bz2 |
- updates to the config window
- GUI now starts channelhopper and sniffer using the command line interface
-rw-r--r-- | noncore/net/wellenreiter/gui/configbase.ui | 80 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/configwindow.h | 1 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 78 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.h | 2 |
4 files changed, 141 insertions, 20 deletions
diff --git a/noncore/net/wellenreiter/gui/configbase.ui b/noncore/net/wellenreiter/gui/configbase.ui index 57ffd2a..e2f734a 100644 --- a/noncore/net/wellenreiter/gui/configbase.ui +++ b/noncore/net/wellenreiter/gui/configbase.ui @@ -13,4 +13,4 @@ <y>0</y> - <width>240</width> - <height>276</height> + <width>232</width> + <height>267</height> </rect> @@ -21,2 +21,8 @@ </property> + <property> + <name>layoutMargin</name> + </property> + <property> + <name>layoutSpacing</name> + </property> <vbox> @@ -24,3 +30,3 @@ <name>margin</name> - <number>11</number> + <number>4</number> </property> @@ -28,3 +34,3 @@ <name>spacing</name> - <number>6</number> + <number>0</number> </property> @@ -36,2 +42,5 @@ </property> + <property> + <name>layoutSpacing</name> + </property> <hbox> @@ -43,3 +52,3 @@ <name>spacing</name> - <number>6</number> + <number>2</number> </property> @@ -82,2 +91,5 @@ </property> + <property> + <name>layoutSpacing</name> + </property> <grid> @@ -89,3 +101,3 @@ <name>spacing</name> - <number>6</number> + <number>2</number> </property> @@ -141,3 +153,3 @@ <name>enabled</name> - <bool>false</bool> + <bool>true</bool> </property> @@ -197,3 +209,3 @@ <name>enabled</name> - <bool>false</bool> + <bool>true</bool> </property> @@ -223,3 +235,3 @@ <name>enabled</name> - <bool>false</bool> + <bool>true</bool> </property> @@ -250,3 +262,3 @@ <name>enabled</name> - <bool>false</bool> + <bool>true</bool> </property> @@ -265,3 +277,3 @@ <name>enabled</name> - <bool>false</bool> + <bool>true</bool> </property> @@ -280,3 +292,3 @@ <name>enabled</name> - <bool>false</bool> + <bool>true</bool> </property> @@ -295,2 +307,5 @@ </property> + <property> + <name>layoutSpacing</name> + </property> <hbox> @@ -302,3 +317,3 @@ <name>spacing</name> - <number>6</number> + <number>2</number> </property> @@ -339,3 +354,6 @@ <name>name</name> - <cstring>Layout8</cstring> + <cstring>Layout5</cstring> + </property> + <property> + <name>layoutSpacing</name> </property> @@ -348,3 +366,3 @@ <name>spacing</name> - <number>6</number> + <number>-1</number> </property> @@ -380,4 +398,36 @@ </widget> + <widget> + <class>QCheckBox</class> + <property stdset="1"> + <name>name</name> + <cstring>beepOnFound</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Beep on new network</string> + </property> + </widget> </vbox> </widget> + <spacer> + <property> + <name>name</name> + <cstring>Spacer2</cstring> + </property> + <property stdset="1"> + <name>orientation</name> + <enum>Vertical</enum> + </property> + <property stdset="1"> + <name>sizeType</name> + <enum>Expanding</enum> + </property> + <property> + <name>sizeHint</name> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> </vbox> diff --git a/noncore/net/wellenreiter/gui/configwindow.h b/noncore/net/wellenreiter/gui/configwindow.h index 759d46d..c2db283 100644 --- a/noncore/net/wellenreiter/gui/configwindow.h +++ b/noncore/net/wellenreiter/gui/configwindow.h @@ -26,2 +26,3 @@ class WellenreiterConfigWindow : public WellenreiterConfigBase + }; diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 5808e9c..764ef34 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -18,2 +18,11 @@ #include <qpushbutton.h> +#include <qmessagebox.h> +#include <qcombobox.h> +#include <qspinbox.h> + +// Qtopia + +#ifdef QWS +#include <qpe/global.h> +#endif @@ -26,2 +35,3 @@ #include <sys/types.h> +#include <stdlib.h> @@ -33,2 +43,3 @@ #include "hexwindow.h" +#include "configwindow.h" @@ -39,3 +50,3 @@ Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) - : WellenreiterBase( parent, name, fl ) + : WellenreiterBase( parent, name, fl ), daemonRunning( false ) { @@ -151,6 +162,6 @@ void Wellenreiter::timerEvent( QTimerEvent* e ) { - qDebug( "checking for message..." ); + //qDebug( "checking for message..." ); if ( hasMessage() ) { - qDebug( "got message" ); + //qDebug( "got message from daemon" ); handleMessage(); @@ -159,3 +170,3 @@ void Wellenreiter::timerEvent( QTimerEvent* e ) { - qDebug( "no message..." ); + //qDebug( "no message..." ); } @@ -239,7 +250,62 @@ void Wellenreiter::buttonClicked() { + if ( daemonRunning ) + { + logwindow->log( "(i) Daemon has been stopped." ); + button->setText( "Start Scanning" ); + + // Stop daemon + + // find out pids of wellenreiterd and orinoco_hopper + + } + + else + { + + // get configuration from config window - // FIXME: communicate with daemon and set button text according to state + const QString& interface = configwindow->interfaceName->currentText(); + const QString& cardtype = configwindow->deviceType->currentText(); + const QString& interval = configwindow->hopInterval->cleanText(); + if ( ( interface == "<select>" ) || ( cardtype == "<select>" ) ) + { + QMessageBox::information( this, "Wellenreiter/Opie", "You must configure your\ndevice before scanning." ); + return; + } + + logwindow->log( "(i) Daemon has been started." ); button->setText( "Stop Scanning" ); +#ifdef QWS + + // set interface into monitor mode + + QString cmdline; + + cmdline.sprintf( "iwpriv %s monitor 2", (const char*) interface ); + system( cmdline ); + cmdline.sprintf( "iwpriv %s monitor 2 1", (const char*) interface ); + system( cmdline ); + + // start channel hopper + + cmdline = "orinoco_hopper "; + cmdline += interface; + cmdline += " -i "; + cmdline += interval; + //qDebug( "execute: %s", (const char*) cmdline ); + Global::execute( cmdline ); + + // start daemon + + cmdline = "wellenreiterd "; + cmdline += interface; + cmdline += " 3"; + //qDebug( "execute: %s", (const char*) cmdline ); + Global::execute( cmdline ); +#endif + + /* + // add some test stations, so that we can see if the GUI part works @@ -256,2 +322,4 @@ void Wellenreiter::buttonClicked() + */ + } } diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h index 61f7503..052a242 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.h +++ b/noncore/net/wellenreiter/gui/wellenreiter.h @@ -33,2 +33,4 @@ protected: + bool daemonRunning; + public slots: |