-rw-r--r-- | noncore/net/wellenreiter/gui/main.cpp | 59 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 13 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiterbase.cpp | 2 |
3 files changed, 72 insertions, 2 deletions
diff --git a/noncore/net/wellenreiter/gui/main.cpp b/noncore/net/wellenreiter/gui/main.cpp index 8d4ef57..03da135 100644 --- a/noncore/net/wellenreiter/gui/main.cpp +++ b/noncore/net/wellenreiter/gui/main.cpp | |||
@@ -1,40 +1,99 @@ | |||
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 "mainwindow.h" | 16 | #include "mainwindow.h" |
17 | #ifdef QWS | 17 | #ifdef QWS |
18 | #include <opie2/oapplication.h> | 18 | #include <opie2/oapplication.h> |
19 | #else | 19 | #else |
20 | #include <qapplication.h> | 20 | #include <qapplication.h> |
21 | #endif | 21 | #endif |
22 | 22 | ||
23 | #include <qmessagebox.h> | ||
24 | #include <qstringlist.h> | ||
25 | |||
26 | // ==> OProcess | ||
27 | #include <qdir.h> | ||
28 | #include <qfileinfo.h> | ||
29 | #include <qregexp.h> | ||
30 | #include <qtextstream.h> | ||
31 | |||
32 | #include <errno.h> | ||
33 | #include <signal.h> | ||
34 | #include <string.h> | ||
35 | #include <unistd.h> | ||
36 | |||
23 | int main( int argc, char **argv ) | 37 | int main( int argc, char **argv ) |
24 | { | 38 | { |
25 | #ifdef QWS | 39 | #ifdef QWS |
26 | OApplication a( argc, argv, "Wellenreiter II" ); | 40 | OApplication a( argc, argv, "Wellenreiter II" ); |
27 | #else | 41 | #else |
28 | QApplication a( argc, argv ); | 42 | QApplication a( argc, argv ); |
29 | #endif | 43 | #endif |
30 | WellenreiterMainWindow* w = new WellenreiterMainWindow(); | 44 | WellenreiterMainWindow* w = new WellenreiterMainWindow(); |
31 | #ifdef QWS | 45 | #ifdef QWS |
32 | a.showMainWidget( w ); | 46 | a.showMainWidget( w ); |
33 | #else | 47 | #else |
34 | a.setMainWidget( w ); | 48 | a.setMainWidget( w ); |
35 | w->show(); | 49 | w->show(); |
36 | #endif | 50 | #endif |
51 | |||
52 | a.processEvents(); // show the window before doing the safety checks | ||
53 | int result = -1; | ||
54 | |||
55 | // root check | ||
56 | if ( getuid() ) | ||
57 | { | ||
58 | qWarning( "Wellenreiter: trying to run as non-root!" ); | ||
59 | result = QMessageBox::warning( w, " - Wellenreiter II - (non-root)", "You have started Wellenreiter II\n" | ||
60 | "as non-root. You will have\nonly limited functionality.\nProceed anyway?", | ||
61 | QMessageBox::Yes, QMessageBox::No ); | ||
62 | if ( result == QMessageBox::No ) return -1; | ||
63 | } | ||
64 | |||
65 | // dhcp check - NOT HERE! This really belongs as a static member to OProcess | ||
66 | // and I want to call it like that: if ( OProcess::isRunning( QString& ) ) ... | ||
67 | |||
68 | QString line; | ||
69 | QDir d = QDir( "/proc" ); | ||
70 | QStringList dirs = d.entryList( QDir::Dirs ); | ||
71 | QStringList::Iterator it; | ||
72 | for ( it = dirs.begin(); it != dirs.end(); ++it ) | ||
73 | { | ||
74 | //qDebug( "next entry: %s", (const char*) *it ); | ||
75 | QFile file( "/proc/"+*it+"/cmdline" ); | ||
76 | file.open( IO_ReadOnly ); | ||
77 | if ( !file.isOpen() ) continue; | ||
78 | QTextStream t( &file ); | ||
79 | line = t.readLine(); | ||
80 | //qDebug( "cmdline = %s", (const char*) line ); | ||
81 | if ( line.contains( "dhcp" ) ) break; | ||
82 | } | ||
83 | if ( line.contains( "dhcp" ) ) | ||
84 | { | ||
85 | qWarning( "Wellenreiter: found dhcp process #%d", (*it).toInt() ); | ||
86 | result = QMessageBox::warning( w, " - Wellenreiter II - (dhcp)", "You have a dhcp client running.\n" | ||
87 | "This can severly limit scanning!\nShould I kill it for you?", | ||
88 | QMessageBox::Yes, QMessageBox::No ); | ||
89 | if ( result == QMessageBox::Yes ) | ||
90 | { | ||
91 | if ( -1 == ::kill( (*it).toInt(), SIGTERM ) ) | ||
92 | qWarning( "Wellenreiter: can't kill process (%s)", result, strerror( errno ) ); | ||
93 | } | ||
94 | } | ||
95 | |||
37 | a.exec(); | 96 | a.exec(); |
38 | delete w; | 97 | delete w; |
39 | return 0; | 98 | return 0; |
40 | } | 99 | } |
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index be2a86e..b4b6aa3 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -1,378 +1,389 @@ | |||
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 | // Opie | 16 | // Opie |
17 | 17 | ||
18 | #ifdef QWS | 18 | #ifdef QWS |
19 | #include <opie/odevice.h> | 19 | #include <opie/odevice.h> |
20 | using namespace Opie; | 20 | using namespace Opie; |
21 | #endif | 21 | #endif |
22 | 22 | ||
23 | #ifdef QWS | 23 | #ifdef QWS |
24 | #include <opie2/oapplication.h> | 24 | #include <opie2/oapplication.h> |
25 | #else | 25 | #else |
26 | #include <qapplication.h> | 26 | #include <qapplication.h> |
27 | #endif | 27 | #endif |
28 | #include <opie2/onetwork.h> | 28 | #include <opie2/onetwork.h> |
29 | #include <opie2/opcap.h> | 29 | #include <opie2/opcap.h> |
30 | 30 | ||
31 | // Qt | 31 | // Qt |
32 | 32 | ||
33 | #include <qcheckbox.h> | 33 | #include <qcheckbox.h> |
34 | #include <qcombobox.h> | 34 | #include <qcombobox.h> |
35 | #include <qpushbutton.h> | 35 | #include <qpushbutton.h> |
36 | #include <qlineedit.h> | 36 | #include <qlineedit.h> |
37 | #include <qmessagebox.h> | 37 | #include <qmessagebox.h> |
38 | #include <qregexp.h> | ||
38 | #include <qspinbox.h> | 39 | #include <qspinbox.h> |
39 | #include <qtoolbutton.h> | 40 | #include <qtoolbutton.h> |
40 | #include <qmainwindow.h> | 41 | #include <qmainwindow.h> |
41 | 42 | ||
42 | // Standard | 43 | // Standard |
43 | 44 | ||
44 | #include <assert.h> | 45 | #include <assert.h> |
45 | #include <errno.h> | 46 | #include <errno.h> |
46 | #include <unistd.h> | 47 | #include <unistd.h> |
47 | #include <string.h> | 48 | #include <string.h> |
48 | #include <sys/types.h> | 49 | #include <sys/types.h> |
49 | #include <stdlib.h> | 50 | #include <stdlib.h> |
50 | 51 | ||
51 | // Local | 52 | // Local |
52 | 53 | ||
53 | #include "wellenreiter.h" | 54 | #include "wellenreiter.h" |
54 | #include "scanlist.h" | 55 | #include "scanlist.h" |
55 | #include "logwindow.h" | 56 | #include "logwindow.h" |
56 | #include "hexwindow.h" | 57 | #include "hexwindow.h" |
57 | #include "configwindow.h" | 58 | #include "configwindow.h" |
58 | #include "statwindow.h" | 59 | #include "statwindow.h" |
59 | #include "manufacturers.h" | 60 | #include "manufacturers.h" |
60 | 61 | ||
61 | Wellenreiter::Wellenreiter( QWidget* parent ) | 62 | Wellenreiter::Wellenreiter( QWidget* parent ) |
62 | : WellenreiterBase( parent, 0, 0 ), | 63 | : WellenreiterBase( parent, 0, 0 ), |
63 | sniffing( false ), iface( 0 ), manufacturerdb( 0 ), configwindow( 0 ) | 64 | sniffing( false ), iface( 0 ), manufacturerdb( 0 ), configwindow( 0 ) |
64 | { | 65 | { |
65 | 66 | ||
66 | // | 67 | // |
67 | // construct manufacturer database | 68 | // construct manufacturer database |
68 | // | 69 | // |
69 | 70 | ||
70 | QString manufile; | 71 | QString manufile; |
71 | #ifdef QWS | 72 | #ifdef QWS |
72 | manufile.sprintf( "%s/share/wellenreiter/manufacturers.dat", (const char*) QPEApplication::qpeDir() ); | 73 | manufile.sprintf( "%s/share/wellenreiter/manufacturers.dat", (const char*) QPEApplication::qpeDir() ); |
73 | #else | 74 | #else |
74 | manufile.sprintf( "/usr/local/share/wellenreiter/manufacturers.dat" ); | 75 | manufile.sprintf( "/usr/local/share/wellenreiter/manufacturers.dat" ); |
75 | #endif | 76 | #endif |
76 | manufacturerdb = new ManufacturerDB( manufile ); | 77 | manufacturerdb = new ManufacturerDB( manufile ); |
77 | 78 | ||
78 | logwindow->log( "(i) Wellenreiter has been started." ); | 79 | logwindow->log( "(i) Wellenreiter has been started." ); |
79 | 80 | ||
80 | // | 81 | // |
81 | // detect operating system | 82 | // detect operating system |
82 | // | 83 | // |
83 | 84 | ||
84 | #ifdef QWS | 85 | #ifdef QWS |
85 | QString sys; | 86 | QString sys; |
86 | sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() ); | 87 | sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() ); |
87 | _system = ODevice::inst()->system(); | 88 | _system = ODevice::inst()->system(); |
88 | logwindow->log( sys ); | 89 | logwindow->log( sys ); |
89 | #endif | 90 | #endif |
90 | 91 | ||
91 | // setup GUI | 92 | // setup GUI |
92 | netview->setColumnWidthMode( 1, QListView::Manual ); | 93 | netview->setColumnWidthMode( 1, QListView::Manual ); |
93 | 94 | ||
94 | if ( manufacturerdb ) | 95 | if ( manufacturerdb ) |
95 | netview->setManufacturerDB( manufacturerdb ); | 96 | netview->setManufacturerDB( manufacturerdb ); |
96 | 97 | ||
97 | pcap = new OPacketCapturer(); | 98 | pcap = new OPacketCapturer(); |
98 | 99 | ||
99 | } | 100 | } |
100 | 101 | ||
101 | 102 | ||
102 | Wellenreiter::~Wellenreiter() | 103 | Wellenreiter::~Wellenreiter() |
103 | { | 104 | { |
104 | // no need to delete child widgets, Qt does it all for us | 105 | // no need to delete child widgets, Qt does it all for us |
105 | 106 | ||
106 | delete manufacturerdb; | 107 | delete manufacturerdb; |
107 | delete pcap; | 108 | delete pcap; |
108 | } | 109 | } |
109 | 110 | ||
110 | 111 | ||
111 | void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) | 112 | void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) |
112 | { | 113 | { |
113 | configwindow = cw; | 114 | configwindow = cw; |
114 | } | 115 | } |
115 | 116 | ||
116 | 117 | ||
117 | void Wellenreiter::channelHopped(int c) | 118 | void Wellenreiter::channelHopped(int c) |
118 | { | 119 | { |
119 | QString title = "Wellenreiter II -scan- ["; | 120 | QString title = "Wellenreiter II -scan- ["; |
120 | QString left; | 121 | QString left; |
121 | if ( c > 1 ) left.fill( '.', c-1 ); | 122 | if ( c > 1 ) left.fill( '.', c-1 ); |
122 | title.append( left ); | 123 | title.append( left ); |
123 | title.append( '|' ); | 124 | title.append( '|' ); |
124 | if ( c < iface->channels() ) | 125 | if ( c < iface->channels() ) |
125 | { | 126 | { |
126 | QString right; | 127 | QString right; |
127 | right.fill( '.', iface->channels()-c ); | 128 | right.fill( '.', iface->channels()-c ); |
128 | title.append( right ); | 129 | title.append( right ); |
129 | } | 130 | } |
130 | title.append( "]" ); | 131 | title.append( "]" ); |
131 | //title.append( QString().sprintf( " %02d", c ) ); | 132 | //title.append( QString().sprintf( " %02d", c ) ); |
132 | assert( parent() ); | 133 | assert( parent() ); |
133 | ( (QMainWindow*) parent() )->setCaption( title ); | 134 | ( (QMainWindow*) parent() )->setCaption( title ); |
134 | } | 135 | } |
135 | 136 | ||
136 | 137 | ||
137 | void Wellenreiter::receivePacket(OPacket* p) | 138 | void Wellenreiter::receivePacket(OPacket* p) |
138 | { | 139 | { |
139 | hexWindow()->log( p->dump( 8 ) ); | 140 | hexWindow()->log( p->dump( 8 ) ); |
140 | 141 | ||
141 | // check if we received a beacon frame | 142 | // check if we received a beacon frame |
142 | OWaveLanManagementPacket* beacon = static_cast<OWaveLanManagementPacket*>( p->child( "802.11 Management" ) ); | 143 | OWaveLanManagementPacket* beacon = static_cast<OWaveLanManagementPacket*>( p->child( "802.11 Management" ) ); |
143 | if ( beacon && beacon->managementType() == "Beacon" ) | 144 | if ( beacon && beacon->managementType() == "Beacon" ) |
144 | { | 145 | { |
145 | QString type; | 146 | QString type; |
146 | if ( beacon->canIBSS() ) | 147 | if ( beacon->canIBSS() ) |
147 | { | 148 | { |
148 | type = "adhoc"; | 149 | type = "adhoc"; |
149 | } | 150 | } |
150 | else if ( beacon->canESS() ) | 151 | else if ( beacon->canESS() ) |
151 | { | 152 | { |
152 | type = "managed"; | 153 | type = "managed"; |
153 | } | 154 | } |
154 | else | 155 | else |
155 | { | 156 | { |
156 | qDebug( "Wellenreiter::invalid frame detected: '%s'", (const char*) p->dump( 16 ) ); | 157 | qDebug( "Wellenreiter::invalid frame detected: '%s'", (const char*) p->dump( 16 ) ); |
157 | return; | 158 | return; |
158 | } | 159 | } |
159 | 160 | ||
160 | OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); | 161 | OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); |
161 | QString essid = ssid ? ssid->ID() : QString("<unknown>"); | 162 | QString essid = ssid ? ssid->ID() : QString("<unknown>"); |
162 | OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) ); | 163 | OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) ); |
163 | int channel = ds ? ds->channel() : -1; | 164 | int channel = ds ? ds->channel() : -1; |
164 | 165 | ||
165 | OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); | 166 | OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); |
166 | netView()->addNewItem( type, essid, header->macAddress2().toString(), beacon->canPrivacy(), channel, 0 ); | 167 | netView()->addNewItem( type, essid, header->macAddress2().toString(), beacon->canPrivacy(), channel, 0 ); |
167 | return; | 168 | return; |
168 | } | 169 | } |
169 | 170 | ||
170 | // check for a data frame | 171 | // check for a data frame |
171 | OWaveLanDataPacket* data = static_cast<OWaveLanDataPacket*>( p->child( "802.11 Data" ) ); | 172 | OWaveLanDataPacket* data = static_cast<OWaveLanDataPacket*>( p->child( "802.11 Data" ) ); |
172 | if ( data ) | 173 | if ( data ) |
173 | { | 174 | { |
174 | OWaveLanPacket* wlan = (OWaveLanPacket*) p->child( "802.11" ); | 175 | OWaveLanPacket* wlan = (OWaveLanPacket*) p->child( "802.11" ); |
175 | if ( wlan->fromDS() && !wlan->toDS() ) | 176 | if ( wlan->fromDS() && !wlan->toDS() ) |
176 | { | 177 | { |
177 | qDebug( "FromDS traffic: '%s' -> '%s' via '%s'", | 178 | qDebug( "FromDS traffic: '%s' -> '%s' via '%s'", |
178 | (const char*) wlan->macAddress3().toString(true), | 179 | (const char*) wlan->macAddress3().toString(true), |
179 | (const char*) wlan->macAddress1().toString(true), | 180 | (const char*) wlan->macAddress1().toString(true), |
180 | (const char*) wlan->macAddress2().toString(true) ); | 181 | (const char*) wlan->macAddress2().toString(true) ); |
181 | netView()->traffic( "fromDS", wlan->macAddress3().toString(), | 182 | netView()->traffic( "fromDS", wlan->macAddress3().toString(), |
182 | wlan->macAddress1().toString(), | 183 | wlan->macAddress1().toString(), |
183 | wlan->macAddress2().toString() ); | 184 | wlan->macAddress2().toString() ); |
184 | } | 185 | } |
185 | else | 186 | else |
186 | if ( !wlan->fromDS() && wlan->toDS() ) | 187 | if ( !wlan->fromDS() && wlan->toDS() ) |
187 | { | 188 | { |
188 | qDebug( "ToDS traffic: '%s' -> '%s' via '%s'", | 189 | qDebug( "ToDS traffic: '%s' -> '%s' via '%s'", |
189 | (const char*) wlan->macAddress2().toString(true), | 190 | (const char*) wlan->macAddress2().toString(true), |
190 | (const char*) wlan->macAddress3().toString(true), | 191 | (const char*) wlan->macAddress3().toString(true), |
191 | (const char*) wlan->macAddress1().toString(true) ); | 192 | (const char*) wlan->macAddress1().toString(true) ); |
192 | netView()->traffic( "toDS", wlan->macAddress2().toString(), | 193 | netView()->traffic( "toDS", wlan->macAddress2().toString(), |
193 | wlan->macAddress3().toString(), | 194 | wlan->macAddress3().toString(), |
194 | wlan->macAddress1().toString() ); | 195 | wlan->macAddress1().toString() ); |
195 | } | 196 | } |
196 | else | 197 | else |
197 | if ( wlan->fromDS() && wlan->toDS() ) | 198 | if ( wlan->fromDS() && wlan->toDS() ) |
198 | { | 199 | { |
199 | qDebug( "WSD(bridge) traffic: '%s' -> '%s' via '%s' and '%s'", | 200 | qDebug( "WSD(bridge) traffic: '%s' -> '%s' via '%s' and '%s'", |
200 | (const char*) wlan->macAddress4().toString(true), | 201 | (const char*) wlan->macAddress4().toString(true), |
201 | (const char*) wlan->macAddress3().toString(true), | 202 | (const char*) wlan->macAddress3().toString(true), |
202 | (const char*) wlan->macAddress1().toString(true), | 203 | (const char*) wlan->macAddress1().toString(true), |
203 | (const char*) wlan->macAddress2().toString(true) ); | 204 | (const char*) wlan->macAddress2().toString(true) ); |
204 | netView()->traffic( "WSD", wlan->macAddress4().toString(), | 205 | netView()->traffic( "WSD", wlan->macAddress4().toString(), |
205 | wlan->macAddress3().toString(), | 206 | wlan->macAddress3().toString(), |
206 | wlan->macAddress1().toString(), | 207 | wlan->macAddress1().toString(), |
207 | wlan->macAddress2().toString() ); | 208 | wlan->macAddress2().toString() ); |
208 | } | 209 | } |
209 | else | 210 | else |
210 | { | 211 | { |
211 | qDebug( "IBSS(AdHoc) traffic: '%s' -> '%s' (Cell: '%s')'", | 212 | qDebug( "IBSS(AdHoc) traffic: '%s' -> '%s' (Cell: '%s')'", |
212 | (const char*) wlan->macAddress2().toString(true), | 213 | (const char*) wlan->macAddress2().toString(true), |
213 | (const char*) wlan->macAddress1().toString(true), | 214 | (const char*) wlan->macAddress1().toString(true), |
214 | (const char*) wlan->macAddress3().toString(true) ); | 215 | (const char*) wlan->macAddress3().toString(true) ); |
215 | netView()->traffic( "IBSS", wlan->macAddress2().toString(), | 216 | netView()->traffic( "IBSS", wlan->macAddress2().toString(), |
216 | wlan->macAddress1().toString(), | 217 | wlan->macAddress1().toString(), |
217 | wlan->macAddress3().toString() ); | 218 | wlan->macAddress3().toString() ); |
218 | } | 219 | } |
219 | return; | 220 | return; |
220 | } | 221 | } |
221 | } | 222 | } |
222 | 223 | ||
223 | 224 | ||
224 | void Wellenreiter::stopClicked() | 225 | void Wellenreiter::stopClicked() |
225 | { | 226 | { |
226 | if ( iface ) | 227 | if ( iface ) |
227 | { | 228 | { |
228 | disconnect( SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); | 229 | disconnect( SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); |
229 | disconnect( SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); | 230 | disconnect( SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); |
230 | iface->setChannelHopping(); // stop hopping channels | 231 | iface->setChannelHopping(); // stop hopping channels |
231 | } | 232 | } |
232 | else | 233 | else |
233 | killTimers(); | 234 | killTimers(); |
234 | 235 | ||
235 | pcap->close(); | 236 | pcap->close(); |
236 | sniffing = false; | 237 | sniffing = false; |
237 | 238 | ||
238 | if ( iface ) | 239 | if ( iface ) |
239 | { | 240 | { |
240 | // switch off monitor mode | 241 | // switch off monitor mode |
241 | iface->setMonitorMode( false ); | 242 | iface->setMonitorMode( false ); |
242 | // switch off promisc flag | 243 | // switch off promisc flag |
243 | iface->setPromiscuousMode( false ); | 244 | iface->setPromiscuousMode( false ); |
244 | 245 | ||
245 | system( "cardctl reset; sleep 1" ); //FIXME: Use OProcess | 246 | system( "cardctl reset; sleep 1" ); //FIXME: Use OProcess |
246 | } | 247 | } |
247 | 248 | ||
248 | logwindow->log( "(i) Stopped Scanning." ); | 249 | logwindow->log( "(i) Stopped Scanning." ); |
249 | assert( parent() ); | 250 | assert( parent() ); |
250 | ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II" ); | 251 | ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II" ); |
251 | 252 | ||
252 | // message the user | 253 | // message the user |
253 | QMessageBox::information( this, "Wellenreiter II", "Your wireless card\nshould now be usable again." ); | 254 | QMessageBox::information( this, "Wellenreiter II", "Your wireless card\nshould now be usable again." ); |
254 | 255 | ||
255 | sniffing = false; | 256 | sniffing = false; |
256 | emit( stoppedSniffing() ); | 257 | emit( stoppedSniffing() ); |
257 | 258 | ||
258 | // print out statistics | 259 | // print out statistics |
259 | statwindow->log( "-----------------------------------------" ); | 260 | statwindow->log( "-----------------------------------------" ); |
260 | statwindow->log( "- Wellenreiter II Capturing Statistic -" ); | 261 | statwindow->log( "- Wellenreiter II Capturing Statistic -" ); |
261 | statwindow->log( "-----------------------------------------" ); | 262 | statwindow->log( "-----------------------------------------" ); |
262 | statwindow->log( "Packet Type | Receive Count" ); | 263 | statwindow->log( "Packet Type | Receive Count" ); |
263 | 264 | ||
264 | for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it ) | 265 | for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it ) |
265 | { | 266 | { |
266 | QString left; | 267 | QString left; |
267 | left.sprintf( "%s", (const char*) it.key() ); | 268 | left.sprintf( "%s", (const char*) it.key() ); |
268 | left = left.leftJustify( 20 ); | 269 | left = left.leftJustify( 20 ); |
269 | left.append( '|' ); | 270 | left.append( '|' ); |
270 | QString right; | 271 | QString right; |
271 | right.sprintf( "%d", it.data() ); | 272 | right.sprintf( "%d", it.data() ); |
272 | right = right.rightJustify( 7 ); | 273 | right = right.rightJustify( 7 ); |
273 | statwindow->log( left + right ); | 274 | statwindow->log( left + right ); |
274 | } | 275 | } |
275 | 276 | ||
276 | } | 277 | } |
277 | 278 | ||
278 | 279 | ||
279 | void Wellenreiter::startClicked() | 280 | void Wellenreiter::startClicked() |
280 | { | 281 | { |
281 | // get configuration from config window | 282 | // get configuration from config window |
282 | 283 | ||
283 | const QString& interface = configwindow->interfaceName->currentText(); | 284 | const QString& interface = configwindow->interfaceName->currentText(); |
284 | const int cardtype = configwindow->daemonDeviceType(); | 285 | const int cardtype = configwindow->daemonDeviceType(); |
285 | const int interval = configwindow->daemonHopInterval(); | 286 | const int interval = configwindow->daemonHopInterval(); |
286 | 287 | ||
287 | if ( ( interface == "" ) || ( cardtype == 0 ) ) | 288 | if ( ( interface == "" ) || ( cardtype == 0 ) ) |
288 | { | 289 | { |
289 | QMessageBox::information( this, "Wellenreiter II", "Your device is not\nproperly configured. Please reconfigure!" ); | 290 | QMessageBox::information( this, "Wellenreiter II", "Your device is not\nproperly configured. Please reconfigure!" ); |
290 | return; | 291 | return; |
291 | } | 292 | } |
292 | 293 | ||
293 | // configure device | 294 | // configure device |
294 | 295 | ||
295 | ONetwork* net = ONetwork::instance(); | 296 | ONetwork* net = ONetwork::instance(); |
296 | iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface )); | 297 | iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface )); |
297 | 298 | ||
298 | // set monitor mode | 299 | // set monitor mode |
299 | 300 | ||
300 | switch ( cardtype ) | 301 | switch ( cardtype ) |
301 | { | 302 | { |
302 | case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface ) ); break; | 303 | case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface ) ); break; |
303 | case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface ) ); break; | 304 | case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface ) ); break; |
304 | case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface ) ); break; | 305 | case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface ) ); break; |
305 | case DEVTYPE_ORINOCO: iface->setMonitoring( new OOrinocoMonitoringInterface( iface ) ); break; | 306 | case DEVTYPE_ORINOCO: iface->setMonitoring( new OOrinocoMonitoringInterface( iface ) ); break; |
306 | case DEVTYPE_MANUAL: QMessageBox::information( this, "Wellenreiter II", "Bring your device into\nmonitor mode now." ); break; | 307 | case DEVTYPE_MANUAL: QMessageBox::information( this, "Wellenreiter II", "Bring your device into\nmonitor mode now." ); break; |
307 | case DEVTYPE_FILE: qDebug( "Wellenreiter: Capturing from file '%s'", (const char*) interface ); break; | 308 | case DEVTYPE_FILE: qDebug( "Wellenreiter: Capturing from file '%s'", (const char*) interface ); break; |
308 | default: assert( 0 ); // shouldn't reach this | 309 | default: assert( 0 ); // shouldn't reach this |
309 | } | 310 | } |
310 | 311 | ||
311 | // switch device into monitor mode | 312 | // switch device into monitor mode |
312 | if ( cardtype < DEVTYPE_FILE ) | 313 | if ( cardtype < DEVTYPE_FILE ) |
313 | { | 314 | { |
314 | if ( cardtype != DEVTYPE_MANUAL ) | 315 | if ( cardtype != DEVTYPE_MANUAL ) |
315 | iface->setMonitorMode( true ); | 316 | iface->setMonitorMode( true ); |
316 | if ( !iface->monitorMode() ) | 317 | if ( !iface->monitorMode() ) |
317 | { | 318 | { |
318 | QMessageBox::warning( this, "Wellenreiter II", "Can't set device into monitor mode." ); | 319 | QMessageBox::warning( this, "Wellenreiter II", "Can't set device into monitor mode." ); |
319 | return; | 320 | return; |
320 | } | 321 | } |
321 | } | 322 | } |
322 | 323 | ||
323 | // open pcap and start sniffing | 324 | // open pcap and start sniffing |
324 | if ( cardtype != DEVTYPE_FILE ) | 325 | if ( cardtype != DEVTYPE_FILE ) |
325 | { | 326 | { |
326 | if ( configwindow->writeCaptureFile->isEnabled() ) | 327 | if ( configwindow->writeCaptureFile->isEnabled() ) |
327 | { | 328 | { |
328 | pcap->open( interface, configwindow->captureFileName->text() ); | 329 | QString dumpname( configwindow->captureFileName->text() ); |
330 | dumpname.append( '-' ); | ||
331 | dumpname.append( QTime::currentTime().toString().replace( QRegExp( ":" ), "-" ) ); | ||
332 | dumpname.append( ".wellenreiter" ); | ||
333 | pcap->open( interface, dumpname ); | ||
329 | } | 334 | } |
330 | else | 335 | else |
331 | { | 336 | { |
332 | pcap->open( interface ); | 337 | pcap->open( interface ); |
333 | } | 338 | } |
334 | } | 339 | } |
335 | else | 340 | else |
336 | { | 341 | { |
337 | pcap->open( QFile( interface ) ); | 342 | pcap->open( QFile( interface ) ); |
338 | } | 343 | } |
339 | 344 | ||
340 | if ( !pcap->isOpen() ) | 345 | if ( !pcap->isOpen() ) |
341 | { | 346 | { |
342 | QMessageBox::warning( this, "Wellenreiter II", "Can't open packet capturer:\n" + QString(strerror( errno ) )); | 347 | QMessageBox::warning( this, "Wellenreiter II", "Can't open packet capturer:\n" + QString(strerror( errno ) )); |
343 | return; | 348 | return; |
344 | } | 349 | } |
345 | 350 | ||
346 | // set capturer to non-blocking mode | 351 | // set capturer to non-blocking mode |
347 | pcap->setBlocking( false ); | 352 | pcap->setBlocking( false ); |
348 | 353 | ||
349 | // start channel hopper | 354 | // start channel hopper |
350 | if ( cardtype != DEVTYPE_FILE ) | 355 | if ( cardtype != DEVTYPE_FILE ) |
351 | iface->setChannelHopping( 1000 ); //use interval from config window | 356 | iface->setChannelHopping( 1000 ); //use interval from config window |
352 | 357 | ||
353 | if ( cardtype != DEVTYPE_FILE ) | 358 | if ( cardtype != DEVTYPE_FILE ) |
354 | { | 359 | { |
355 | // connect socket notifier and start channel hopper | 360 | // connect socket notifier and start channel hopper |
356 | connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); | 361 | connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); |
357 | connect( iface->channelHopper(), SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); | 362 | connect( iface->channelHopper(), SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); |
358 | } | 363 | } |
359 | else | 364 | else |
360 | { | 365 | { |
361 | // start timer for reading packets | 366 | // start timer for reading packets |
362 | startTimer( 100 ); | 367 | startTimer( 100 ); |
363 | } | 368 | } |
364 | 369 | ||
365 | logwindow->log( "(i) Started Scanning." ); | 370 | logwindow->log( "(i) Started Scanning." ); |
366 | sniffing = true; | 371 | sniffing = true; |
367 | emit( startedSniffing() ); | 372 | emit( startedSniffing() ); |
373 | if ( cardtype != DEVTYPE_FILE ) channelHopped( 6 ); // set title | ||
374 | else | ||
375 | { | ||
376 | assert( parent() ); | ||
377 | ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II - replaying capture file..." ); | ||
378 | } | ||
368 | } | 379 | } |
369 | 380 | ||
370 | 381 | ||
371 | void Wellenreiter::timerEvent( QTimerEvent* ) | 382 | void Wellenreiter::timerEvent( QTimerEvent* ) |
372 | { | 383 | { |
373 | qDebug( "Wellenreiter::timerEvent()" ); | 384 | qDebug( "Wellenreiter::timerEvent()" ); |
374 | OPacket* p = pcap->next(); | 385 | OPacket* p = pcap->next(); |
375 | receivePacket( p ); | 386 | receivePacket( p ); |
376 | delete p; | 387 | delete p; |
377 | } | 388 | } |
378 | 389 | ||
diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp index 245b9fc..9745069 100644 --- a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp | |||
@@ -1,178 +1,178 @@ | |||
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 "scanlist.h" | 32 | #include "scanlist.h" |
33 | #include "statwindow.h" | 33 | #include "statwindow.h" |
34 | 34 | ||
35 | #ifdef QWS | 35 | #ifdef QWS |
36 | #include <qpe/resource.h> | 36 | #include <qpe/resource.h> |
37 | #include <opie/otabwidget.h> | 37 | #include <opie/otabwidget.h> |
38 | #else | 38 | #else |
39 | #include "resource.h" | 39 | #include "resource.h" |
40 | #include <qtabwidget.h> | 40 | #include <qtabwidget.h> |
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | 43 | ||
44 | /* | 44 | /* |
45 | * Constructs a WellenreiterBase which is a child of 'parent', with the | 45 | * Constructs a WellenreiterBase which is a child of 'parent', with the |
46 | * name 'name' and widget flags set to 'f' | 46 | * name 'name' and widget flags set to 'f' |
47 | */ | 47 | */ |
48 | WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl ) | 48 | WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl ) |
49 | : QWidget( parent, name, fl ) | 49 | : QWidget( parent, name, fl ) |
50 | { | 50 | { |
51 | //ani1 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot0" ) ); | 51 | //ani1 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot0" ) ); |
52 | //ani2 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot90" ) ); | 52 | //ani2 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot90" ) ); |
53 | //ani3 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot180" ) ); | 53 | //ani3 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot180" ) ); |
54 | //ani4 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot270" ) ); | 54 | //ani4 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot270" ) ); |
55 | 55 | ||
56 | if ( !name ) | 56 | if ( !name ) |
57 | setName( "WellenreiterBase" ); | 57 | setName( "WellenreiterBase" ); |
58 | resize( 191, 294 ); | 58 | resize( 191, 294 ); |
59 | #ifdef QWS | 59 | #ifdef QWS |
60 | setCaption( tr( "Wellenreiter/Opie" ) ); | 60 | setCaption( tr( "Wellenreiter/Opie" ) ); |
61 | #else | 61 | #else |
62 | setCaption( tr( "Wellenreiter/X11" ) ); | 62 | setCaption( tr( "Wellenreiter/X11" ) ); |
63 | #endif | 63 | #endif |
64 | WellenreiterBaseLayout = new QVBoxLayout( this ); | 64 | WellenreiterBaseLayout = new QVBoxLayout( this ); |
65 | WellenreiterBaseLayout->setSpacing( 2 ); | 65 | WellenreiterBaseLayout->setSpacing( 2 ); |
66 | WellenreiterBaseLayout->setMargin( 0 ); | 66 | WellenreiterBaseLayout->setMargin( 0 ); |
67 | #ifdef QWS | 67 | #ifdef QWS |
68 | TabWidget = new OTabWidget( this, "TabWidget", OTabWidget::Global ); | 68 | TabWidget = new OTabWidget( this, "TabWidget", OTabWidget::Global ); |
69 | #else | 69 | #else |
70 | TabWidget = new QTabWidget( this, "TabWidget" ); | 70 | TabWidget = new QTabWidget( this, "TabWidget" ); |
71 | #endif | 71 | #endif |
72 | ap = new QWidget( TabWidget, "ap" ); | 72 | ap = new QWidget( TabWidget, "ap" ); |
73 | apLayout = new QVBoxLayout( ap ); | 73 | apLayout = new QVBoxLayout( ap ); |
74 | apLayout->setSpacing( 2 ); | 74 | apLayout->setSpacing( 2 ); |
75 | apLayout->setMargin( 2 ); | 75 | apLayout->setMargin( 2 ); |
76 | 76 | ||
77 | //--------- NETVIEW TAB -------------- | 77 | //--------- NETVIEW TAB -------------- |
78 | 78 | ||
79 | netview = new MScanListView( ap ); | 79 | netview = new MScanListView( ap ); |
80 | apLayout->addWidget( netview ); | 80 | apLayout->addWidget( netview ); |
81 | 81 | ||
82 | //--------- LOG TAB -------------- | 82 | //--------- LOG TAB -------------- |
83 | 83 | ||
84 | logwindow = new MLogWindow( TabWidget, "Log" ); | 84 | logwindow = new MLogWindow( TabWidget, "Log" ); |
85 | 85 | ||
86 | //--------- HEX TAB -------------- | 86 | //--------- HEX TAB -------------- |
87 | 87 | ||
88 | hexwindow = new MHexWindow( TabWidget, "Hex" ); | 88 | hexwindow = new MHexWindow( TabWidget, "Hex" ); |
89 | 89 | ||
90 | //--------- STAT TAB -------------- | 90 | //--------- STAT TAB -------------- |
91 | 91 | ||
92 | statwindow = new MStatWindow( TabWidget, "Stat" ); | 92 | statwindow = new MStatWindow( TabWidget, "Stat" ); |
93 | 93 | ||
94 | //--------- ABOUT TAB -------------- | 94 | //--------- ABOUT TAB -------------- |
95 | 95 | ||
96 | about = new QWidget( TabWidget, "about" ); | 96 | about = new QWidget( TabWidget, "about" ); |
97 | aboutLayout = new QGridLayout( about ); | 97 | aboutLayout = new QGridLayout( about ); |
98 | aboutLayout->setSpacing( 6 ); | 98 | aboutLayout->setSpacing( 6 ); |
99 | aboutLayout->setMargin( 11 ); | 99 | aboutLayout->setMargin( 11 ); |
100 | 100 | ||
101 | PixmapLabel1_3_2 = new QLabel( about, "PixmapLabel1_3_2" ); | 101 | PixmapLabel1_3_2 = new QLabel( about, "PixmapLabel1_3_2" ); |
102 | PixmapLabel1_3_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, PixmapLabel1_3_2->sizePolicy().hasHeightForWidth() ) ); | 102 | PixmapLabel1_3_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, PixmapLabel1_3_2->sizePolicy().hasHeightForWidth() ) ); |
103 | PixmapLabel1_3_2->setFrameShape( QLabel::Panel ); | 103 | PixmapLabel1_3_2->setFrameShape( QLabel::Panel ); |
104 | PixmapLabel1_3_2->setFrameShadow( QLabel::Sunken ); | 104 | PixmapLabel1_3_2->setFrameShadow( QLabel::Sunken ); |
105 | PixmapLabel1_3_2->setLineWidth( 2 ); | 105 | PixmapLabel1_3_2->setLineWidth( 2 ); |
106 | PixmapLabel1_3_2->setMargin( 0 ); | 106 | PixmapLabel1_3_2->setMargin( 0 ); |
107 | PixmapLabel1_3_2->setMidLineWidth( 0 ); | 107 | PixmapLabel1_3_2->setMidLineWidth( 0 ); |
108 | PixmapLabel1_3_2->setPixmap( Resource::loadPixmap( "wellenreiter/logo" ) ); | 108 | PixmapLabel1_3_2->setPixmap( Resource::loadPixmap( "wellenreiter/logo" ) ); |
109 | PixmapLabel1_3_2->setScaledContents( TRUE ); | 109 | PixmapLabel1_3_2->setScaledContents( TRUE ); |
110 | PixmapLabel1_3_2->setAlignment( int( QLabel::AlignCenter ) ); | 110 | PixmapLabel1_3_2->setAlignment( int( QLabel::AlignCenter ) ); |
111 | 111 | ||
112 | aboutLayout->addWidget( PixmapLabel1_3_2, 0, 0 ); | 112 | aboutLayout->addWidget( PixmapLabel1_3_2, 0, 0 ); |
113 | 113 | ||
114 | TextLabel1_4_2 = new QLabel( about, "TextLabel1_4_2" ); | 114 | TextLabel1_4_2 = new QLabel( about, "TextLabel1_4_2" ); |
115 | QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); | 115 | QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); |
116 | TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); | 116 | TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); |
117 | TextLabel1_4_2_font.setPointSize( 10 ); | 117 | TextLabel1_4_2_font.setPointSize( 10 ); |
118 | TextLabel1_4_2->setFont( TextLabel1_4_2_font ); | 118 | TextLabel1_4_2->setFont( TextLabel1_4_2_font ); |
119 | TextLabel1_4_2->setText( tr( "<p align=center>\n" | 119 | TextLabel1_4_2->setText( tr( "<p align=center>\n" |
120 | "<hr>\n" | 120 | "<hr>\n" |
121 | "Max Moser<br>\n" | 121 | "Max Moser<br>\n" |
122 | "Martin J. Muench<br>\n" | 122 | "Martin J. Muench<br>\n" |
123 | "Michael Lauer<br><hr>\n" | 123 | "Michael Lauer<br><hr>\n" |
124 | "<b>www.remote-exploit.org</b>\n" | 124 | "<b>www.remote-exploit.org</b>\n" |
125 | "</p>" ) ); | 125 | "</p>" ) ); |
126 | TextLabel1_4_2->setAlignment( int( QLabel::AlignCenter ) ); | 126 | TextLabel1_4_2->setAlignment( int( QLabel::AlignCenter ) ); |
127 | 127 | ||
128 | aboutLayout->addWidget( TextLabel1_4_2, 1, 0 ); | 128 | aboutLayout->addWidget( TextLabel1_4_2, 1, 0 ); |
129 | 129 | ||
130 | #ifdef QWS | 130 | #ifdef QWS |
131 | TabWidget->addTab( ap, "wellenreiter/networks", tr( "Nets" ) ); | 131 | TabWidget->addTab( ap, "wellenreiter/networks", tr( "Nets" ) ); |
132 | TabWidget->addTab( logwindow, "wellenreiter/log", tr( "Log" ) ); | 132 | TabWidget->addTab( logwindow, "wellenreiter/log", tr( "Log" ) ); |
133 | TabWidget->addTab( hexwindow, "wellenreiter/hex", tr( "Hex" ) ); | 133 | TabWidget->addTab( hexwindow, "wellenreiter/hex", tr( "Hex" ) ); |
134 | TabWidget->addTab( statwindow, "wellenreiter/stat", tr( "Stats" ) ); | 134 | TabWidget->addTab( statwindow, "wellenreiter/stat", tr( "Stat" ) ); |
135 | TabWidget->addTab( about, "wellenreiter/about", tr( "About" ) ); | 135 | TabWidget->addTab( about, "wellenreiter/about", tr( "About" ) ); |
136 | #else | 136 | #else |
137 | TabWidget->addTab( ap, /* "wellenreiter/networks", */ tr( "Networks" ) ); | 137 | TabWidget->addTab( ap, /* "wellenreiter/networks", */ tr( "Networks" ) ); |
138 | TabWidget->addTab( logwindow, /* "wellenreiter/log", */ tr( "Log" ) ); | 138 | TabWidget->addTab( logwindow, /* "wellenreiter/log", */ tr( "Log" ) ); |
139 | TabWidget->addTab( hexwindow, /* "wellenreiter/hex", */ tr( "Hex" ) ); | 139 | TabWidget->addTab( hexwindow, /* "wellenreiter/hex", */ tr( "Hex" ) ); |
140 | TabWidget->addTab( statwindow, /* "wellenreiter/hex", */ tr( "Stat" ) ); | 140 | TabWidget->addTab( statwindow, /* "wellenreiter/hex", */ tr( "Stat" ) ); |
141 | TabWidget->addTab( about, /* "wellenreiter/about", */ tr( "About" ) ); | 141 | TabWidget->addTab( about, /* "wellenreiter/about", */ tr( "About" ) ); |
142 | #endif | 142 | #endif |
143 | WellenreiterBaseLayout->addWidget( TabWidget ); | 143 | WellenreiterBaseLayout->addWidget( TabWidget ); |
144 | 144 | ||
145 | #ifdef QWS | 145 | #ifdef QWS |
146 | TabWidget->setCurrentTab( tr( "Nets" ) ); | 146 | TabWidget->setCurrentTab( tr( "Nets" ) ); |
147 | #endif | 147 | #endif |
148 | 148 | ||
149 | } | 149 | } |
150 | 150 | ||
151 | /* | 151 | /* |
152 | * Destroys the object and frees any allocated resources | 152 | * Destroys the object and frees any allocated resources |
153 | */ | 153 | */ |
154 | WellenreiterBase::~WellenreiterBase() | 154 | WellenreiterBase::~WellenreiterBase() |
155 | { | 155 | { |
156 | // no need to delete child widgets, Qt does it all for us | 156 | // no need to delete child widgets, Qt does it all for us |
157 | } | 157 | } |
158 | 158 | ||
159 | /* | 159 | /* |
160 | * Main event handler. Reimplemented to handle application | 160 | * Main event handler. Reimplemented to handle application |
161 | * font changes | 161 | * font changes |
162 | */ | 162 | */ |
163 | bool WellenreiterBase::event( QEvent* ev ) | 163 | bool WellenreiterBase::event( QEvent* ev ) |
164 | { | 164 | { |
165 | bool ret = QWidget::event( ev ); | 165 | bool ret = QWidget::event( ev ); |
166 | if ( ev->type() == QEvent::ApplicationFontChange ) { | 166 | if ( ev->type() == QEvent::ApplicationFontChange ) { |
167 | //QFont Log_2_font( Log_2->font() ); | 167 | //QFont Log_2_font( Log_2->font() ); |
168 | //Log_2_font.setFamily( "adobe-courier" ); | 168 | //Log_2_font.setFamily( "adobe-courier" ); |
169 | //Log_2_font.setPointSize( 8 ); | 169 | //Log_2_font.setPointSize( 8 ); |
170 | //Log_2->setFont( Log_2_font ); | 170 | //Log_2->setFont( Log_2_font ); |
171 | QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); | 171 | QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); |
172 | TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); | 172 | TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); |
173 | TextLabel1_4_2_font.setPointSize( 10 ); | 173 | TextLabel1_4_2_font.setPointSize( 10 ); |
174 | TextLabel1_4_2->setFont( TextLabel1_4_2_font ); | 174 | TextLabel1_4_2->setFont( TextLabel1_4_2_font ); |
175 | } | 175 | } |
176 | return ret; | 176 | return ret; |
177 | } | 177 | } |
178 | 178 | ||