author | mickeyl <mickeyl> | 2004-01-07 23:04:55 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-01-07 23:04:55 (UTC) |
commit | cfb7335c5b65a79f5817b393e5a8b3345558f220 (patch) (side-by-side diff) | |
tree | a8d2d2bcc0bd29a6aac7fec7325f058f148d466e | |
parent | c4d6574e85f74d6086c1709ecf0d117df7417222 (diff) | |
download | opie-cfb7335c5b65a79f5817b393e5a8b3345558f220.zip opie-cfb7335c5b65a79f5817b393e5a8b3345558f220.tar.gz opie-cfb7335c5b65a79f5817b393e5a8b3345558f220.tar.bz2 |
A bunch of miscellaneous changes and improvements. read the ChangeLog :)
Oh and it's WIP - not everything mentioned there works already. Will soon, though.
-rw-r--r-- | noncore/net/wellenreiter/ChangeLog | 5 | ||||
-rw-r--r-- | noncore/net/wellenreiter/TODO | 5 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/configbase.ui | 223 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/configwindow.cpp | 103 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/configwindow.h | 7 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/gps.cpp | 8 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.cpp | 20 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.h | 3 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 8 | ||||
-rw-r--r-- | noncore/net/wellenreiter/opie-wellenreiter.control | 2 |
10 files changed, 325 insertions, 59 deletions
diff --git a/noncore/net/wellenreiter/ChangeLog b/noncore/net/wellenreiter/ChangeLog index 8bf8cc8..d4dca9f 100644 --- a/noncore/net/wellenreiter/ChangeLog +++ b/noncore/net/wellenreiter/ChangeLog @@ -2,2 +2,7 @@ + * Rewrote the simple actions on new {Network, Client, Station}. Besides playing a sound or + blinking a LED, a user customizable script can now be executed, if something has been + detected. This opens up many possibilities, i.e. a qcop to qpegps or exec'ing Flite. + * Added decloaking of cloaked ESSIDs (length != 0, but essid[0] == \0) + * Hided the 'Parse' Tab in the configuration window. Not functional now and may come later * Added parsing of control frames. Display stations sending them SSID "???" for now. diff --git a/noncore/net/wellenreiter/TODO b/noncore/net/wellenreiter/TODO index ff98eaf..ab171c8 100644 --- a/noncore/net/wellenreiter/TODO +++ b/noncore/net/wellenreiter/TODO @@ -10,3 +10,3 @@ -- decloaking of falsely reported zero-length SSIDs +- decloaking of falsely reported SSIDs [done] @@ -35 +35,4 @@ - revamp hex window, make it more sophisticated than just a QMultiLineEdit + +- write kismet-like .network format and format to be importable into AutoRoute + diff --git a/noncore/net/wellenreiter/gui/configbase.ui b/noncore/net/wellenreiter/gui/configbase.ui index 2c335df..de6abfc 100644 --- a/noncore/net/wellenreiter/gui/configbase.ui +++ b/noncore/net/wellenreiter/gui/configbase.ui @@ -13,4 +13,4 @@ <y>0</y> - <width>303</width> - <height>343</height> + <width>250</width> + <height>371</height> </rect> @@ -708,3 +708,3 @@ <name>margin</name> - <number>6</number> + <number>5</number> </property> @@ -712,3 +712,3 @@ <name>spacing</name> - <number>6</number> + <number>3</number> </property> @@ -776,3 +776,3 @@ <name>enabled</name> - <bool>false</bool> + <bool>true</bool> </property> @@ -780,3 +780,9 @@ <name>title</name> - <string>Action On Detecting</string> + <string>Action on detecting a new</string> + </property> + <property> + <name>layoutMargin</name> + </property> + <property> + <name>layoutSpacing</name> </property> @@ -785,3 +791,3 @@ <name>margin</name> - <number>11</number> + <number>3</number> </property> @@ -789,5 +795,26 @@ <name>spacing</name> - <number>6</number> + <number>0</number> </property> - <widget row="1" column="0" > + <widget row="0" column="0" > + <class>QLayoutWidget</class> + <property stdset="1"> + <name>name</name> + <cstring>Layout6</cstring> + </property> + <property> + <name>layoutMargin</name> + </property> + <property> + <name>layoutSpacing</name> + </property> + <grid> + <property stdset="1"> + <name>margin</name> + <number>2</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>2</number> + </property> + <widget row="4" column="0" > <class>QLabel</class> @@ -795,3 +822,3 @@ <name>name</name> - <cstring>TextLabel2</cstring> + <cstring>TextLabel3</cstring> </property> @@ -799,3 +826,3 @@ <name>text</name> - <string>New Wireless Station</string> + <string>Wired Station:</string> </property> @@ -810,37 +837,187 @@ <name>text</name> - <string>New Network</string> + <string>Network:</string> </property> </widget> - <widget row="0" column="1" > + <widget row="2" column="1" > <class>QComboBox</class> + <item> + <property> + <name>text</name> + <string><Ignore></string> + </property> + </item> + <item> + <property> + <name>text</name> + <string>Play Alarm</string> + </property> + </item> + <item> + <property> + <name>text</name> + <string>Play Click</string> + </property> + </item> + <item> + <property> + <name>text</name> + <string>Blink LED</string> + </property> + </item> + <item> + <property> + <name>text</name> + <string>Run Script</string> + </property> + </item> + <property stdset="1"> + <name>name</name> + <cstring>newClientAction</cstring> + </property> + <property stdset="1"> + <name>sizePolicy</name> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>0</vsizetype> + </sizepolicy> + </property> + </widget> + <widget row="3" column="0" rowspan="1" colspan="2" > + <class>QLineEdit</class> <property stdset="1"> <name>name</name> - <cstring>newNetwork</cstring> + <cstring>newClientScript</cstring> + </property> + <property stdset="1"> + <name>enabled</name> + <bool>true</bool> </property> </widget> - <widget row="1" column="1" > + <widget row="2" column="0" > + <class>QLabel</class> + <property stdset="1"> + <name>name</name> + <cstring>TextLabel2</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Wireless Station:</string> + </property> + </widget> + <widget row="4" column="1" > <class>QComboBox</class> + <item> + <property> + <name>text</name> + <string><Ignore></string> + </property> + </item> + <item> + <property> + <name>text</name> + <string>Play Alarm</string> + </property> + </item> + <item> + <property> + <name>text</name> + <string>Play Click</string> + </property> + </item> + <item> + <property> + <name>text</name> + <string>Blink LED</string> + </property> + </item> + <item> + <property> + <name>text</name> + <string>Run Script</string> + </property> + </item> <property stdset="1"> <name>name</name> - <cstring>newWirelessStation</cstring> + <cstring>newStationAction</cstring> + </property> + <property stdset="1"> + <name>sizePolicy</name> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>0</vsizetype> + </sizepolicy> </property> </widget> - <widget row="2" column="1" > + <widget row="0" column="1" > <class>QComboBox</class> + <item> + <property> + <name>text</name> + <string><Ignore></string> + </property> + </item> + <item> + <property> + <name>text</name> + <string>Play Alarm</string> + </property> + </item> + <item> + <property> + <name>text</name> + <string>Play Click</string> + </property> + </item> + <item> + <property> + <name>text</name> + <string>Blink LED</string> + </property> + </item> + <item> + <property> + <name>text</name> + <string>Run Script</string> + </property> + </item> <property stdset="1"> <name>name</name> - <cstring>newStation</cstring> + <cstring>newNetworkAction</cstring> + </property> + <property stdset="1"> + <name>sizePolicy</name> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>0</vsizetype> + </sizepolicy> + </property> + <property stdset="1"> + <name>editable</name> + <bool>false</bool> </property> </widget> - <widget row="2" column="0" > - <class>QLabel</class> + <widget row="1" column="0" rowspan="1" colspan="2" > + <class>QLineEdit</class> <property stdset="1"> <name>name</name> - <cstring>TextLabel3</cstring> + <cstring>newNetworkScript</cstring> </property> <property stdset="1"> - <name>text</name> - <string>New Station</string> + <name>enabled</name> + <bool>true</bool> </property> </widget> + <widget row="5" column="0" rowspan="1" colspan="2" > + <class>QLineEdit</class> + <property stdset="1"> + <name>name</name> + <cstring>newStationScript</cstring> + </property> + <property stdset="1"> + <name>enabled</name> + <bool>true</bool> + </property> + </widget> + </grid> + </widget> </grid> diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp index f536f4e..1341d03 100644 --- a/noncore/net/wellenreiter/gui/configwindow.cpp +++ b/noncore/net/wellenreiter/gui/configwindow.cpp @@ -19,2 +19,9 @@ +/* OPIE */ +#include <opie2/onetwork.h> +#ifdef QWS +#include <opie2/oapplication.h> +#include <opie2/oconfig.h> +#endif + /* QT */ @@ -28,2 +35,3 @@ #include <qpushbutton.h> +#include <qtabwidget.h> #include <qtoolbutton.h> @@ -32,9 +40,2 @@ -/* OPIE */ -#include <opie2/onetwork.h> - -#ifdef QWS -#include <opie2/oapplication.h> -#include <opie2/oconfig.h> -#endif @@ -74,2 +75,5 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char connect( deviceType, SIGNAL( activated(int) ), this, SLOT( changedDeviceType(int) ) ); + connect( newNetworkAction, SIGNAL( activated(int) ), this, SLOT( changedNetworkAction(int) ) ); + connect( newClientAction, SIGNAL( activated(int) ), this, SLOT( changedClientAction(int) ) ); + connect( newStationAction, SIGNAL( activated(int) ), this, SLOT( changedStationAction(int) ) ); connect( getCaptureFileName, SIGNAL( clicked() ), this, SLOT( getCaptureFileNameClicked() ) ); @@ -80,2 +84,5 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char connect( autodetect, SIGNAL( clicked() ), this, SLOT( performAutodetection() ) ); + + // hide tab4 (parse) until Wellenreiter 1.2 + tab->removePage( tab_4 ); }; @@ -187,2 +194,32 @@ void WellenreiterConfigWindow::changedDeviceType(int t) +void WellenreiterConfigWindow::synchronizeActionsAndScripts() +{ + if ( newNetworkAction->currentItem() == 4 ) newNetworkScript->show(); else newNetworkScript->hide(); + if ( newClientAction->currentItem() == 4 ) newClientScript->show(); else newClientScript->hide(); + if ( newStationAction->currentItem() == 4 ) newStationScript->show(); else newStationScript->hide(); + + //newNetworkScript->setEnabled( newNetworkAction->currentItem() == 4 ); + //newClientScript->setEnabled( newClientAction->currentItem() == 4 ); + //newStationScript->setEnabled( newStationAction->currentItem() == 4 ); +} + + +void WellenreiterConfigWindow::changedNetworkAction(int t) +{ + synchronizeActionsAndScripts(); +} + + +void WellenreiterConfigWindow::changedClientAction(int t) +{ + synchronizeActionsAndScripts(); +} + + +void WellenreiterConfigWindow::changedStationAction(int t) +{ + synchronizeActionsAndScripts(); +} + + void WellenreiterConfigWindow::getCaptureFileNameClicked() @@ -237,2 +274,41 @@ int WellenreiterConfigWindow::gpsPort() const +void WellenreiterConfigWindow::performAction( const QString& type ) +{ + int action; + QString script; + + if ( type == "network" ) + { + action = newNetworkAction->currentItem(); + script = newNetworkScript->text(); + } + else if ( type == "managed" || type == "adhoc" ) + { + action = newClientAction->currentItem(); + script = newClientScript->text(); + } + else if ( type == "station" ) + { + action = newStationAction->currentItem(); + script = newStationScript->text(); + } + else + { + qWarning( "WellenreiterConfigWindow::performAction(): unknown type '%s'", (const char*) type ); + return; + } + + qDebug( "going to perform action %d (script='%s')", action, (const char*) script ); + + /* + + if ( sound == "Ignore" ) return; + else if ( sound == "Touch" ) ODevice::inst()->touchSound(); + else if ( sound == "Key" ) ODevice::inst()->keySound(); + else if ( sound == "Alarm" ) ODevice::inst()->alarmSound(); + + */ +} + + void WellenreiterConfigWindow::load() @@ -292,2 +368,9 @@ void WellenreiterConfigWindow::load() disablePM->setChecked( c->readBoolEntry( "disablePM", true ) ); + newNetworkAction->setCurrentItem( c->readNumEntry( "newNetworkAction", 0 ) ); + newNetworkScript->setText( c->readEntry( "newNetworkScript", "" ) ); + newClientAction->setCurrentItem( c->readNumEntry( "newClientAction", 0 ) ); + newClientScript->setText( c->readEntry( "newClientScript", "" ) ); + newStationAction->setCurrentItem( c->readNumEntry( "newStationAction", 0 ) ); + newStationScript->setText( c->readEntry( "newStationScript", "" ) ); + synchronizeActionsAndScripts(); // needed for showing/hiding the script QLineEdit on demand @@ -335,2 +418,8 @@ void WellenreiterConfigWindow::save() c->writeEntry( "disablePM", disablePM->isChecked() ); + c->writeEntry( "newNetworkAction", newNetworkAction->currentItem() ); + c->writeEntry( "newNetworkScript", newNetworkScript->text() ); + c->writeEntry( "newClientAction", newClientAction->currentItem() ); + c->writeEntry( "newClientScript", newClientScript->text() ); + c->writeEntry( "newStationAction", newStationAction->currentItem() ); + c->writeEntry( "newStationScript", newStationScript->text() ); diff --git a/noncore/net/wellenreiter/gui/configwindow.h b/noncore/net/wellenreiter/gui/configwindow.h index 80b4d2b..b082331 100644 --- a/noncore/net/wellenreiter/gui/configwindow.h +++ b/noncore/net/wellenreiter/gui/configwindow.h @@ -59,2 +59,5 @@ class WellenreiterConfigWindow : public WellenreiterConfigBase void changedDeviceType(int); + void changedNetworkAction(int t); + void changedClientAction(int t); + void changedStationAction(int t); void getCaptureFileNameClicked(); @@ -62,2 +65,6 @@ class WellenreiterConfigWindow : public WellenreiterConfigBase void channelAllClicked(int); + void performAction( const QString& ); + + protected: + void synchronizeActionsAndScripts(); diff --git a/noncore/net/wellenreiter/gui/gps.cpp b/noncore/net/wellenreiter/gui/gps.cpp index 31f95ce..b814427 100644 --- a/noncore/net/wellenreiter/gui/gps.cpp +++ b/noncore/net/wellenreiter/gui/gps.cpp @@ -60,6 +60,6 @@ GpsLocation GPS::position() const stream.readRawBytes( &buf[0], 7 ); - float lat = -111.111; + float lat = -111; stream >> lat; stream.skipWhiteSpace(); - float lon = -111.111; + float lon = -111; stream >> lon; @@ -70,3 +70,3 @@ GpsLocation GPS::position() const } - return GpsLocation( -111.111, -111.111 ); + return GpsLocation( -111, -111 ); } @@ -76,3 +76,3 @@ QString GpsLocation::dmsPosition() const { - if ( _latitude == -111.111 || _longitude == -111.11 ) + if ( _latitude == -111 || _longitude == -111 ) return "N/A"; diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp index d89c71f..470646d 100644 --- a/noncore/net/wellenreiter/gui/scanlist.cpp +++ b/noncore/net/wellenreiter/gui/scanlist.cpp @@ -28,7 +28,4 @@ #include <qpe/qpeapplication.h> -#include <opie/odevice.h> -using namespace Opie; #endif - #ifdef QWS @@ -423,4 +420,6 @@ MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QS #endif - if ( WellenreiterConfigWindow::instance() && type == "network" ) - playSound( WellenreiterConfigWindow::instance()->soundOnNetwork() ); + + if ( WellenreiterConfigWindow::instance() ) + WellenreiterConfigWindow::instance()->performAction( type ); // better use signal/slot combination here + decorateItem( type, essid, macaddr, wep, channel, signal ); @@ -541,13 +540,2 @@ void MScanListItem::setLocation( const QString& location ) -void MScanListItem::playSound( const QString& sound ) const -{ - #ifdef QWS - if ( sound == "Ignore" ) return; - else if ( sound == "Touch" ) ODevice::inst()->touchSound(); - else if ( sound == "Key" ) ODevice::inst()->keySound(); - else if ( sound == "Alarm" ) ODevice::inst()->alarmSound(); - #endif -} - - void MScanListItem::receivedBeacon() diff --git a/noncore/net/wellenreiter/gui/scanlist.h b/noncore/net/wellenreiter/gui/scanlist.h index 6cd8fc0..42f35c2 100644 --- a/noncore/net/wellenreiter/gui/scanlist.h +++ b/noncore/net/wellenreiter/gui/scanlist.h @@ -111,5 +111,2 @@ class MScanListItem: public OListViewItem - protected: - void playSound( const QString& ) const; - private: diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 45d7142..25632f3 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -183,3 +183,3 @@ void Wellenreiter::handleManagementFrame( OPacket* p, OWaveLanManagementPacket* OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); - QString essid = ssid ? ssid->ID() : QString("<unknown>"); + QString essid = ssid ? ssid->ID( true /* decloak */ ) : QString("<unknown>"); OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) ); @@ -189,3 +189,3 @@ void Wellenreiter::handleManagementFrame( OPacket* p, OWaveLanManagementPacket* - GpsLocation loc( -111.111, -111.111 ); + GpsLocation loc( -111, -111 ); if ( configwindow->enableGPS->isChecked() ) @@ -218,3 +218,3 @@ void Wellenreiter::handleControlFrame( OPacket* p, OWaveLanControlPacket* contro { - netView()->addNewItem( "adhoc", "???", header->macAddress1(), false, -1, 0, GpsLocation( -111.111, -111.111 ) ); + netView()->addNewItem( "adhoc", "???", header->macAddress1(), false, -1, 0, GpsLocation( -111, -111 ) ); } @@ -262,3 +262,3 @@ void Wellenreiter::handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAd - netView()->addNewItem( "station", "<wired>", from, false, -1, 0, GpsLocation( -111.111, -111.111 ) ); + netView()->addNewItem( "station", "<wired>", from, false, -1, 0, GpsLocation( -111, -111 ) ); } diff --git a/noncore/net/wellenreiter/opie-wellenreiter.control b/noncore/net/wellenreiter/opie-wellenreiter.control index 18bac98..1d8c482 100644 --- a/noncore/net/wellenreiter/opie-wellenreiter.control +++ b/noncore/net/wellenreiter/opie-wellenreiter.control @@ -7,3 +7,3 @@ Architecture: arm Version: 1.0.2-$SUB_VERSION -Depends: libqpe1, libpcap0 (0.7.2), libopiecore2, libopienet2, libopieui2 +Depends: libqpe1, libpcap0 (0.7.2), libopiecore2, libopienet2 (>=1.8.3), libopieui2 Description: A WaveLAN Network Monitor |