author | mickeyl <mickeyl> | 2003-02-23 15:14:18 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-02-23 15:14:18 (UTC) |
commit | 9b7faae2ec12eeb9a056ca6093ac6e0840b11717 (patch) (unidiff) | |
tree | fc4d9de4ee2fd5c502513ccf0fa592bfaaa87185 | |
parent | 791c7512c530cb373726f9c01e26229cb8ca992a (diff) | |
download | opie-9b7faae2ec12eeb9a056ca6093ac6e0840b11717.zip opie-9b7faae2ec12eeb9a056ca6093ac6e0840b11717.tar.gz opie-9b7faae2ec12eeb9a056ca6093ac6e0840b11717.tar.bz2 |
- revamped part of the gui
- configuration is now a seperate dialog
- orinoco_hopper is no longer needed
-rw-r--r-- | noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.c | 118 | ||||
-rw-r--r-- | noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.pro | 15 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/configbase.ui | 4 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/configwindow.cpp | 2 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/gui.pro | 12 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.cpp | 74 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.h | 8 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/manufacturers.cpp | 8 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 37 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.h | 21 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiterbase.cpp | 50 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiterbase.h | 13 | ||||
-rw-r--r-- | noncore/net/wellenreiter/wellenreiter.pro | 2 |
13 files changed, 135 insertions, 229 deletions
diff --git a/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.c b/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.c deleted file mode 100644 index 78f0299..0000000 --- a/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.c +++ b/dev/null | |||
@@ -1,118 +0,0 @@ | |||
1 | /* orinoco_hopper.c | ||
2 | * orinoco wireless nic channel scanning utility | ||
3 | * | ||
4 | * By Snax <snax@shmoo.com> | ||
5 | * Copyright (c) 2002 Snax | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; either version 2 | ||
10 | * of the License, or (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * For a copy of the GNU General Public License write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | |||
21 | #include <stdio.h> | ||
22 | #include <stdlib.h> | ||
23 | #include <sys/time.h> | ||
24 | #include <signal.h> | ||
25 | #include <string.h> | ||
26 | #include <sys/ioctl.h> | ||
27 | #include <sys/socket.h> | ||
28 | #include <linux/wireless.h> | ||
29 | #include <unistd.h> | ||
30 | #include <getopt.h> | ||
31 | |||
32 | #ifndef SIOCIWFIRSTPRIV | ||
33 | #define SIOCIWFIRSTPRIV SIOCDEVPRIVATE | ||
34 | #endif | ||
35 | |||
36 | void changeChannel(int); | ||
37 | int setChannel( unsigned char channel ); | ||
38 | |||
39 | int max = 11; | ||
40 | int mode = 2; | ||
41 | char dev[32]; | ||
42 | |||
43 | void changeChannel(int x) { | ||
44 | static int chan = 0; | ||
45 | chan = (chan % max) + 1; | ||
46 | setChannel(chan); | ||
47 | } | ||
48 | |||
49 | int setChannel( unsigned char channel ) | ||
50 | { | ||
51 | int result = 0; | ||
52 | int fd; | ||
53 | struct iwreq ireq; //for Orinoco | ||
54 | int *ptr; | ||
55 | |||
56 | /* get a socket */ | ||
57 | fd = socket(AF_INET, SOCK_STREAM, 0); | ||
58 | |||
59 | if ( fd == -1 ) { | ||
60 | return -1; | ||
61 | } | ||
62 | ptr = (int *) ireq.u.name; | ||
63 | ptr[0] = mode; | ||
64 | ptr[1] = channel; | ||
65 | strcpy(ireq.ifr_ifrn.ifrn_name, dev); | ||
66 | result = ioctl( fd, SIOCIWFIRSTPRIV + 0x8, &ireq); | ||
67 | close(fd); | ||
68 | return result; | ||
69 | } | ||
70 | |||
71 | void usage(char *cmd) { | ||
72 | fprintf(stderr, | ||
73 | "Usage: %s <iface> [-p] [-i <interval millisec>] [-n]\n -n = international channels\n -p = keep prism headers\n", cmd); | ||
74 | exit(1); | ||
75 | } | ||
76 | |||
77 | int main (int argc, char *argv[]) | ||
78 | { | ||
79 | struct itimerval tval; | ||
80 | int ms, r; | ||
81 | |||
82 | //this will be the channel scanning interval, currently 0.2 sec | ||
83 | struct timeval interval = {0, 200000}; | ||
84 | |||
85 | if (argc < 2) usage(argv[0]); | ||
86 | strncpy(dev, argv[1], 32); | ||
87 | dev[31] = 0; | ||
88 | |||
89 | while (1) { | ||
90 | r = getopt(argc,argv,"i:np"); | ||
91 | if (r < 0) break; | ||
92 | switch (r) { | ||
93 | case 'n': | ||
94 | max = 14; | ||
95 | break; | ||
96 | case 'p': | ||
97 | mode = 1; | ||
98 | break; | ||
99 | case 'i': | ||
100 | ms = atoi(optarg); | ||
101 | interval.tv_sec = ms / 1000; | ||
102 | interval.tv_usec = (ms % 1000) * 1000; | ||
103 | break; | ||
104 | default: | ||
105 | usage(argv[0]); | ||
106 | } | ||
107 | } | ||
108 | |||
109 | //this sets up the kchannel scanning stuff | ||
110 | signal(SIGALRM, changeChannel); | ||
111 | tval.it_interval = interval; | ||
112 | tval.it_value = interval; | ||
113 | setitimer(ITIMER_REAL, &tval, NULL); | ||
114 | while (1) pause(); | ||
115 | |||
116 | return 0; | ||
117 | } | ||
118 | |||
diff --git a/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.pro b/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.pro deleted file mode 100644 index 30298d5..0000000 --- a/noncore/net/wellenreiter/contrib/orinoco_hopper/orinoco_hopper.pro +++ b/dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | DESTDIR = $(OPIEDIR)/bin | ||
2 | TEMPLATE = app | ||
3 | CONFIG = warn_on debug | ||
4 | #CONFIG = warn_on release | ||
5 | HEADERS = | ||
6 | SOURCES = orinoco_hopper.c | ||
7 | INCLUDEPATH += | ||
8 | DEPENDPATH += | ||
9 | LIBS += | ||
10 | INTERFACES = | ||
11 | TARGET = orinoco_hopper | ||
12 | |||
13 | |||
14 | |||
15 | include ( $(OPIEDIR)/include.pro ) | ||
diff --git a/noncore/net/wellenreiter/gui/configbase.ui b/noncore/net/wellenreiter/gui/configbase.ui index 7992e6b..398118f 100644 --- a/noncore/net/wellenreiter/gui/configbase.ui +++ b/noncore/net/wellenreiter/gui/configbase.ui | |||
@@ -1,62 +1,62 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>WellenreiterConfigBase</class> | 2 | <class>WellenreiterConfigBase</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QWidget</class> | 4 | <class>QDialog</class> |
5 | <property stdset="1"> | 5 | <property stdset="1"> |
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>WellenreiterConfigBase</cstring> | 7 | <cstring>WellenreiterConfigBase</cstring> |
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>224</width> | 14 | <width>220</width> |
15 | <height>267</height> | 15 | <height>267</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>Form1</string> | 20 | <string>Form1</string> |
21 | </property> | 21 | </property> |
22 | <property> | 22 | <property> |
23 | <name>layoutMargin</name> | 23 | <name>layoutMargin</name> |
24 | </property> | 24 | </property> |
25 | <property> | 25 | <property> |
26 | <name>layoutSpacing</name> | 26 | <name>layoutSpacing</name> |
27 | </property> | 27 | </property> |
28 | <vbox> | 28 | <vbox> |
29 | <property stdset="1"> | 29 | <property stdset="1"> |
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>4</number> | 31 | <number>4</number> |
32 | </property> | 32 | </property> |
33 | <property stdset="1"> | 33 | <property stdset="1"> |
34 | <name>spacing</name> | 34 | <name>spacing</name> |
35 | <number>1</number> | 35 | <number>1</number> |
36 | </property> | 36 | </property> |
37 | <widget> | 37 | <widget> |
38 | <class>QLayoutWidget</class> | 38 | <class>QLayoutWidget</class> |
39 | <property stdset="1"> | 39 | <property stdset="1"> |
40 | <name>name</name> | 40 | <name>name</name> |
41 | <cstring>Layout5</cstring> | 41 | <cstring>Layout5</cstring> |
42 | </property> | 42 | </property> |
43 | <property> | 43 | <property> |
44 | <name>layoutSpacing</name> | 44 | <name>layoutSpacing</name> |
45 | </property> | 45 | </property> |
46 | <hbox> | 46 | <hbox> |
47 | <property stdset="1"> | 47 | <property stdset="1"> |
48 | <name>margin</name> | 48 | <name>margin</name> |
49 | <number>0</number> | 49 | <number>0</number> |
50 | </property> | 50 | </property> |
51 | <property stdset="1"> | 51 | <property stdset="1"> |
52 | <name>spacing</name> | 52 | <name>spacing</name> |
53 | <number>2</number> | 53 | <number>2</number> |
54 | </property> | 54 | </property> |
55 | <widget> | 55 | <widget> |
56 | <class>QLabel</class> | 56 | <class>QLabel</class> |
57 | <property stdset="1"> | 57 | <property stdset="1"> |
58 | <name>name</name> | 58 | <name>name</name> |
59 | <cstring>TextLabel3_2</cstring> | 59 | <cstring>TextLabel3_2</cstring> |
60 | </property> | 60 | </property> |
61 | <property stdset="1"> | 61 | <property stdset="1"> |
62 | <name>sizePolicy</name> | 62 | <name>sizePolicy</name> |
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp index 515d9b2..6ea6f02 100644 --- a/noncore/net/wellenreiter/gui/configwindow.cpp +++ b/noncore/net/wellenreiter/gui/configwindow.cpp | |||
@@ -1,47 +1,47 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #include "configwindow.h" | 16 | #include "configwindow.h" |
17 | #include <qmap.h> | 17 | #include <qmap.h> |
18 | #include <qcombobox.h> | 18 | #include <qcombobox.h> |
19 | #include <qspinbox.h> | 19 | #include <qspinbox.h> |
20 | 20 | ||
21 | WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f ) | 21 | WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f ) |
22 | :WellenreiterConfigBase( parent, name, f ) | 22 | :WellenreiterConfigBase( parent, name, true, f ) |
23 | { | 23 | { |
24 | _devicetype[ "cisco" ] = 1; | 24 | _devicetype[ "cisco" ] = 1; |
25 | _devicetype[ "wlan-ng" ] = 2; | 25 | _devicetype[ "wlan-ng" ] = 2; |
26 | _devicetype[ "hostap" ] = 3; | 26 | _devicetype[ "hostap" ] = 3; |
27 | _devicetype[ "orinoco" ] = 4; | 27 | _devicetype[ "orinoco" ] = 4; |
28 | _devicetype[ "<manual>" ] = 5; | 28 | _devicetype[ "<manual>" ] = 5; |
29 | }; | 29 | }; |
30 | 30 | ||
31 | int WellenreiterConfigWindow::daemonDeviceType() | 31 | int WellenreiterConfigWindow::daemonDeviceType() |
32 | { | 32 | { |
33 | QString name = deviceType->currentText(); | 33 | QString name = deviceType->currentText(); |
34 | if ( _devicetype.contains( name ) ) | 34 | if ( _devicetype.contains( name ) ) |
35 | { | 35 | { |
36 | return _devicetype[name]; | 36 | return _devicetype[name]; |
37 | } | 37 | } |
38 | else | 38 | else |
39 | { | 39 | { |
40 | return 0; | 40 | return 0; |
41 | } | 41 | } |
42 | }; | 42 | }; |
43 | 43 | ||
44 | int WellenreiterConfigWindow::daemonHopInterval() | 44 | int WellenreiterConfigWindow::daemonHopInterval() |
45 | { | 45 | { |
46 | return hopInterval->cleanText().toInt(); | 46 | return hopInterval->cleanText().toInt(); |
47 | } | 47 | } |
diff --git a/noncore/net/wellenreiter/gui/gui.pro b/noncore/net/wellenreiter/gui/gui.pro index 4ee360d..95e9f22 100644 --- a/noncore/net/wellenreiter/gui/gui.pro +++ b/noncore/net/wellenreiter/gui/gui.pro | |||
@@ -1,36 +1,40 @@ | |||
1 | MOC_DIR = ./tmp | ||
2 | OBJECTS_DIR = ./tmp | ||
1 | DESTDIR = $(OPIEDIR)/bin | 3 | DESTDIR = $(OPIEDIR)/bin |
2 | TEMPLATE = app | 4 | TEMPLATE = app |
3 | CONFIG = qt warn_on debug | 5 | CONFIG = qt warn_on debug |
4 | #CONFIG = qt warn_on release | 6 | |
5 | HEADERS = mainwindow.h \ | 7 | HEADERS = wellenreiterbase.h \ |
6 | wellenreiterbase.h \ | 8 | mainwindow.h \ |
7 | wellenreiter.h \ | 9 | wellenreiter.h \ |
8 | scanlistitem.h \ | 10 | scanlistitem.h \ |
9 | scanlist.h \ | 11 | scanlist.h \ |
10 | logwindow.h \ | 12 | logwindow.h \ |
11 | hexwindow.h \ | 13 | hexwindow.h \ |
12 | configwindow.h \ | 14 | configwindow.h \ |
13 | wlan.h \ | 15 | wlan.h \ |
14 | cardconfig.h \ | 16 | cardconfig.h \ |
15 | manufacturers.h | 17 | manufacturers.h |
18 | |||
16 | SOURCES = main.cpp \ | 19 | SOURCES = main.cpp \ |
17 | mainwindow.cpp \ | 20 | mainwindow.cpp \ |
18 | wellenreiterbase.cpp \ | 21 | wellenreiterbase.cpp \ |
19 | wellenreiter.cpp \ | 22 | wellenreiter.cpp \ |
20 | scanlistitem.cpp \ | 23 | scanlistitem.cpp \ |
21 | scanlist.cpp \ | 24 | scanlist.cpp \ |
22 | logwindow.cpp \ | 25 | logwindow.cpp \ |
23 | hexwindow.cpp \ | 26 | hexwindow.cpp \ |
24 | configwindow.cpp \ | 27 | configwindow.cpp \ |
25 | wlan.cpp \ | 28 | wlan.cpp \ |
26 | cardconfig.cpp \ | 29 | cardconfig.cpp \ |
27 | manufacturers.h | 30 | manufacturers.cpp |
31 | |||
28 | INCLUDEPATH += $(OPIEDIR)/include ../ | 32 | INCLUDEPATH += $(OPIEDIR)/include ../ |
29 | DEPENDPATH += $(OPIEDIR)/include ../ | 33 | DEPENDPATH += $(OPIEDIR)/include ../ |
30 | LIBS += -lqpe -lopie -L. -lwellenreiter | 34 | LIBS += -lqpe -lopie -L. -lwellenreiter |
31 | INTERFACES = configbase.ui | 35 | INTERFACES = configbase.ui |
32 | TARGET = wellenreiter | 36 | TARGET = wellenreiter |
33 | 37 | ||
34 | 38 | ||
35 | 39 | ||
36 | include ( $(OPIEDIR)/include.pro ) | 40 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp index d7326c0..b67376c 100644 --- a/noncore/net/wellenreiter/gui/mainwindow.cpp +++ b/noncore/net/wellenreiter/gui/mainwindow.cpp | |||
@@ -1,92 +1,140 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #include "configwindow.h" | ||
16 | #include "mainwindow.h" | 17 | #include "mainwindow.h" |
17 | #include "wellenreiter.h" | 18 | #include "wellenreiter.h" |
18 | 19 | ||
20 | #include <qcombobox.h> | ||
19 | #include <qiconset.h> | 21 | #include <qiconset.h> |
20 | #include <qmenubar.h> | 22 | #include <qmenubar.h> |
21 | #include <qpopupmenu.h> | 23 | #include <qpopupmenu.h> |
22 | #include <qstatusbar.h> | 24 | #include <qstatusbar.h> |
23 | #include <qtoolbutton.h> | 25 | #include <qtoolbutton.h> |
24 | 26 | ||
25 | #ifdef QWS | 27 | #ifdef QWS |
26 | #include <qpe/resource.h> | 28 | #include <qpe/resource.h> |
27 | #else | 29 | #else |
28 | #include "resource.h" | 30 | #include "resource.h" |
29 | #endif | 31 | #endif |
30 | 32 | ||
31 | WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * name, WFlags f ) | 33 | WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * name, WFlags f ) |
32 | :QMainWindow( parent, name, f ) | 34 | :QMainWindow( parent, name, f ) |
33 | { | 35 | { |
36 | cw = new WellenreiterConfigWindow( this ); | ||
34 | mw = new Wellenreiter( this ); | 37 | mw = new Wellenreiter( this ); |
38 | mw->setConfigWindow( cw ); | ||
35 | setCentralWidget( mw ); | 39 | setCentralWidget( mw ); |
36 | 40 | ||
37 | // setup icon sets | 41 | // setup icon sets |
38 | 42 | ||
39 | searchIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SearchIcon" ) ); | 43 | searchIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SearchIcon" ) ); |
40 | infoIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/InfoIcon" ) ); | 44 | infoIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/InfoIcon" ) ); |
41 | settingsIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SettingsIcon" ) ); | 45 | settingsIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SettingsIcon" ) ); |
42 | cancelIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/CancelIcon" ) ); | 46 | cancelIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/CancelIcon" ) ); |
43 | 47 | ||
44 | // setup tool buttons | 48 | // setup tool buttons |
45 | 49 | ||
46 | QToolButton* b = new QToolButton( 0 ); | 50 | startStopButton = new QToolButton( 0 ); |
47 | b->setAutoRaise( true ); | 51 | startStopButton->setAutoRaise( true ); |
48 | b->setOnIconSet( *cancelIconSet ); | 52 | startStopButton->setOnIconSet( *cancelIconSet ); |
49 | b->setOffIconSet( *searchIconSet ); | 53 | startStopButton->setOffIconSet( *searchIconSet ); |
50 | b->setToggleButton( true ); | 54 | startStopButton->setToggleButton( true ); |
55 | connect( startStopButton, SIGNAL( clicked() ), mw, SLOT( startStopClicked() ) ); | ||
56 | startStopButton->setEnabled( false ); | ||
51 | 57 | ||
52 | QToolButton* c = new QToolButton( 0 ); | 58 | QToolButton* c = new QToolButton( 0 ); |
53 | c->setAutoRaise( true ); | 59 | c->setAutoRaise( true ); |
54 | c->setIconSet( *infoIconSet ); | 60 | c->setIconSet( *infoIconSet ); |
55 | c->setEnabled( false ); | 61 | c->setEnabled( false ); |
56 | 62 | ||
57 | QToolButton* d = new QToolButton( 0 ); | 63 | QToolButton* d = new QToolButton( 0 ); |
58 | d->setAutoRaise( true ); | 64 | d->setAutoRaise( true ); |
59 | d->setIconSet( *settingsIconSet ); | 65 | d->setIconSet( *settingsIconSet ); |
66 | connect( d, SIGNAL( clicked() ), this, SLOT( showConfigure() ) ); | ||
60 | 67 | ||
61 | // setup menu bar | 68 | // setup menu bar |
62 | 69 | ||
63 | QMenuBar* mb = menuBar(); | 70 | QMenuBar* mb = menuBar(); |
64 | 71 | ||
65 | QPopupMenu* p = new QPopupMenu( mb ); | 72 | QPopupMenu* file = new QPopupMenu( mb ); |
66 | p->insertItem( "&Load" ); | 73 | file->insertItem( "&Load" ); |
67 | p->insertItem( "&Save" ); | 74 | file->insertItem( "&Save" ); |
68 | 75 | ||
69 | mb->insertItem( "&File", p ); | 76 | QPopupMenu* view = new QPopupMenu( mb ); |
70 | mb->setItemEnabled( mb->insertItem( b ), false ); | 77 | view->insertItem( "&Configure" ); |
71 | mb->setItemEnabled( mb->insertItem( c ), false ); | 78 | |
79 | QPopupMenu* sniffer = new QPopupMenu( mb ); | ||
80 | sniffer->insertItem( "&Configure" ); | ||
81 | sniffer->insertSeparator(); | ||
82 | |||
83 | int id; | ||
84 | |||
85 | id = mb->insertItem( "&File", file ); | ||
86 | mb->setItemEnabled( id, false ); | ||
87 | id = mb->insertItem( "&View", view ); | ||
88 | mb->setItemEnabled( id, false ); | ||
89 | id = mb->insertItem( "&Sniffer", sniffer ); | ||
90 | mb->setItemEnabled( id, false ); | ||
91 | |||
92 | mb->insertItem( startStopButton ); | ||
93 | mb->insertItem( c ); | ||
72 | mb->insertItem( d ); | 94 | mb->insertItem( d ); |
73 | 95 | ||
74 | // setup status bar | 96 | // setup status bar (for now only on X11) |
75 | 97 | ||
76 | // statusBar()->message( "Ready." ); | 98 | #ifndef QWS |
99 | statusBar()->message( "Ready." ); | ||
100 | #endif | ||
77 | 101 | ||
78 | }; | 102 | }; |
79 | 103 | ||
104 | void WellenreiterMainWindow::showConfigure() | ||
105 | { | ||
106 | qDebug( "show configure..." ); | ||
107 | cw->setCaption( tr( "Configure" ) ); | ||
108 | cw->showMaximized(); | ||
109 | int result = cw->exec(); | ||
110 | |||
111 | if ( result ) | ||
112 | { | ||
113 | // check configuration from config window | ||
114 | |||
115 | const QString& interface = cw->interfaceName->currentText(); | ||
116 | const int cardtype = cw->daemonDeviceType(); | ||
117 | const int interval = cw->daemonHopInterval(); | ||
118 | |||
119 | if ( ( interface != "<select>" ) && ( cardtype != 0 ) ) | ||
120 | startStopButton->setEnabled( true ); | ||
121 | //TODO ... | ||
122 | else | ||
123 | startStopButton->setEnabled( false ); | ||
124 | //TODO ... | ||
125 | } | ||
126 | } | ||
127 | |||
80 | WellenreiterMainWindow::~WellenreiterMainWindow() | 128 | WellenreiterMainWindow::~WellenreiterMainWindow() |
81 | { | 129 | { |
82 | 130 | ||
83 | delete searchIconSet; | 131 | delete searchIconSet; |
84 | delete infoIconSet; | 132 | delete infoIconSet; |
85 | delete settingsIconSet; | 133 | delete settingsIconSet; |
86 | delete cancelIconSet; | 134 | delete cancelIconSet; |
87 | 135 | ||
88 | 136 | ||
89 | }; | 137 | }; |
90 | 138 | ||
91 | 139 | ||
92 | 140 | ||
diff --git a/noncore/net/wellenreiter/gui/mainwindow.h b/noncore/net/wellenreiter/gui/mainwindow.h index dcc79e6..7d772a8 100644 --- a/noncore/net/wellenreiter/gui/mainwindow.h +++ b/noncore/net/wellenreiter/gui/mainwindow.h | |||
@@ -1,43 +1,49 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #ifndef MAINWINDOW_H | 16 | #ifndef MAINWINDOW_H |
17 | #define MAINWINDOW_H | 17 | #define MAINWINDOW_H |
18 | 18 | ||
19 | #include <qmainwindow.h> | 19 | #include <qmainwindow.h> |
20 | 20 | ||
21 | class Wellenreiter; | 21 | class Wellenreiter; |
22 | class WellenreiterConfigWindow; | ||
22 | class QIconSet; | 23 | class QIconSet; |
24 | class QToolButton; | ||
23 | 25 | ||
24 | class WellenreiterMainWindow: public QMainWindow | 26 | class WellenreiterMainWindow: public QMainWindow |
25 | { | 27 | { |
28 | Q_OBJECT | ||
26 | 29 | ||
27 | public: | 30 | public: |
28 | WellenreiterMainWindow( QWidget * parent = 0, const char * name = "mainwindow", WFlags f = 0 ); | 31 | WellenreiterMainWindow( QWidget * parent = 0, const char * name = "mainwindow", WFlags f = 0 ); |
29 | ~WellenreiterMainWindow(); | 32 | ~WellenreiterMainWindow(); |
30 | 33 | ||
31 | protected: | 34 | protected: |
32 | Wellenreiter* mw; | 35 | Wellenreiter* mw; |
36 | WellenreiterConfigWindow* cw; | ||
33 | 37 | ||
34 | const QIconSet* searchIconSet; | 38 | const QIconSet* searchIconSet; |
35 | const QIconSet* infoIconSet; | 39 | const QIconSet* infoIconSet; |
36 | const QIconSet* settingsIconSet; | 40 | const QIconSet* settingsIconSet; |
37 | const QIconSet* cancelIconSet; | 41 | const QIconSet* cancelIconSet; |
38 | 42 | ||
43 | QToolButton* startStopButton; | ||
39 | 44 | ||
45 | public slots: | ||
46 | void showConfigure(); | ||
40 | }; | 47 | }; |
41 | 48 | ||
42 | #endif | 49 | #endif |
43 | |||
diff --git a/noncore/net/wellenreiter/gui/manufacturers.cpp b/noncore/net/wellenreiter/gui/manufacturers.cpp index dad2753..f9f8967 100644 --- a/noncore/net/wellenreiter/gui/manufacturers.cpp +++ b/noncore/net/wellenreiter/gui/manufacturers.cpp | |||
@@ -1,60 +1,60 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #include "manufacturers.h" | 16 | #include "manufacturers.h" |
17 | 17 | ||
18 | // Qt | 18 | // Qt |
19 | #include <qstring.h> | 19 | #include <qstring.h> |
20 | #include <qfile.h> | 20 | #include <qfile.h> |
21 | #include <qtextstream.h> | 21 | #include <qtextstream.h> |
22 | 22 | ||
23 | ManufacturerDB::ManufacturerDB( const QString& filename ) | 23 | ManufacturerDB::ManufacturerDB( const QString& filename ) |
24 | { | 24 | { |
25 | QFile file( filename ); | 25 | QFile file( filename ); |
26 | bool hasFile = file.open( IO_ReadOnly ); | 26 | bool hasFile = file.open( IO_ReadOnly ); |
27 | if (!hasFile) | 27 | if (!hasFile) |
28 | { | 28 | { |
29 | qDebug( "ManufacturerDB: D'oh! Manufacturer list '%s' not found!", (const char*) filename ); | 29 | qDebug( "ManufacturerDB: D'oh! Manufacturer list '%s' not found!", (const char*) filename ); |
30 | } | 30 | } |
31 | else | 31 | else |
32 | { | 32 | { |
33 | qDebug( "ManufacturerDB: reading manufacturer list from '%s'...", (const char*) filename ); | 33 | qDebug( "ManufacturerDB: reading manufacturer list from '%s'...", (const char*) filename ); |
34 | QTextStream s( &file ); | 34 | QTextStream s( &file ); |
35 | QString addr; | 35 | QString addr; |
36 | QString manu; | 36 | QString manu; |
37 | 37 | ||
38 | while (!s.atEnd()) | 38 | while (!s.atEnd()) |
39 | { | 39 | { |
40 | s >> addr; | 40 | s >> addr; |
41 | s.skipWhiteSpace(); | 41 | s.skipWhiteSpace(); |
42 | manu = s.readLine(); | 42 | manu = s.readLine(); |
43 | #ifdef DEBUG | 43 | #ifdef DEBUG |
44 | qDebug( "ManufacturerDB: read pair %s, %s", (const char*) addr, (const char*) manu ); | 44 | //qDebug( "ManufacturerDB: read pair %s, %s", (const char*) addr, (const char*) manu ); |
45 | #endif | 45 | #endif |
46 | manufacturers.insert( addr, manu ); | 46 | manufacturers.insert( addr, manu ); |
47 | 47 | ||
48 | } | 48 | } |
49 | } | 49 | } |
50 | 50 | ||
51 | } | 51 | } |
52 | 52 | ||
53 | ManufacturerDB::~ManufacturerDB() | 53 | ManufacturerDB::~ManufacturerDB() |
54 | { | 54 | { |
55 | } | 55 | } |
56 | 56 | ||
57 | const QString& ManufacturerDB::lookup( const QString& macaddr ) const | 57 | const QString& ManufacturerDB::lookup( const QString& macaddr ) const |
58 | { | 58 | { |
59 | return manufacturers[macaddr.upper().left(8)]; | 59 | return manufacturers[macaddr.upper().left(8)]; |
60 | } | 60 | } |
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 4c53028..db7063b 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -16,268 +16,259 @@ | |||
16 | // Qt | 16 | // Qt |
17 | 17 | ||
18 | #include <qpushbutton.h> | 18 | #include <qpushbutton.h> |
19 | #include <qmessagebox.h> | 19 | #include <qmessagebox.h> |
20 | #include <qcombobox.h> | 20 | #include <qcombobox.h> |
21 | #include <qspinbox.h> | 21 | #include <qspinbox.h> |
22 | #include <qsocketnotifier.h> | 22 | #include <qsocketnotifier.h> |
23 | 23 | ||
24 | // Qtopia | 24 | // Qtopia |
25 | 25 | ||
26 | #ifdef QWS | 26 | #ifdef QWS |
27 | #include <qpe/qpeapplication.h> | 27 | #include <qpe/qpeapplication.h> |
28 | #include <qpe/global.h> | 28 | #include <qpe/global.h> |
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | // Opie | 31 | // Opie |
32 | 32 | ||
33 | #ifdef QWS | 33 | #ifdef QWS |
34 | #include <opie/odevice.h> | 34 | #include <opie/odevice.h> |
35 | using namespace Opie; | 35 | using namespace Opie; |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | // Standard | 38 | // Standard |
39 | 39 | ||
40 | #include <assert.h> | 40 | #include <assert.h> |
41 | #include <errno.h> | 41 | #include <errno.h> |
42 | #include <unistd.h> | 42 | #include <unistd.h> |
43 | #include <string.h> | 43 | #include <string.h> |
44 | #include <sys/types.h> | 44 | #include <sys/types.h> |
45 | #include <sys/socket.h> | 45 | #include <sys/socket.h> |
46 | #include <stdlib.h> | 46 | #include <stdlib.h> |
47 | #include <fcntl.h> | 47 | #include <fcntl.h> |
48 | 48 | ||
49 | // Local | 49 | // Local |
50 | 50 | ||
51 | #include "wellenreiter.h" | 51 | #include "wellenreiter.h" |
52 | #include "scanlist.h" | 52 | #include "scanlist.h" |
53 | #include "logwindow.h" | 53 | #include "logwindow.h" |
54 | #include "hexwindow.h" | 54 | #include "hexwindow.h" |
55 | #include "configwindow.h" | 55 | #include "configwindow.h" |
56 | 56 | ||
57 | #include "manufacturers.h" | 57 | #include "manufacturers.h" |
58 | 58 | ||
59 | #include <daemon/source/config.hh> | 59 | #include <daemon/source/config.hh> |
60 | #include <libwellenreiter/source/wl_types.hh> | 60 | #include <libwellenreiter/source/wl_types.hh> |
61 | #include <libwellenreiter/source/wl_sock.hh> | 61 | #include <libwellenreiter/source/wl_sock.hh> |
62 | #include <libwellenreiter/source/wl_proto.hh> | 62 | #include <libwellenreiter/source/wl_proto.hh> |
63 | 63 | ||
64 | Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) | 64 | Wellenreiter::Wellenreiter( QWidget* parent ) |
65 | : WellenreiterBase( parent, name, fl ), daemonRunning( false ), manufacturerdb( 0 ) | 65 | : WellenreiterBase( parent, 0, 0 ), |
66 | daemonRunning( false ), manufacturerdb( 0 ), configwindow( 0 ) | ||
66 | { | 67 | { |
67 | 68 | ||
68 | // | 69 | // |
69 | // construct manufacturer database | 70 | // construct manufacturer database |
70 | // | 71 | // |
71 | 72 | ||
72 | QString manufile; | 73 | QString manufile; |
73 | #ifdef QWS | 74 | #ifdef QWS |
74 | manufile.sprintf( "%s/share/wellenreiter/manufacturers.dat", (const char*) QPEApplication::qpeDir() ); | 75 | manufile.sprintf( "%s/share/wellenreiter/manufacturers.dat", (const char*) QPEApplication::qpeDir() ); |
75 | #else | 76 | #else |
76 | manufile.sprintf( "/home/mickey/work/opie/share/wellenreiter/manufacturers.dat" ); | 77 | manufile.sprintf( "/home/mickey/work/opie/share/wellenreiter/manufacturers.dat" ); |
77 | #endif | 78 | #endif |
78 | manufacturerdb = new ManufacturerDB( manufile ); | 79 | manufacturerdb = new ManufacturerDB( manufile ); |
79 | 80 | ||
80 | logwindow->log( "(i) Wellenreiter has been started." ); | 81 | logwindow->log( "(i) Wellenreiter has been started." ); |
81 | 82 | ||
82 | // | 83 | // |
83 | // detect operating system | 84 | // detect operating system |
84 | // | 85 | // |
85 | 86 | ||
86 | #ifdef QWS | 87 | #ifdef QWS |
87 | QString sys; | 88 | QString sys; |
88 | sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() ); | 89 | sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() ); |
89 | _system = ODevice::inst()->system(); | 90 | _system = ODevice::inst()->system(); |
90 | logwindow->log( sys ); | 91 | logwindow->log( sys ); |
91 | #endif | 92 | #endif |
92 | 93 | ||
93 | // | 94 | // |
94 | // setup socket for daemon communication, register socket notifier | 95 | // setup socket for daemon communication, register socket notifier |
95 | // | 96 | // |
96 | 97 | ||
97 | // struct sockaddr_in sockaddr; | 98 | // struct sockaddr_in sockaddr; |
98 | daemon_fd = wl_setupsock( GUIADDR, GUIPORT, sockaddr ); | 99 | daemon_fd = wl_setupsock( GUIADDR, GUIPORT, sockaddr ); |
99 | if ( daemon_fd == -1 ) | 100 | if ( daemon_fd == -1 ) |
100 | { | 101 | { |
101 | logwindow->log( "(E) Couldn't get file descriptor for commsocket." ); | 102 | logwindow->log( "(E) Couldn't get file descriptor for commsocket." ); |
102 | } | 103 | } |
103 | else | 104 | else |
104 | { | 105 | { |
105 | int flags; | 106 | int flags; |
106 | flags = fcntl( daemon_fd, F_GETFL, 0 ); | 107 | flags = fcntl( daemon_fd, F_GETFL, 0 ); |
107 | fcntl( daemon_fd, F_SETFL, flags | O_NONBLOCK ); | 108 | fcntl( daemon_fd, F_SETFL, flags | O_NONBLOCK ); |
108 | QSocketNotifier *sn = new QSocketNotifier( daemon_fd, QSocketNotifier::Read, parent ); | 109 | QSocketNotifier *sn = new QSocketNotifier( daemon_fd, QSocketNotifier::Read, parent ); |
109 | connect( sn, SIGNAL( activated( int ) ), this, SLOT( dataReceived() ) ); | 110 | connect( sn, SIGNAL( activated( int ) ), this, SLOT( dataReceived() ) ); |
110 | } | 111 | } |
111 | 112 | ||
112 | // setup GUI | 113 | // setup GUI |
113 | |||
114 | connect( button, SIGNAL( clicked() ), this, SLOT( buttonClicked() ) ); | ||
115 | // button->setEnabled( false ); | ||
116 | netview->setColumnWidthMode( 1, QListView::Manual ); | 114 | netview->setColumnWidthMode( 1, QListView::Manual ); |
117 | 115 | ||
118 | if ( manufacturerdb ) | 116 | if ( manufacturerdb ) |
119 | netview->setManufacturerDB( manufacturerdb ); | 117 | netview->setManufacturerDB( manufacturerdb ); |
120 | 118 | ||
121 | } | 119 | } |
122 | 120 | ||
123 | Wellenreiter::~Wellenreiter() | 121 | Wellenreiter::~Wellenreiter() |
124 | { | 122 | { |
125 | // no need to delete child widgets, Qt does it all for us | 123 | // no need to delete child widgets, Qt does it all for us |
126 | 124 | ||
127 | delete manufacturerdb; | 125 | delete manufacturerdb; |
128 | } | 126 | } |
129 | 127 | ||
128 | void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) | ||
129 | { | ||
130 | configwindow = cw; | ||
131 | } | ||
132 | |||
130 | void Wellenreiter::handleMessage() | 133 | void Wellenreiter::handleMessage() |
131 | { | 134 | { |
132 | // FIXME: receive message and handle it | 135 | // FIXME: receive message and handle it |
133 | 136 | ||
134 | qDebug( "received message from daemon." ); | 137 | qDebug( "received message from daemon." ); |
135 | 138 | ||
136 | /*char buffer[10000]; | 139 | /*char buffer[10000]; |
137 | memset( &buffer, 0, sizeof( buffer ) );*/ | 140 | memset( &buffer, 0, sizeof( buffer ) );*/ |
138 | 141 | ||
139 | char buffer[WL_SOCKBUF]; | 142 | char buffer[WL_SOCKBUF]; |
140 | 143 | ||
141 | // int result = #wl_recv( &daemon_fd, (char*) &buffer, sizeof(buffer) ); | 144 | // int result = #wl_recv( &daemon_fd, (char*) &buffer, sizeof(buffer) ); |
142 | 145 | ||
143 | /* | 146 | /* |
144 | 147 | ||
145 | struct sockaddr from; | 148 | struct sockaddr from; |
146 | socklen_t len; | 149 | socklen_t len; |
147 | 150 | ||
148 | int result = recvfrom( daemon_fd, &buffer, 8192, MSG_WAITALL, &from, &len ); | 151 | int result = recvfrom( daemon_fd, &buffer, 8192, MSG_WAITALL, &from, &len ); |
149 | qDebug( "received %d from recv [%d bytes]", result, len ); | 152 | qDebug( "received %d from recv [%d bytes]", result, len ); |
150 | 153 | ||
151 | */ | 154 | */ |
152 | 155 | ||
153 | int result = wl_recv( &daemon_fd, sockaddr, (char*) &buffer, WL_SOCKBUF ); | 156 | int result = wl_recv( &daemon_fd, sockaddr, (char*) &buffer, WL_SOCKBUF ); |
154 | 157 | ||
155 | if ( result == -1 ) | 158 | if ( result == -1 ) |
156 | { | 159 | { |
157 | qDebug( "Warning: %s", strerror( errno ) ); | 160 | qDebug( "Warning: %s", strerror( errno ) ); |
158 | return; | 161 | return; |
159 | } | 162 | } |
160 | 163 | ||
161 | int command = buffer[1] - 48; | 164 | int command = buffer[1] - 48; |
162 | 165 | ||
163 | /* | 166 | /* |
164 | typedef struct { | 167 | typedef struct { |
165 | int net_type; 1 = Accesspoint ; 2 = Ad-Hoc | 168 | int net_type; 1 = Accesspoint ; 2 = Ad-Hoc |
166 | int ssid_len; Length of SSID | 169 | int ssid_len; Length of SSID |
167 | int channel; Channel | 170 | int channel; Channel |
168 | int wep; 1 = WEP enabled ; 0 = disabled | 171 | int wep; 1 = WEP enabled ; 0 = disabled |
169 | char mac[64]; MAC address of Accesspoint | 172 | char mac[64]; MAC address of Accesspoint |
170 | char bssid[128]; BSSID of Accesspoint | 173 | char bssid[128]; BSSID of Accesspoint |
171 | } wl_network_t; | 174 | } wl_network_t; |
172 | */ | 175 | */ |
173 | 176 | ||
174 | qDebug( "Recv result: %d", ( result ) ); | 177 | qDebug( "Recv result: %d", ( result ) ); |
175 | qDebug( "Sniffer sent: '%s'", (const char*) buffer ); | 178 | qDebug( "Sniffer sent: '%s'", (const char*) buffer ); |
176 | hexwindow->log( (const char*) &buffer ); | 179 | hexwindow->log( (const char*) &buffer ); |
177 | 180 | ||
178 | if ( command == NETFOUND ) /* new network found */ | 181 | if ( command == NETFOUND ) /* new network found */ |
179 | { | 182 | { |
180 | qDebug( "Sniffer said: new network found." ); | 183 | qDebug( "Sniffer said: new network found." ); |
181 | wl_network_t n; | 184 | wl_network_t n; |
182 | get_network_found( &n, (char*) &buffer ); | 185 | get_network_found( &n, (char*) &buffer ); |
183 | 186 | ||
184 | qDebug( "Sniffer said: net_type is %d.", n.net_type ); | 187 | qDebug( "Sniffer said: net_type is %d.", n.net_type ); |
185 | qDebug( "Sniffer said: MAC is %s", (const char*) &n.mac ); | 188 | qDebug( "Sniffer said: MAC is %s", (const char*) &n.mac ); |
186 | 189 | ||
187 | //n.bssid[n.ssid_len] = "\0"; | 190 | //n.bssid[n.ssid_len] = "\0"; |
188 | 191 | ||
189 | QString type; | 192 | QString type; |
190 | 193 | ||
191 | if ( n.net_type == 1 ) | 194 | if ( n.net_type == 1 ) |
192 | type = "managed"; | 195 | type = "managed"; |
193 | else | 196 | else |
194 | type = "adhoc"; | 197 | type = "adhoc"; |
195 | 198 | ||
196 | netview->addNewItem( type, n.bssid, QString( (const char*) &n.mac ), n.wep, n.channel, 0 ); | 199 | netview->addNewItem( type, n.bssid, QString( (const char*) &n.mac ), n.wep, n.channel, 0 ); |
197 | 200 | ||
198 | } | 201 | } |
199 | 202 | ||
200 | else | 203 | else |
201 | 204 | ||
202 | { | 205 | { |
203 | qDebug( "unknown sniffer command." ); | 206 | qDebug( "unknown sniffer command." ); |
204 | } | 207 | } |
205 | 208 | ||
206 | } | 209 | } |
207 | 210 | ||
208 | void Wellenreiter::dataReceived() | 211 | void Wellenreiter::dataReceived() |
209 | { | 212 | { |
210 | logwindow->log( "(d) Received data from daemon" ); | 213 | logwindow->log( "(d) Received data from daemon" ); |
211 | handleMessage(); | 214 | handleMessage(); |
212 | } | 215 | } |
213 | 216 | ||
214 | void Wellenreiter::buttonClicked() | 217 | void Wellenreiter::startStopClicked() |
215 | { | 218 | { |
216 | /* | ||
217 | // add some test stations, so that we can see if the GUI part works | ||
218 | addNewItem( "managed", "Vanille", "04:00:20:EF:A6:43", true, 6, 80 ); | ||
219 | addNewItem( "managed", "Vanille", "04:00:20:EF:A6:23", true, 11, 10 ); | ||
220 | addNewItem( "adhoc", "ELAN", "40:03:43:E7:16:22", false, 3, 10 ); | ||
221 | addNewItem( "adhoc", "ELAN", "40:03:53:E7:56:62", false, 3, 15 ); | ||
222 | addNewItem( "adhoc", "ELAN", "40:03:63:E7:56:E2", false, 3, 20 ); | ||
223 | */ | ||
224 | |||
225 | |||
226 | if ( daemonRunning ) | 219 | if ( daemonRunning ) |
227 | { | 220 | { |
228 | daemonRunning = false; | 221 | daemonRunning = false; |
229 | 222 | ||
230 | logwindow->log( "(i) Daemon has been stopped." ); | 223 | logwindow->log( "(i) Daemon has been stopped." ); |
231 | button->setText( tr( "Start Scanning" ) ); | ||
232 | setCaption( tr( "Wellenreiter/Opie" ) ); | 224 | setCaption( tr( "Wellenreiter/Opie" ) ); |
233 | 225 | ||
234 | // Stop daemon - ugly for now... later better | 226 | // Stop daemon - ugly for now... later better |
235 | 227 | ||
236 | system( "killall wellenreiterd" ); | 228 | system( "killall wellenreiterd" ); |
237 | 229 | ||
238 | // get configuration from config window | 230 | // get configuration from config window |
239 | 231 | ||
240 | const QString& interface = configwindow->interfaceName->currentText(); | 232 | const QString& interface = configwindow->interfaceName->currentText(); |
241 | 233 | ||
242 | // reset the interface trying to get it into a usable state again | 234 | // reset the interface trying to get it into a usable state again |
243 | 235 | ||
244 | QString cmdline; | 236 | QString cmdline; |
245 | cmdline.sprintf( "iwpriv %s monitor 0; ifdown %s; ifup %s", (const char*) interface, (const char*) interface, (const char*) interface ); | 237 | cmdline.sprintf( "iwpriv %s monitor 0; ifdown %s; ifup %s", (const char*) interface, (const char*) interface, (const char*) interface ); |
246 | system( cmdline ); | 238 | system( cmdline ); |
247 | 239 | ||
248 | // message the user | 240 | // message the user |
249 | 241 | ||
250 | QMessageBox::information( this, "Wellenreiter/Opie", "Your wireless card\nshould now be usable again." ); | 242 | QMessageBox::information( this, "Wellenreiter/Opie", "Your wireless card\nshould now be usable again." ); |
251 | } | 243 | } |
252 | 244 | ||
253 | else | 245 | else |
254 | { | 246 | { |
255 | 247 | ||
256 | // get configuration from config window | 248 | // get configuration from config window |
257 | 249 | ||
258 | const QString& interface = configwindow->interfaceName->currentText(); | 250 | const QString& interface = configwindow->interfaceName->currentText(); |
259 | const int cardtype = configwindow->daemonDeviceType(); | 251 | const int cardtype = configwindow->daemonDeviceType(); |
260 | const int interval = configwindow->daemonHopInterval(); | 252 | const int interval = configwindow->daemonHopInterval(); |
261 | 253 | ||
262 | if ( ( interface == "<select>" ) || ( cardtype == 0 ) ) | 254 | if ( ( interface == "<select>" ) || ( cardtype == 0 ) ) |
263 | { | 255 | { |
264 | QMessageBox::information( this, "Wellenreiter/Opie", "You must configure your\ndevice before scanning." ); | 256 | QMessageBox::information( this, "Wellenreiter/Opie", "Your device is not\nptoperly configured. Please reconfigure!" ); |
265 | return; | 257 | return; |
266 | } | 258 | } |
267 | 259 | ||
268 | // start wellenreiterd | 260 | // start wellenreiterd |
269 | 261 | ||
270 | QString cmdline; | 262 | QString cmdline; |
271 | cmdline.sprintf( "wellenreiterd %s %d &", (const char*) interface, cardtype ); | 263 | cmdline.sprintf( "wellenreiterd %s %d &", (const char*) interface, cardtype ); |
272 | 264 | ||
273 | qDebug( "about to execute '%s' ...", (const char*) cmdline ); | 265 | qDebug( "about to execute '%s' ...", (const char*) cmdline ); |
274 | system( cmdline ); | 266 | system( cmdline ); |
275 | qDebug( "done!" ); | 267 | qDebug( "done!" ); |
276 | 268 | ||
277 | logwindow->log( "(i) Daemon has been started." ); | 269 | logwindow->log( "(i) Daemon has been started." ); |
278 | daemonRunning = true; | 270 | daemonRunning = true; |
279 | button->setText( tr( "Stop Scanning" ) ); | ||
280 | setCaption( tr( "Scanning ..." ) ); | 271 | setCaption( tr( "Scanning ..." ) ); |
281 | 272 | ||
282 | } | 273 | } |
283 | } | 274 | } |
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h index 0ddc72c..a55d6a1 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.h +++ b/noncore/net/wellenreiter/gui/wellenreiter.h | |||
@@ -1,78 +1,79 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #ifndef WELLENREITER_H | 16 | #ifndef WELLENREITER_H |
17 | #define WELLENREITER_H | 17 | #define WELLENREITER_H |
18 | 18 | ||
19 | #include "wellenreiterbase.h" | 19 | #include "wellenreiterbase.h" |
20 | 20 | ||
21 | #ifdef QWS | 21 | #ifdef QWS |
22 | #include <opie/odevice.h> | 22 | #include <opie/odevice.h> |
23 | using namespace Opie; | 23 | using namespace Opie; |
24 | #endif | 24 | #endif |
25 | 25 | ||
26 | // ugly... not here! | 26 | // ugly... not here! |
27 | 27 | ||
28 | #include <assert.h> | 28 | #include <assert.h> |
29 | #include <errno.h> | 29 | #include <errno.h> |
30 | #include <unistd.h> | 30 | #include <unistd.h> |
31 | #include <string.h> | 31 | #include <string.h> |
32 | #include <sys/types.h> | 32 | #include <sys/types.h> |
33 | #include <sys/socket.h> | 33 | #include <sys/socket.h> |
34 | #include <stdlib.h> | 34 | #include <stdlib.h> |
35 | #include <fcntl.h> | 35 | #include <fcntl.h> |
36 | #include <daemon/source/config.hh> | 36 | #include <daemon/source/config.hh> |
37 | #include <libwellenreiter/source/wl_types.hh> | 37 | #include <libwellenreiter/source/wl_types.hh> |
38 | #include <libwellenreiter/source/wl_sock.hh> | 38 | #include <libwellenreiter/source/wl_sock.hh> |
39 | #include <libwellenreiter/source/wl_proto.hh> | 39 | #include <libwellenreiter/source/wl_proto.hh> |
40 | 40 | ||
41 | |||
42 | class QTimerEvent; | 41 | class QTimerEvent; |
43 | class QPixmap; | 42 | class QPixmap; |
44 | class ManufacturerDB; | 43 | class ManufacturerDB; |
44 | class WellenreiterConfigWindow; | ||
45 | 45 | ||
46 | class Wellenreiter : public WellenreiterBase { | 46 | class Wellenreiter : public WellenreiterBase { |
47 | Q_OBJECT | 47 | Q_OBJECT |
48 | 48 | ||
49 | public: | 49 | public: |
50 | 50 | Wellenreiter( QWidget* parent = 0 ); | |
51 | Wellenreiter( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | ||
52 | ~Wellenreiter(); | 51 | ~Wellenreiter(); |
53 | 52 | ||
54 | protected: | 53 | void setConfigWindow( WellenreiterConfigWindow* cw ); |
55 | 54 | ||
55 | protected: | ||
56 | bool daemonRunning; | 56 | bool daemonRunning; |
57 | 57 | ||
58 | public slots: | 58 | public slots: |
59 | void buttonClicked(); | ||
60 | void dataReceived(); | 59 | void dataReceived(); |
60 | void startStopClicked(); | ||
61 | 61 | ||
62 | private: | 62 | private: |
63 | int daemon_fd; // socket filedescriptor for udp communication socket | 63 | int daemon_fd; // socket filedescriptor for udp communication socket |
64 | #ifdef QWS | 64 | #ifdef QWS |
65 | OSystem _system; // Opie Operating System identifier | 65 | OSystem _system; // Opie Operating System identifier |
66 | #endif | 66 | #endif |
67 | void handleMessage(); | 67 | void handleMessage(); |
68 | 68 | ||
69 | ManufacturerDB* manufacturerdb; | 69 | ManufacturerDB* manufacturerdb; |
70 | WellenreiterConfigWindow* configwindow; | ||
70 | struct sockaddr_in sockaddr; | 71 | struct sockaddr_in sockaddr; |
71 | 72 | ||
72 | //void readConfig(); | 73 | //void readConfig(); |
73 | //void writeConfig(); | 74 | //void writeConfig(); |
74 | }; | 75 | }; |
75 | 76 | ||
76 | 77 | ||
77 | 78 | ||
78 | #endif | 79 | #endif |
diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp index da12f2b..3a703bc 100644 --- a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp | |||
@@ -1,181 +1,173 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ***********************************************************************/ | 14 | ***********************************************************************/ |
15 | 15 | ||
16 | #include "wellenreiterbase.h" | 16 | #include "wellenreiterbase.h" |
17 | 17 | ||
18 | #include <qheader.h> | 18 | #include <qheader.h> |
19 | #include <qlabel.h> | 19 | #include <qlabel.h> |
20 | #include <qlistview.h> | 20 | #include <qlistview.h> |
21 | #include <qmultilineedit.h> | 21 | #include <qmultilineedit.h> |
22 | #include <qpushbutton.h> | 22 | #include <qpushbutton.h> |
23 | #include <qlayout.h> | 23 | #include <qlayout.h> |
24 | #include <qvariant.h> | 24 | #include <qvariant.h> |
25 | #include <qtooltip.h> | 25 | #include <qtooltip.h> |
26 | #include <qwhatsthis.h> | 26 | #include <qwhatsthis.h> |
27 | #include <qimage.h> | 27 | #include <qimage.h> |
28 | #include <qpixmap.h> | 28 | #include <qpixmap.h> |
29 | 29 | ||
30 | #include "logwindow.h" | 30 | #include "logwindow.h" |
31 | #include "hexwindow.h" | 31 | #include "hexwindow.h" |
32 | #include "configwindow.h" | ||
33 | #include "scanlist.h" | 32 | #include "scanlist.h" |
34 | 33 | ||
35 | #ifdef QWS | 34 | #ifdef QWS |
36 | #include <qpe/resource.h> | 35 | #include <qpe/resource.h> |
37 | #include <opie/otabwidget.h> | 36 | #include <opie/otabwidget.h> |
38 | #else | 37 | #else |
39 | #include "resource.h" | 38 | #include "resource.h" |
40 | #include <qtabwidget.h> | 39 | #include <qtabwidget.h> |
41 | #endif | 40 | #endif |
42 | 41 | ||
43 | 42 | ||
44 | /* | 43 | /* |
45 | * Constructs a WellenreiterBase which is a child of 'parent', with the | 44 | * Constructs a WellenreiterBase which is a child of 'parent', with the |
46 | * name 'name' and widget flags set to 'f' | 45 | * name 'name' and widget flags set to 'f' |
47 | */ | 46 | */ |
48 | WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl ) | 47 | WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl ) |
49 | : QWidget( parent, name, fl ) | 48 | : QWidget( parent, name, fl ) |
50 | { | 49 | { |
51 | //ani1 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot0" ) ); | 50 | //ani1 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot0" ) ); |
52 | //ani2 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot90" ) ); | 51 | //ani2 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot90" ) ); |
53 | //ani3 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot180" ) ); | 52 | //ani3 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot180" ) ); |
54 | //ani4 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot270" ) ); | 53 | //ani4 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot270" ) ); |
55 | 54 | ||
56 | if ( !name ) | 55 | if ( !name ) |
57 | setName( "WellenreiterBase" ); | 56 | setName( "WellenreiterBase" ); |
58 | resize( 191, 294 ); | 57 | resize( 191, 294 ); |
59 | setCaption( tr( "Wellenreiter" ) ); | 58 | #ifdef QWS |
60 | WellenreiterBaseLayout = new QVBoxLayout( this ); | 59 | setCaption( tr( "Wellenreiter/Opie" ) ); |
60 | #else | ||
61 | setCaption( tr( "Wellenreiter/X11" ) ); | ||
62 | #endif | ||
63 | WellenreiterBaseLayout = new QVBoxLayout( this ); | ||
61 | WellenreiterBaseLayout->setSpacing( 2 ); | 64 | WellenreiterBaseLayout->setSpacing( 2 ); |
62 | WellenreiterBaseLayout->setMargin( 0 ); | 65 | WellenreiterBaseLayout->setMargin( 0 ); |
63 | #ifdef QWS | 66 | #ifdef QWS |
64 | TabWidget = new OTabWidget( this, "TabWidget", OTabWidget::Global ); | 67 | TabWidget = new OTabWidget( this, "TabWidget", OTabWidget::Global ); |
65 | #else | 68 | #else |
66 | TabWidget = new QTabWidget( this, "TabWidget" ); | 69 | TabWidget = new QTabWidget( this, "TabWidget" ); |
67 | #endif | 70 | #endif |
68 | ap = new QWidget( TabWidget, "ap" ); | 71 | ap = new QWidget( TabWidget, "ap" ); |
69 | apLayout = new QVBoxLayout( ap ); | 72 | apLayout = new QVBoxLayout( ap ); |
70 | apLayout->setSpacing( 2 ); | 73 | apLayout->setSpacing( 2 ); |
71 | apLayout->setMargin( 2 ); | 74 | apLayout->setMargin( 2 ); |
72 | 75 | ||
73 | //--------- NETVIEW TAB -------------- | 76 | //--------- NETVIEW TAB -------------- |
74 | 77 | ||
75 | netview = new MScanListView( ap ); | 78 | netview = new MScanListView( ap ); |
76 | apLayout->addWidget( netview ); | 79 | apLayout->addWidget( netview ); |
77 | 80 | ||
78 | 81 | ||
79 | //--------- LOG TAB -------------- | 82 | //--------- LOG TAB -------------- |
80 | 83 | ||
81 | logwindow = new MLogWindow( TabWidget, "Log" ); | 84 | logwindow = new MLogWindow( TabWidget, "Log" ); |
82 | 85 | ||
83 | 86 | ||
84 | //--------- HEX TAB -------------- | 87 | //--------- HEX TAB -------------- |
85 | 88 | ||
86 | hexwindow = new MHexWindow( TabWidget, "Hex" ); | 89 | hexwindow = new MHexWindow( TabWidget, "Hex" ); |
87 | 90 | ||
88 | //--------- CONFIG TAB -------------- | ||
89 | |||
90 | configwindow = new WellenreiterConfigWindow( TabWidget, "Config" ); | ||
91 | |||
92 | //--------- ABOUT TAB -------------- | 91 | //--------- ABOUT TAB -------------- |
93 | 92 | ||
94 | about = new QWidget( TabWidget, "about" ); | 93 | about = new QWidget( TabWidget, "about" ); |
95 | aboutLayout = new QGridLayout( about ); | 94 | aboutLayout = new QGridLayout( about ); |
96 | aboutLayout->setSpacing( 6 ); | 95 | aboutLayout->setSpacing( 6 ); |
97 | aboutLayout->setMargin( 11 ); | 96 | aboutLayout->setMargin( 11 ); |
98 | 97 | ||
99 | PixmapLabel1_3_2 = new QLabel( about, "PixmapLabel1_3_2" ); | 98 | PixmapLabel1_3_2 = new QLabel( about, "PixmapLabel1_3_2" ); |
100 | PixmapLabel1_3_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, PixmapLabel1_3_2->sizePolicy().hasHeightForWidth() ) ); | 99 | PixmapLabel1_3_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, PixmapLabel1_3_2->sizePolicy().hasHeightForWidth() ) ); |
101 | PixmapLabel1_3_2->setFrameShape( QLabel::Panel ); | 100 | PixmapLabel1_3_2->setFrameShape( QLabel::Panel ); |
102 | PixmapLabel1_3_2->setFrameShadow( QLabel::Sunken ); | 101 | PixmapLabel1_3_2->setFrameShadow( QLabel::Sunken ); |
103 | PixmapLabel1_3_2->setLineWidth( 2 ); | 102 | PixmapLabel1_3_2->setLineWidth( 2 ); |
104 | PixmapLabel1_3_2->setMargin( 0 ); | 103 | PixmapLabel1_3_2->setMargin( 0 ); |
105 | PixmapLabel1_3_2->setMidLineWidth( 0 ); | 104 | PixmapLabel1_3_2->setMidLineWidth( 0 ); |
106 | PixmapLabel1_3_2->setPixmap( Resource::loadPixmap( "wellenreiter/logo" ) ); | 105 | PixmapLabel1_3_2->setPixmap( Resource::loadPixmap( "wellenreiter/logo" ) ); |
107 | PixmapLabel1_3_2->setScaledContents( TRUE ); | 106 | PixmapLabel1_3_2->setScaledContents( TRUE ); |
108 | PixmapLabel1_3_2->setAlignment( int( QLabel::AlignCenter ) ); | 107 | PixmapLabel1_3_2->setAlignment( int( QLabel::AlignCenter ) ); |
109 | 108 | ||
110 | aboutLayout->addWidget( PixmapLabel1_3_2, 0, 0 ); | 109 | aboutLayout->addWidget( PixmapLabel1_3_2, 0, 0 ); |
111 | 110 | ||
112 | TextLabel1_4_2 = new QLabel( about, "TextLabel1_4_2" ); | 111 | TextLabel1_4_2 = new QLabel( about, "TextLabel1_4_2" ); |
113 | QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); | 112 | QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); |
114 | TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); | 113 | TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); |
115 | TextLabel1_4_2_font.setPointSize( 10 ); | 114 | TextLabel1_4_2_font.setPointSize( 10 ); |
116 | TextLabel1_4_2->setFont( TextLabel1_4_2_font ); | 115 | TextLabel1_4_2->setFont( TextLabel1_4_2_font ); |
117 | TextLabel1_4_2->setText( tr( "<p align=center>\n" | 116 | TextLabel1_4_2->setText( tr( "<p align=center>\n" |
118 | "<hr>\n" | 117 | "<hr>\n" |
119 | "Max Moser<br>\n" | 118 | "Max Moser<br>\n" |
120 | "Martin J. Muench<br>\n" | 119 | "Martin J. Muench<br>\n" |
121 | "Michael Lauer<br><hr>\n" | 120 | "Michael Lauer<br><hr>\n" |
122 | "<b>www.remote-exploit.org</b>\n" | 121 | "<b>www.remote-exploit.org</b>\n" |
123 | "</p>" ) ); | 122 | "</p>" ) ); |
124 | TextLabel1_4_2->setAlignment( int( QLabel::AlignCenter ) ); | 123 | TextLabel1_4_2->setAlignment( int( QLabel::AlignCenter ) ); |
125 | 124 | ||
126 | aboutLayout->addWidget( TextLabel1_4_2, 1, 0 ); | 125 | aboutLayout->addWidget( TextLabel1_4_2, 1, 0 ); |
127 | |||
128 | button = new QPushButton( this, "button" ); | ||
129 | button->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, button->sizePolicy().hasHeightForWidth() ) ); | ||
130 | button->setText( tr( "Start Scanning" ) ); | ||
131 | 126 | ||
132 | #ifdef QWS | 127 | #ifdef QWS |
133 | TabWidget->addTab( ap, "wellenreiter/networks", tr( "Networks" ) ); | 128 | TabWidget->addTab( ap, "wellenreiter/networks", tr( "Networks" ) ); |
134 | TabWidget->addTab( logwindow, "wellenreiter/log", tr( "Log" ) ); | 129 | TabWidget->addTab( logwindow, "wellenreiter/log", tr( "Log" ) ); |
135 | TabWidget->addTab( hexwindow, "wellenreiter/hex", tr( "Hex" ) ); | 130 | TabWidget->addTab( hexwindow, "wellenreiter/hex", tr( "Hex" ) ); |
136 | TabWidget->addTab( configwindow, "wellenreiter/config", tr( "Config" ) ); | ||
137 | TabWidget->addTab( about, "wellenreiter/about", tr( "About" ) ); | 131 | TabWidget->addTab( about, "wellenreiter/about", tr( "About" ) ); |
138 | #else | 132 | #else |
139 | TabWidget->addTab( ap, /* "wellenreiter/networks", */ tr( "Networks" ) ); | 133 | TabWidget->addTab( ap, /* "wellenreiter/networks", */ tr( "Networks" ) ); |
140 | TabWidget->addTab( logwindow, /* "wellenreiter/log", */ tr( "Log" ) ); | 134 | TabWidget->addTab( logwindow, /* "wellenreiter/log", */ tr( "Log" ) ); |
141 | TabWidget->addTab( hexwindow, /* "wellenreiter/hex", */ tr( "Hex" ) ); | 135 | TabWidget->addTab( hexwindow, /* "wellenreiter/hex", */ tr( "Hex" ) ); |
142 | TabWidget->addTab( configwindow, /* "wellenreiter/config", */ tr( "Config" ) ); | ||
143 | TabWidget->addTab( about, /* "wellenreiter/about", */ tr( "About" ) ); | 136 | TabWidget->addTab( about, /* "wellenreiter/about", */ tr( "About" ) ); |
144 | #endif | 137 | #endif |
145 | WellenreiterBaseLayout->addWidget( TabWidget ); | 138 | WellenreiterBaseLayout->addWidget( TabWidget ); |
146 | WellenreiterBaseLayout->addWidget( button ); | ||
147 | 139 | ||
148 | #ifdef QWS | 140 | #ifdef QWS |
149 | TabWidget->setCurrentTab( tr( "Networks" ) ); | 141 | TabWidget->setCurrentTab( tr( "Networks" ) ); |
150 | #endif | 142 | #endif |
151 | 143 | ||
152 | } | 144 | } |
153 | 145 | ||
154 | /* | 146 | /* |
155 | * Destroys the object and frees any allocated resources | 147 | * Destroys the object and frees any allocated resources |
156 | */ | 148 | */ |
157 | WellenreiterBase::~WellenreiterBase() | 149 | WellenreiterBase::~WellenreiterBase() |
158 | { | 150 | { |
159 | // no need to delete child widgets, Qt does it all for us | 151 | // no need to delete child widgets, Qt does it all for us |
160 | } | 152 | } |
161 | 153 | ||
162 | /* | 154 | /* |
163 | * Main event handler. Reimplemented to handle application | 155 | * Main event handler. Reimplemented to handle application |
164 | * font changes | 156 | * font changes |
165 | */ | 157 | */ |
166 | bool WellenreiterBase::event( QEvent* ev ) | 158 | bool WellenreiterBase::event( QEvent* ev ) |
167 | { | 159 | { |
168 | bool ret = QWidget::event( ev ); | 160 | bool ret = QWidget::event( ev ); |
169 | if ( ev->type() == QEvent::ApplicationFontChange ) { | 161 | if ( ev->type() == QEvent::ApplicationFontChange ) { |
170 | //QFont Log_2_font( Log_2->font() ); | 162 | //QFont Log_2_font( Log_2->font() ); |
171 | //Log_2_font.setFamily( "adobe-courier" ); | 163 | //Log_2_font.setFamily( "adobe-courier" ); |
172 | //Log_2_font.setPointSize( 8 ); | 164 | //Log_2_font.setPointSize( 8 ); |
173 | //Log_2->setFont( Log_2_font ); | 165 | //Log_2->setFont( Log_2_font ); |
174 | QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); | 166 | QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); |
175 | TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); | 167 | TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); |
176 | TextLabel1_4_2_font.setPointSize( 10 ); | 168 | TextLabel1_4_2_font.setPointSize( 10 ); |
177 | TextLabel1_4_2->setFont( TextLabel1_4_2_font ); | 169 | TextLabel1_4_2->setFont( TextLabel1_4_2_font ); |
178 | } | 170 | } |
179 | return ret; | 171 | return ret; |
180 | } | 172 | } |
181 | 173 | ||
diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.h b/noncore/net/wellenreiter/gui/wellenreiterbase.h index edb2930..1fa1ea3 100644 --- a/noncore/net/wellenreiter/gui/wellenreiterbase.h +++ b/noncore/net/wellenreiter/gui/wellenreiterbase.h | |||
@@ -1,75 +1,72 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #ifndef WELLENREITERBASE_H | 16 | #ifndef WELLENREITERBASE_H |
17 | #define WELLENREITERBASE_H | 17 | #define WELLENREITERBASE_H |
18 | 18 | ||
19 | #include <qvariant.h> | 19 | #include <qvariant.h> |
20 | #include <qwidget.h> | 20 | #include <qwidget.h> |
21 | class QVBoxLayout; | 21 | class QVBoxLayout; |
22 | class QHBoxLayout; | 22 | class QHBoxLayout; |
23 | class QGridLayout; | 23 | class QGridLayout; |
24 | class QLabel; | 24 | class QLabel; |
25 | class MScanListView; | 25 | class MScanListView; |
26 | class MScanListItem; | 26 | class MScanListItem; |
27 | class QPushButton; | 27 | class QPushButton; |
28 | class MLogWindow; | 28 | class MLogWindow; |
29 | class MHexWindow; | 29 | class MHexWindow; |
30 | class WellenreiterConfigWindow; | ||
31 | 30 | ||
32 | #ifdef QWS | 31 | #ifdef QWS |
33 | class OTabWidget; | 32 | class OTabWidget; |
34 | #else | 33 | #else |
35 | class QTabWidget; | 34 | class QTabWidget; |
36 | #endif | 35 | #endif |
37 | 36 | ||
38 | class WellenreiterBase : public QWidget | 37 | class WellenreiterBase : public QWidget |
39 | { | 38 | { |
40 | Q_OBJECT | 39 | Q_OBJECT |
41 | 40 | ||
42 | public: | 41 | public: |
43 | WellenreiterBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 42 | WellenreiterBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
44 | ~WellenreiterBase(); | 43 | ~WellenreiterBase(); |
45 | 44 | ||
46 | #ifdef QWS | 45 | #ifdef QWS |
47 | OTabWidget* TabWidget; | 46 | OTabWidget* TabWidget; |
48 | #else | 47 | #else |
49 | QTabWidget* TabWidget; | 48 | QTabWidget* TabWidget; |
50 | #endif | 49 | #endif |
51 | QWidget* ap; | 50 | QWidget* ap; |
52 | MScanListView* netview; | 51 | MScanListView* netview; |
53 | MLogWindow* logwindow; | 52 | MLogWindow* logwindow; |
54 | MHexWindow* hexwindow; | 53 | MHexWindow* hexwindow; |
55 | WellenreiterConfigWindow* configwindow; | ||
56 | QWidget* about; | 54 | QWidget* about; |
57 | QLabel* PixmapLabel1_3_2; | 55 | QLabel* PixmapLabel1_3_2; |
58 | QLabel* TextLabel1_4_2; | 56 | QLabel* TextLabel1_4_2; |
59 | QPushButton* button; | ||
60 | 57 | ||
61 | protected: | 58 | protected: |
62 | QVBoxLayout* WellenreiterBaseLayout; | 59 | QVBoxLayout* WellenreiterBaseLayout; |
63 | QVBoxLayout* apLayout; | 60 | QVBoxLayout* apLayout; |
64 | QGridLayout* aboutLayout; | 61 | QGridLayout* aboutLayout; |
65 | bool event( QEvent* ); | 62 | bool event( QEvent* ); |
66 | 63 | ||
67 | QPixmap* ani1; | 64 | QPixmap* ani1; |
68 | QPixmap* ani2; | 65 | QPixmap* ani2; |
69 | QPixmap* ani3; | 66 | QPixmap* ani3; |
70 | QPixmap* ani4; | 67 | QPixmap* ani4; |
71 | 68 | ||
72 | 69 | ||
73 | }; | 70 | }; |
74 | 71 | ||
75 | #endif // WELLENREITERBASE_H | 72 | #endif // WELLENREITERBASE_H |
diff --git a/noncore/net/wellenreiter/wellenreiter.pro b/noncore/net/wellenreiter/wellenreiter.pro index 6784af4..dd75c8c 100644 --- a/noncore/net/wellenreiter/wellenreiter.pro +++ b/noncore/net/wellenreiter/wellenreiter.pro | |||
@@ -1,6 +1,6 @@ | |||
1 | TEMPLATE = subdirs | 1 | TEMPLATE = subdirs |
2 | unix:SUBDIRS = libwellenreiter daemon gui contrib/orinoco_hopper | 2 | unix:SUBDIRS = libwellenreiter daemon gui |
3 | 3 | ||
4 | 4 | ||
5 | 5 | ||
6 | include ( $(OPIEDIR)/include.pro ) | 6 | include ( $(OPIEDIR)/include.pro ) |