summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/ChangeLog5
-rw-r--r--noncore/net/wellenreiter/TODO5
-rw-r--r--noncore/net/wellenreiter/gui/configbase.ui287
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.cpp103
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.h7
-rw-r--r--noncore/net/wellenreiter/gui/gps.cpp8
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp20
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.h3
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp8
-rw-r--r--noncore/net/wellenreiter/opie-wellenreiter.control2
10 files changed, 357 insertions, 91 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
@@ -1,8 +1,13 @@
1 2004-??-?? Michael Lauer <mickey@Vanille.de> 1 2004-??-?? Michael Lauer <mickey@Vanille.de>
2 2
3 * Rewrote the simple actions on new {Network, Client, Station}. Besides playing a sound or
4 blinking a LED, a user customizable script can now be executed, if something has been
5 detected. This opens up many possibilities, i.e. a qcop to qpegps or exec'ing Flite.
6 * Added decloaking of cloaked ESSIDs (length != 0, but essid[0] == \0)
7 * Hided the 'Parse' Tab in the configuration window. Not functional now and may come later
3 * Added parsing of control frames. Display stations sending them SSID "???" for now. 8 * Added parsing of control frames. Display stations sending them SSID "???" for now.
4 * Added command line option "-nocheck" to skip non-root and dhcp tests 9 * Added command line option "-nocheck" to skip non-root and dhcp tests
5 * Improved the speed reading the manufacturer list 10 * Improved the speed reading the manufacturer list
6 * GPS coordinates are now presented in the DMS (as opposed to decimal) format 11 * GPS coordinates are now presented in the DMS (as opposed to decimal) format
7 12
8 2003-12-18 Michael Lauer <mickey@Vanille.de> 13 2003-12-18 Michael Lauer <mickey@Vanille.de>
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
@@ -5,13 +5,13 @@
5- implement beacon stripping (the first beacon is enough to detect a 5- implement beacon stripping (the first beacon is enough to detect a
6 new network - further beacons just blow up the capture file) 6 new network - further beacons just blow up the capture file)
7 7
8- identification of probe requests 8- identification of probe requests
9 i.e. other sniffers around 9 i.e. other sniffers around
10 10
11- decloaking of falsely reported zero-length SSIDs 11- decloaking of falsely reported SSIDs [done]
12 12
13- option to launch an external application (i.e. qcop) on 13- option to launch an external application (i.e. qcop) on
14 - new net 14 - new net
15 - new station 15 - new station
16 - <whatever> event 16 - <whatever> event
17 17
@@ -30,6 +30,9 @@
30 the actual parsing code (hmmm) 30 the actual parsing code (hmmm)
31 31
32- pester the ethereal folks to settle for an application independant 32- pester the ethereal folks to settle for an application independant
33 packet dissection framework... (unlikely) 33 packet dissection framework... (unlikely)
34 34
35- revamp hex window, make it more sophisticated than just a QMultiLineEdit 35- revamp hex window, make it more sophisticated than just a QMultiLineEdit
36
37- write kismet-like .network format and format to be importable into AutoRoute
38
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
@@ -8,14 +8,14 @@
8 </property> 8 </property>
9 <property stdset="1"> 9 <property stdset="1">
10 <name>geometry</name> 10 <name>geometry</name>
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>303</width> 14 <width>250</width>
15 <height>343</height> 15 <height>371</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
19 <name>caption</name> 19 <name>caption</name>
20 <string>Wellenreiter II COnfiguration Dialog</string> 20 <string>Wellenreiter II COnfiguration Dialog</string>
21 </property> 21 </property>
@@ -703,17 +703,17 @@
703 <name>title</name> 703 <name>title</name>
704 <string>UI</string> 704 <string>UI</string>
705 </attribute> 705 </attribute>
706 <vbox> 706 <vbox>
707 <property stdset="1"> 707 <property stdset="1">
708 <name>margin</name> 708 <name>margin</name>
709 <number>6</number> 709 <number>5</number>
710 </property> 710 </property>
711 <property stdset="1"> 711 <property stdset="1">
712 <name>spacing</name> 712 <name>spacing</name>
713 <number>6</number> 713 <number>3</number>
714 </property> 714 </property>
715 <widget> 715 <widget>
716 <class>QCheckBox</class> 716 <class>QCheckBox</class>
717 <property stdset="1"> 717 <property stdset="1">
718 <name>name</name> 718 <name>name</name>
719 <cstring>lookupVendor</cstring> 719 <cstring>lookupVendor</cstring>
@@ -771,80 +771,257 @@
771 <property stdset="1"> 771 <property stdset="1">
772 <name>name</name> 772 <name>name</name>
773 <cstring>GroupBox4_2</cstring> 773 <cstring>GroupBox4_2</cstring>
774 </property> 774 </property>
775 <property stdset="1"> 775 <property stdset="1">
776 <name>enabled</name> 776 <name>enabled</name>
777 <bool>false</bool> 777 <bool>true</bool>
778 </property> 778 </property>
779 <property stdset="1"> 779 <property stdset="1">
780 <name>title</name> 780 <name>title</name>
781 <string>Action On Detecting</string> 781 <string>Action on detecting a new</string>
782 </property>
783 <property>
784 <name>layoutMargin</name>
785 </property>
786 <property>
787 <name>layoutSpacing</name>
782 </property> 788 </property>
783 <grid> 789 <grid>
784 <property stdset="1"> 790 <property stdset="1">
785 <name>margin</name> 791 <name>margin</name>
786 <number>11</number> 792 <number>3</number>
787 </property> 793 </property>
788 <property stdset="1"> 794 <property stdset="1">
789 <name>spacing</name> 795 <name>spacing</name>
790 <number>6</number> 796 <number>0</number>
791 </property> 797 </property>
792 <widget row="1" column="0" >
793 <class>QLabel</class>
794 <property stdset="1">
795 <name>name</name>
796 <cstring>TextLabel2</cstring>
797 </property>
798 <property stdset="1">
799 <name>text</name>
800 <string>New Wireless Station</string>
801 </property>
802 </widget>
803 <widget row="0" column="0" > 798 <widget row="0" column="0" >
804 <class>QLabel</class> 799 <class>QLayoutWidget</class>
805 <property stdset="1">
806 <name>name</name>
807 <cstring>TextLabel1_3</cstring>
808 </property>
809 <property stdset="1">
810 <name>text</name>
811 <string>New Network</string>
812 </property>
813 </widget>
814 <widget row="0" column="1" >
815 <class>QComboBox</class>
816 <property stdset="1">
817 <name>name</name>
818 <cstring>newNetwork</cstring>
819 </property>
820 </widget>
821 <widget row="1" column="1" >
822 <class>QComboBox</class>
823 <property stdset="1">
824 <name>name</name>
825 <cstring>newWirelessStation</cstring>
826 </property>
827 </widget>
828 <widget row="2" column="1" >
829 <class>QComboBox</class>
830 <property stdset="1"> 800 <property stdset="1">
831 <name>name</name> 801 <name>name</name>
832 <cstring>newStation</cstring> 802 <cstring>Layout6</cstring>
833 </property> 803 </property>
834 </widget> 804 <property>
835 <widget row="2" column="0" > 805 <name>layoutMargin</name>
836 <class>QLabel</class>
837 <property stdset="1">
838 <name>name</name>
839 <cstring>TextLabel3</cstring>
840 </property> 806 </property>
841 <property stdset="1"> 807 <property>
842 <name>text</name> 808 <name>layoutSpacing</name>
843 <string>New Station</string>
844 </property> 809 </property>
810 <grid>
811 <property stdset="1">
812 <name>margin</name>
813 <number>2</number>
814 </property>
815 <property stdset="1">
816 <name>spacing</name>
817 <number>2</number>
818 </property>
819 <widget row="4" column="0" >
820 <class>QLabel</class>
821 <property stdset="1">
822 <name>name</name>
823 <cstring>TextLabel3</cstring>
824 </property>
825 <property stdset="1">
826 <name>text</name>
827 <string>Wired Station:</string>
828 </property>
829 </widget>
830 <widget row="0" column="0" >
831 <class>QLabel</class>
832 <property stdset="1">
833 <name>name</name>
834 <cstring>TextLabel1_3</cstring>
835 </property>
836 <property stdset="1">
837 <name>text</name>
838 <string>Network:</string>
839 </property>
840 </widget>
841 <widget row="2" column="1" >
842 <class>QComboBox</class>
843 <item>
844 <property>
845 <name>text</name>
846 <string>&lt;Ignore&gt;</string>
847 </property>
848 </item>
849 <item>
850 <property>
851 <name>text</name>
852 <string>Play Alarm</string>
853 </property>
854 </item>
855 <item>
856 <property>
857 <name>text</name>
858 <string>Play Click</string>
859 </property>
860 </item>
861 <item>
862 <property>
863 <name>text</name>
864 <string>Blink LED</string>
865 </property>
866 </item>
867 <item>
868 <property>
869 <name>text</name>
870 <string>Run Script</string>
871 </property>
872 </item>
873 <property stdset="1">
874 <name>name</name>
875 <cstring>newClientAction</cstring>
876 </property>
877 <property stdset="1">
878 <name>sizePolicy</name>
879 <sizepolicy>
880 <hsizetype>7</hsizetype>
881 <vsizetype>0</vsizetype>
882 </sizepolicy>
883 </property>
884 </widget>
885 <widget row="3" column="0" rowspan="1" colspan="2" >
886 <class>QLineEdit</class>
887 <property stdset="1">
888 <name>name</name>
889 <cstring>newClientScript</cstring>
890 </property>
891 <property stdset="1">
892 <name>enabled</name>
893 <bool>true</bool>
894 </property>
895 </widget>
896 <widget row="2" column="0" >
897 <class>QLabel</class>
898 <property stdset="1">
899 <name>name</name>
900 <cstring>TextLabel2</cstring>
901 </property>
902 <property stdset="1">
903 <name>text</name>
904 <string>Wireless Station:</string>
905 </property>
906 </widget>
907 <widget row="4" column="1" >
908 <class>QComboBox</class>
909 <item>
910 <property>
911 <name>text</name>
912 <string>&lt;Ignore&gt;</string>
913 </property>
914 </item>
915 <item>
916 <property>
917 <name>text</name>
918 <string>Play Alarm</string>
919 </property>
920 </item>
921 <item>
922 <property>
923 <name>text</name>
924 <string>Play Click</string>
925 </property>
926 </item>
927 <item>
928 <property>
929 <name>text</name>
930 <string>Blink LED</string>
931 </property>
932 </item>
933 <item>
934 <property>
935 <name>text</name>
936 <string>Run Script</string>
937 </property>
938 </item>
939 <property stdset="1">
940 <name>name</name>
941 <cstring>newStationAction</cstring>
942 </property>
943 <property stdset="1">
944 <name>sizePolicy</name>
945 <sizepolicy>
946 <hsizetype>7</hsizetype>
947 <vsizetype>0</vsizetype>
948 </sizepolicy>
949 </property>
950 </widget>
951 <widget row="0" column="1" >
952 <class>QComboBox</class>
953 <item>
954 <property>
955 <name>text</name>
956 <string>&lt;Ignore&gt;</string>
957 </property>
958 </item>
959 <item>
960 <property>
961 <name>text</name>
962 <string>Play Alarm</string>
963 </property>
964 </item>
965 <item>
966 <property>
967 <name>text</name>
968 <string>Play Click</string>
969 </property>
970 </item>
971 <item>
972 <property>
973 <name>text</name>
974 <string>Blink LED</string>
975 </property>
976 </item>
977 <item>
978 <property>
979 <name>text</name>
980 <string>Run Script</string>
981 </property>
982 </item>
983 <property stdset="1">
984 <name>name</name>
985 <cstring>newNetworkAction</cstring>
986 </property>
987 <property stdset="1">
988 <name>sizePolicy</name>
989 <sizepolicy>
990 <hsizetype>7</hsizetype>
991 <vsizetype>0</vsizetype>
992 </sizepolicy>
993 </property>
994 <property stdset="1">
995 <name>editable</name>
996 <bool>false</bool>
997 </property>
998 </widget>
999 <widget row="1" column="0" rowspan="1" colspan="2" >
1000 <class>QLineEdit</class>
1001 <property stdset="1">
1002 <name>name</name>
1003 <cstring>newNetworkScript</cstring>
1004 </property>
1005 <property stdset="1">
1006 <name>enabled</name>
1007 <bool>true</bool>
1008 </property>
1009 </widget>
1010 <widget row="5" column="0" rowspan="1" colspan="2" >
1011 <class>QLineEdit</class>
1012 <property stdset="1">
1013 <name>name</name>
1014 <cstring>newStationScript</cstring>
1015 </property>
1016 <property stdset="1">
1017 <name>enabled</name>
1018 <bool>true</bool>
1019 </property>
1020 </widget>
1021 </grid>
845 </widget> 1022 </widget>
846 </grid> 1023 </grid>
847 </widget> 1024 </widget>
848 </vbox> 1025 </vbox>
849 </widget> 1026 </widget>
850 <widget> 1027 <widget>
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
@@ -14,32 +14,33 @@
14**********************************************************************/ 14**********************************************************************/
15 15
16/* LOCAL */ 16/* LOCAL */
17#include "configwindow.h" 17#include "configwindow.h"
18#include "mainwindow.h" 18#include "mainwindow.h"
19 19
20/* OPIE */
21#include <opie2/onetwork.h>
22#ifdef QWS
23#include <opie2/oapplication.h>
24#include <opie2/oconfig.h>
25#endif
26
20/* QT */ 27/* QT */
21#include <qapplication.h> 28#include <qapplication.h>
22#include <qcheckbox.h> 29#include <qcheckbox.h>
23#include <qcombobox.h> 30#include <qcombobox.h>
24#include <qfile.h> 31#include <qfile.h>
25#include <qlineedit.h> 32#include <qlineedit.h>
26#include <qlayout.h> 33#include <qlayout.h>
27#include <qmap.h> 34#include <qmap.h>
28#include <qpushbutton.h> 35#include <qpushbutton.h>
36#include <qtabwidget.h>
29#include <qtoolbutton.h> 37#include <qtoolbutton.h>
30#include <qspinbox.h> 38#include <qspinbox.h>
31#include <qtextstream.h> 39#include <qtextstream.h>
32 40
33/* OPIE */
34#include <opie2/onetwork.h>
35
36#ifdef QWS
37#include <opie2/oapplication.h>
38#include <opie2/oconfig.h>
39#endif
40 41
41WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0; 42WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0;
42 43
43WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f ) 44WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f )
44 :WellenreiterConfigBase( parent, name, true, f ) 45 :WellenreiterConfigBase( parent, name, true, f )
45{ 46{
@@ -69,18 +70,24 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char
69 connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) ); 70 connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
70 #endif 71 #endif
71 72
72 WellenreiterConfigWindow::_instance = this; 73 WellenreiterConfigWindow::_instance = this;
73 74
74 connect( deviceType, SIGNAL( activated(int) ), this, SLOT( changedDeviceType(int) ) ); 75 connect( deviceType, SIGNAL( activated(int) ), this, SLOT( changedDeviceType(int) ) );
76 connect( newNetworkAction, SIGNAL( activated(int) ), this, SLOT( changedNetworkAction(int) ) );
77 connect( newClientAction, SIGNAL( activated(int) ), this, SLOT( changedClientAction(int) ) );
78 connect( newStationAction, SIGNAL( activated(int) ), this, SLOT( changedStationAction(int) ) );
75 connect( getCaptureFileName, SIGNAL( clicked() ), this, SLOT( getCaptureFileNameClicked() ) ); 79 connect( getCaptureFileName, SIGNAL( clicked() ), this, SLOT( getCaptureFileNameClicked() ) );
76 80
77 // make the checkbox 'channelAll' control all other channels 81 // make the checkbox 'channelAll' control all other channels
78 connect( channelAll, SIGNAL( stateChanged(int) ), this, SLOT( channelAllClicked(int) ) ); 82 connect( channelAll, SIGNAL( stateChanged(int) ), this, SLOT( channelAllClicked(int) ) );
79 83
80 connect( autodetect, SIGNAL( clicked() ), this, SLOT( performAutodetection() ) ); 84 connect( autodetect, SIGNAL( clicked() ), this, SLOT( performAutodetection() ) );
85
86 // hide tab4 (parse) until Wellenreiter 1.2
87 tab->removePage( tab_4 );
81}; 88};
82 89
83 90
84WellenreiterConfigWindow::~WellenreiterConfigWindow() 91WellenreiterConfigWindow::~WellenreiterConfigWindow()
85{ 92{
86 save(); 93 save();
@@ -182,12 +189,42 @@ void WellenreiterConfigWindow::changedDeviceType(int t)
182 deviceType->setCurrentItem( _guess ); 189 deviceType->setCurrentItem( _guess );
183 } 190 }
184 191
185} 192}
186 193
187 194
195void WellenreiterConfigWindow::synchronizeActionsAndScripts()
196{
197 if ( newNetworkAction->currentItem() == 4 ) newNetworkScript->show(); else newNetworkScript->hide();
198 if ( newClientAction->currentItem() == 4 ) newClientScript->show(); else newClientScript->hide();
199 if ( newStationAction->currentItem() == 4 ) newStationScript->show(); else newStationScript->hide();
200
201 //newNetworkScript->setEnabled( newNetworkAction->currentItem() == 4 );
202 //newClientScript->setEnabled( newClientAction->currentItem() == 4 );
203 //newStationScript->setEnabled( newStationAction->currentItem() == 4 );
204}
205
206
207void WellenreiterConfigWindow::changedNetworkAction(int t)
208{
209 synchronizeActionsAndScripts();
210}
211
212
213void WellenreiterConfigWindow::changedClientAction(int t)
214{
215 synchronizeActionsAndScripts();
216}
217
218
219void WellenreiterConfigWindow::changedStationAction(int t)
220{
221 synchronizeActionsAndScripts();
222}
223
224
188void WellenreiterConfigWindow::getCaptureFileNameClicked() 225void WellenreiterConfigWindow::getCaptureFileNameClicked()
189{ 226{
190 QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(true); 227 QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(true);
191 qDebug( "name = %s", (const char*) name ); 228 qDebug( "name = %s", (const char*) name );
192 if ( !name.isEmpty() ) 229 if ( !name.isEmpty() )
193 { 230 {
@@ -232,12 +269,51 @@ int WellenreiterConfigWindow::gpsPort() const
232{ 269{
233 bool ok; 270 bool ok;
234 return useGPS() ? gpsdPort->value() : -1; 271 return useGPS() ? gpsdPort->value() : -1;
235} 272}
236 273
237 274
275void WellenreiterConfigWindow::performAction( const QString& type )
276{
277 int action;
278 QString script;
279
280 if ( type == "network" )
281 {
282 action = newNetworkAction->currentItem();
283 script = newNetworkScript->text();
284 }
285 else if ( type == "managed" || type == "adhoc" )
286 {
287 action = newClientAction->currentItem();
288 script = newClientScript->text();
289 }
290 else if ( type == "station" )
291 {
292 action = newStationAction->currentItem();
293 script = newStationScript->text();
294 }
295 else
296 {
297 qWarning( "WellenreiterConfigWindow::performAction(): unknown type '%s'", (const char*) type );
298 return;
299 }
300
301 qDebug( "going to perform action %d (script='%s')", action, (const char*) script );
302
303 /*
304
305 if ( sound == "Ignore" ) return;
306 else if ( sound == "Touch" ) ODevice::inst()->touchSound();
307 else if ( sound == "Key" ) ODevice::inst()->keySound();
308 else if ( sound == "Alarm" ) ODevice::inst()->alarmSound();
309
310 */
311}
312
313
238void WellenreiterConfigWindow::load() 314void WellenreiterConfigWindow::load()
239{ 315{
240#ifdef Q_WS_X11 316#ifdef Q_WS_X11
241 #warning Persistent Configuration not yet implemented for standalone X11 build 317 #warning Persistent Configuration not yet implemented for standalone X11 build
242 performAutodetection(); 318 performAutodetection();
243#else 319#else
@@ -287,12 +363,19 @@ void WellenreiterConfigWindow::load()
287 captureFileName->setText( c->readEntry( "filename", "/tmp/capture" ) ); 363 captureFileName->setText( c->readEntry( "filename", "/tmp/capture" ) );
288 364
289 c->setGroup( "UI" ); 365 c->setGroup( "UI" );
290 lookupVendor->setChecked( c->readBoolEntry( "lookupVendor", true ) ); 366 lookupVendor->setChecked( c->readBoolEntry( "lookupVendor", true ) );
291 openTree->setChecked( c->readBoolEntry( "openTree", true ) ); 367 openTree->setChecked( c->readBoolEntry( "openTree", true ) );
292 disablePM->setChecked( c->readBoolEntry( "disablePM", true ) ); 368 disablePM->setChecked( c->readBoolEntry( "disablePM", true ) );
369 newNetworkAction->setCurrentItem( c->readNumEntry( "newNetworkAction", 0 ) );
370 newNetworkScript->setText( c->readEntry( "newNetworkScript", "" ) );
371 newClientAction->setCurrentItem( c->readNumEntry( "newClientAction", 0 ) );
372 newClientScript->setText( c->readEntry( "newClientScript", "" ) );
373 newStationAction->setCurrentItem( c->readNumEntry( "newStationAction", 0 ) );
374 newStationScript->setText( c->readEntry( "newStationScript", "" ) );
375 synchronizeActionsAndScripts(); // needed for showing/hiding the script QLineEdit on demand
293 376
294 c->setGroup( "GPS" ); 377 c->setGroup( "GPS" );
295 enableGPS->setChecked( c->readBoolEntry( "use", false ) ); 378 enableGPS->setChecked( c->readBoolEntry( "use", false ) );
296#if QT_VERSION < 300 379#if QT_VERSION < 300
297 gpsdHost->insertItem( c->readEntry( "host", "localhost" ), 0 ); 380 gpsdHost->insertItem( c->readEntry( "host", "localhost" ), 0 );
298 gpsdHost->setCurrentItem( 0 ); 381 gpsdHost->setCurrentItem( 0 );
@@ -330,12 +413,18 @@ void WellenreiterConfigWindow::save()
330 c->writeEntry( "filename", captureFileName->text() ); 413 c->writeEntry( "filename", captureFileName->text() );
331 414
332 c->setGroup( "UI" ); 415 c->setGroup( "UI" );
333 c->writeEntry( "lookupVendor", lookupVendor->isChecked() ); 416 c->writeEntry( "lookupVendor", lookupVendor->isChecked() );
334 c->writeEntry( "openTree", openTree->isChecked() ); 417 c->writeEntry( "openTree", openTree->isChecked() );
335 c->writeEntry( "disablePM", disablePM->isChecked() ); 418 c->writeEntry( "disablePM", disablePM->isChecked() );
419 c->writeEntry( "newNetworkAction", newNetworkAction->currentItem() );
420 c->writeEntry( "newNetworkScript", newNetworkScript->text() );
421 c->writeEntry( "newClientAction", newClientAction->currentItem() );
422 c->writeEntry( "newClientScript", newClientScript->text() );
423 c->writeEntry( "newStationAction", newStationAction->currentItem() );
424 c->writeEntry( "newStationScript", newStationScript->text() );
336 425
337 c->setGroup( "GPS" ); 426 c->setGroup( "GPS" );
338 c->writeEntry( "use", enableGPS->isChecked() ); 427 c->writeEntry( "use", enableGPS->isChecked() );
339 c->writeEntry( "host", gpsdHost->currentText() ); 428 c->writeEntry( "host", gpsdHost->currentText() );
340 c->writeEntry( "port", gpsdPort->value() ); 429 c->writeEntry( "port", gpsdPort->value() );
341 c->writeEntry( "start", startGPS->isChecked() ); 430 c->writeEntry( "start", startGPS->isChecked() );
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
@@ -54,15 +54,22 @@ class WellenreiterConfigWindow : public WellenreiterConfigBase
54 54
55 void save(); 55 void save();
56 void load(); 56 void load();
57 57
58 public slots: 58 public slots:
59 void changedDeviceType(int); 59 void changedDeviceType(int);
60 void changedNetworkAction(int t);
61 void changedClientAction(int t);
62 void changedStationAction(int t);
60 void getCaptureFileNameClicked(); 63 void getCaptureFileNameClicked();
61 void performAutodetection(); 64 void performAutodetection();
62 void channelAllClicked(int); 65 void channelAllClicked(int);
66 void performAction( const QString& );
67
68 protected:
69 void synchronizeActionsAndScripts();
63 70
64 protected: 71 protected:
65 QMap<QString, int> _devicetype; 72 QMap<QString, int> _devicetype;
66 static WellenreiterConfigWindow* _instance; 73 static WellenreiterConfigWindow* _instance;
67 int _guess; 74 int _guess;
68 75
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
@@ -55,29 +55,29 @@ GpsLocation GPS::position() const
55 if ( numAvail ) 55 if ( numAvail )
56 { 56 {
57 QTextStream stream( _socket ); 57 QTextStream stream( _socket );
58 58
59 QString str; 59 QString str;
60 stream.readRawBytes( &buf[0], 7 ); 60 stream.readRawBytes( &buf[0], 7 );
61 float lat = -111.111; 61 float lat = -111;
62 stream >> lat; 62 stream >> lat;
63 stream.skipWhiteSpace(); 63 stream.skipWhiteSpace();
64 float lon = -111.111; 64 float lon = -111;
65 stream >> lon; 65 stream >> lon;
66 stream.readRawBytes( &buf[0], 200 ); // read and discard the stuff until EOF 66 stream.readRawBytes( &buf[0], 200 ); // read and discard the stuff until EOF
67 67
68 return GpsLocation( lat, lon ); 68 return GpsLocation( lat, lon );
69 } 69 }
70 } 70 }
71 return GpsLocation( -111.111, -111.111 ); 71 return GpsLocation( -111, -111 );
72} 72}
73 73
74 74
75QString GpsLocation::dmsPosition() const 75QString GpsLocation::dmsPosition() const
76{ 76{
77 if ( _latitude == -111.111 || _longitude == -111.11 ) 77 if ( _latitude == -111 || _longitude == -111 )
78 return "N/A"; 78 return "N/A";
79 if ( _latitude == 0.0 && _longitude == 0.0 ) 79 if ( _latitude == 0.0 && _longitude == 0.0 )
80 return "NULL"; 80 return "NULL";
81 81
82 /* compute latitude */ 82 /* compute latitude */
83 83
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
@@ -23,17 +23,14 @@
23#include <qtextstream.h> 23#include <qtextstream.h>
24#include <qpopupmenu.h> 24#include <qpopupmenu.h>
25#include <qcheckbox.h> 25#include <qcheckbox.h>
26 26
27#ifdef QWS 27#ifdef QWS
28#include <qpe/qpeapplication.h> 28#include <qpe/qpeapplication.h>
29#include <opie/odevice.h>
30using namespace Opie;
31#endif 29#endif
32 30
33
34#ifdef QWS 31#ifdef QWS
35#include <qpe/resource.h> 32#include <qpe/resource.h>
36#else 33#else
37#include "resource.h" 34#include "resource.h"
38#endif 35#endif
39 36
@@ -418,14 +415,16 @@ MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QS
418 _type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ), 415 _type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ),
419 _channel( channel ), _signal( signal ), _beacons( 1 ) 416 _channel( channel ), _signal( signal ), _beacons( 1 )
420{ 417{
421 #ifdef DEBUG 418 #ifdef DEBUG
422 qDebug( "creating scanlist item" ); 419 qDebug( "creating scanlist item" );
423 #endif 420 #endif
424 if ( WellenreiterConfigWindow::instance() && type == "network" ) 421
425 playSound( WellenreiterConfigWindow::instance()->soundOnNetwork() ); 422 if ( WellenreiterConfigWindow::instance() )
423 WellenreiterConfigWindow::instance()->performAction( type ); // better use signal/slot combination here
424
426 decorateItem( type, essid, macaddr, wep, channel, signal ); 425 decorateItem( type, essid, macaddr, wep, channel, signal );
427} 426}
428 427
429MScanListItem::MScanListItem( QListViewItem* parent, QString type, QString essid, QString macaddr, 428MScanListItem::MScanListItem( QListViewItem* parent, QString type, QString essid, QString macaddr,
430 bool wep, int channel, int signal ) 429 bool wep, int channel, int signal )
431 :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) 430 :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null )
@@ -536,23 +535,12 @@ void MScanListItem::setManufacturer( const QString& manufacturer )
536void MScanListItem::setLocation( const QString& location ) 535void MScanListItem::setLocation( const QString& location )
537{ 536{
538 setText( col_location, location ); 537 setText( col_location, location );
539} 538}
540 539
541 540
542void MScanListItem::playSound( const QString& sound ) const
543{
544 #ifdef QWS
545 if ( sound == "Ignore" ) return;
546 else if ( sound == "Touch" ) ODevice::inst()->touchSound();
547 else if ( sound == "Key" ) ODevice::inst()->keySound();
548 else if ( sound == "Alarm" ) ODevice::inst()->alarmSound();
549 #endif
550}
551
552
553void MScanListItem::receivedBeacon() 541void MScanListItem::receivedBeacon()
554{ 542{
555 _beacons++; 543 _beacons++;
556 #ifdef DEBUG 544 #ifdef DEBUG
557 qDebug( "MScanListItem %s: received beacon #%d", (const char*) _macaddr, _beacons ); 545 qDebug( "MScanListItem %s: received beacon #%d", (const char*) _macaddr, _beacons );
558 #endif 546 #endif
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
@@ -106,15 +106,12 @@ class MScanListItem: public OListViewItem
106 void setLocation( const QString& location ); 106 void setLocation( const QString& location );
107 107
108 virtual OListViewItem* childFactory(); 108 virtual OListViewItem* childFactory();
109 virtual void serializeTo( QDataStream& s ) const; 109 virtual void serializeTo( QDataStream& s ) const;
110 virtual void serializeFrom( QDataStream& s ); 110 virtual void serializeFrom( QDataStream& s );
111 111
112 protected:
113 void playSound( const QString& ) const;
114
115 private: 112 private:
116 QString _type; 113 QString _type;
117 QString _essid; 114 QString _essid;
118 QString _macaddr; 115 QString _macaddr;
119 bool _wep; 116 bool _wep;
120 int _channel; 117 int _channel;
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
@@ -178,19 +178,19 @@ void Wellenreiter::handleManagementFrame( OPacket* p, OWaveLanManagementPacket*
178 { 178 {
179 qWarning( "Wellenreiter::invalid frame [possibly noise] detected!" ); 179 qWarning( "Wellenreiter::invalid frame [possibly noise] detected!" );
180 return; 180 return;
181 } 181 }
182 182
183 OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); 183 OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) );
184 QString essid = ssid ? ssid->ID() : QString("<unknown>"); 184 QString essid = ssid ? ssid->ID( true /* decloak */ ) : QString("<unknown>");
185 OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) ); 185 OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) );
186 int channel = ds ? ds->channel() : -1; 186 int channel = ds ? ds->channel() : -1;
187 187
188 OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); 188 OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) );
189 189
190 GpsLocation loc( -111.111, -111.111 ); 190 GpsLocation loc( -111, -111 );
191 if ( configwindow->enableGPS->isChecked() ) 191 if ( configwindow->enableGPS->isChecked() )
192 { 192 {
193 // TODO: add check if GPS is working!? 193 // TODO: add check if GPS is working!?
194 qDebug( "Wellenreiter::gathering GPS data..." ); 194 qDebug( "Wellenreiter::gathering GPS data..." );
195 loc = gps->position(); 195 loc = gps->position();
196 qDebug( "Wellenreiter::GPS data received is ( %f , %f ) - dms string = '%s'", loc.latitude(), loc.longitude(), loc.dmsPosition().latin1() ); 196 qDebug( "Wellenreiter::GPS data received is ( %f , %f ) - dms string = '%s'", loc.latitude(), loc.longitude(), loc.dmsPosition().latin1() );
@@ -213,13 +213,13 @@ void Wellenreiter::handleManagementFrame( OPacket* p, OWaveLanManagementPacket*
213void Wellenreiter::handleControlFrame( OPacket* p, OWaveLanControlPacket* control ) 213void Wellenreiter::handleControlFrame( OPacket* p, OWaveLanControlPacket* control )
214{ 214{
215 OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); 215 OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) );
216 216
217 if ( control->controlType() == "Acknowledge" ) 217 if ( control->controlType() == "Acknowledge" )
218 { 218 {
219 netView()->addNewItem( "adhoc", "???", header->macAddress1(), false, -1, 0, GpsLocation( -111.111, -111.111 ) ); 219 netView()->addNewItem( "adhoc", "???", header->macAddress1(), false, -1, 0, GpsLocation( -111, -111 ) );
220 } 220 }
221 else 221 else
222 { 222 {
223 qDebug( "Wellenreiter::handleControlFrame - please handle %s in a future version! :D", (const char*) control->controlType() ); 223 qDebug( "Wellenreiter::handleControlFrame - please handle %s in a future version! :D", (const char*) control->controlType() );
224 } 224 }
225} 225}
@@ -257,13 +257,13 @@ void Wellenreiter::handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAdd
257 257
258void Wellenreiter::handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAddress& from, OMacAddress& to ) 258void Wellenreiter::handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAddress& from, OMacAddress& to )
259{ 259{
260 from = data->sourceAddress(); 260 from = data->sourceAddress();
261 to = data->destinationAddress(); 261 to = data->destinationAddress();
262 262
263 netView()->addNewItem( "station", "<wired>", from, false, -1, 0, GpsLocation( -111.111, -111.111 ) ); 263 netView()->addNewItem( "station", "<wired>", from, false, -1, 0, GpsLocation( -111, -111 ) );
264} 264}
265 265
266 266
267void Wellenreiter::handleARPData( OPacket* p, OARPPacket*, OMacAddress& source, OMacAddress& dest ) 267void Wellenreiter::handleARPData( OPacket* p, OARPPacket*, OMacAddress& source, OMacAddress& dest )
268{ 268{
269 OARPPacket* arp = (OARPPacket*) p->child( "ARP" ); 269 OARPPacket* arp = (OARPPacket*) p->child( "ARP" );
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
@@ -2,9 +2,9 @@ Package: opie-wellenreiter
2Files: bin/wellenreiter pics/wellenreiter apps/Applications/wellenreiter.desktop 2Files: bin/wellenreiter pics/wellenreiter apps/Applications/wellenreiter.desktop
3Priority: optional 3Priority: optional
4Section: opie/applications 4Section: opie/applications
5Maintainer: Michael 'Mickey' Lauer <mickeyl@handhelds.org> 5Maintainer: Michael 'Mickey' Lauer <mickeyl@handhelds.org>
6Architecture: arm 6Architecture: arm
7Version: 1.0.2-$SUB_VERSION 7Version: 1.0.2-$SUB_VERSION
8Depends: libqpe1, libpcap0 (0.7.2), libopiecore2, libopienet2, libopieui2 8Depends: libqpe1, libpcap0 (0.7.2), libopiecore2, libopienet2 (>=1.8.3), libopieui2
9Description: A WaveLAN Network Monitor 9Description: A WaveLAN Network Monitor
10 A WaveLAN Network Monitor/Sniffer for the Opie Environment. 10 A WaveLAN Network Monitor/Sniffer for the Opie Environment.