summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/graphwindow.cpp159
-rw-r--r--noncore/net/wellenreiter/gui/graphwindow.h118
-rw-r--r--noncore/net/wellenreiter/gui/gui.pro6
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp7
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiterbase.cpp9
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiterbase.h2
-rw-r--r--noncore/net/wellenreiter/opie-wellenreiter.control2
7 files changed, 299 insertions, 4 deletions
diff --git a/noncore/net/wellenreiter/gui/graphwindow.cpp b/noncore/net/wellenreiter/gui/graphwindow.cpp
new file mode 100644
index 0000000..c620fe2
--- a/dev/null
+++ b/noncore/net/wellenreiter/gui/graphwindow.cpp
@@ -0,0 +1,159 @@
1/**********************************************************************
2** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved.
3**
4** This file is part of Opie Environment.
5**
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
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
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.
13**
14**********************************************************************/
15
16#include "graphwindow.h"
17
18#include <qpainter.h>
19#include <qpixmap.h>
20#include <qtimer.h>
21
22MFrequencySpectrum::MFrequencySpectrum( int channels, QWidget* parent, const char* name, WFlags f)
23 :QWidget( parent, name,f ), _channels( channels )
24{
25 _values = new int[_channels];
26 _dirty = new bool[_channels];
27 for ( int i = 0; i < channels; ++i )
28 { _values[i] = 0;
29 _dirty[i] = true;
30 }
31
32 // we draw everything alone
33 setBackgroundMode( QWidget::NoBackground );
34}
35
36
37void MFrequencySpectrum::drawLine( QPainter* p, int x, int y, int width, const QColor& c )
38{
39 p->setPen( c.light() );
40 p->drawPoint( x++, y );
41 p->setPen( c );
42 p->drawLine( x, y, x+width-2, y );
43 p->setPen( c.dark() );
44 p->drawPoint( x+width-1, y );
45}
46
47
48void MFrequencySpectrum::drawBar( QPainter* p, int x, int y, int width, int height, int maxheight )
49{
50/* int h1 = 133; int h2 = 0;
51 int s1 = 200; int s2 = 255;
52 int v1 = 140; int v2 = 255; */
53
54 int h1 = 196; int h2 = 194;
55 int s1 = 85; int s2 = 15;
56 int v1 = 95; int v2 = 237;
57
58 QColor c( 120, 60, 200 );
59 for ( int i = 0; i < height; ++i )
60 {
61 int h = (h2-h1)*i/maxheight + h1;
62 int s = (s2-s1)*i/maxheight + s1;
63 int v = (v2-v1)*i/maxheight + v1;
64 drawLine( p, x, y-i, width, QColor( h,s,v, QColor::Hsv ) );
65 }
66
67 /*for ( int i = height; i < maxheight; ++i )
68 drawLine( p, x, y-i, width, QColor( 47, 68, 76 ) );*/
69
70}
71
72
73void MFrequencySpectrum::paintEvent( QPaintEvent* e )
74{
75 QPixmap pm( size() );
76 QPainter p;
77 p.begin( &pm );
78 p.drawTiledPixmap( 0, 0, size().width(), size().height(), QPixmap( (const char**) &background ) );
79
80 int xmargin = 5;
81 int ymargin = 2;
82 int y = size().height() - 2 * ymargin;
83 int x = 0;
84 int width = ( size().width() - 2 * xmargin ) / _channels;
85
86 for ( int i = 0; i < _channels; ++i )
87 {
88 if ( _dirty[i] )
89 {
90 drawBar( &p, xmargin + x, y - ymargin, width-3, _values[i]*y/100, y );
91 _dirty[i] = false;
92 }
93 x+= width;
94 }
95
96 p.end();
97 bitBlt( this, 0, 0, &pm );
98}
99
100
101Legende::Legende( int channels, QWidget* parent, const char* name, WFlags f )
102 :QFrame( parent, name, f ), _channels( channels )
103{
104 setLineWidth( 2 );
105 setFrameStyle( Panel + Sunken );
106 setFixedHeight( 16 );
107
108}
109
110
111void Legende::drawContents( QPainter* p )
112{
113 int xmargin = 5;
114 int ymargin = 2;
115 int x = 0;
116 int width = ( contentsRect().width() - 2 * xmargin ) / _channels;
117
118 for ( int i = 0; i < _channels; ++i )
119 p->drawText( xmargin + (width*i), 12, QString().sprintf( "%02d", i+1 ) );
120}
121
122
123MGraphWindow::MGraphWindow( QWidget* parent, const char* name, WFlags f )
124 :QVBox( parent, name, f )
125{
126 spectrum = new MFrequencySpectrum( 14, this );
127 legende = new Legende( 14, this );
128 startTimer( 50 );
129
130 //testGraph();
131
132};
133
134
135void MGraphWindow::testGraph()
136{
137 static int i = 0;
138 spectrum->setValue( i++, 100 );
139 if ( i == 14 ) i = 0;
140 QTimer::singleShot( 2000, this, SLOT( testGraph() ) );
141
142}
143
144
145void MGraphWindow::timerEvent( QTimerEvent* e )
146{
147 for ( int i = 0; i < 14; i++ )
148 {
149 spectrum->decrease( i, 4 );
150 }
151 spectrum->repaint();
152}
153
154
155void MGraphWindow::traffic( int channel, int signal )
156{
157 spectrum->setValue( channel-1, signal );
158}
159
diff --git a/noncore/net/wellenreiter/gui/graphwindow.h b/noncore/net/wellenreiter/gui/graphwindow.h
new file mode 100644
index 0000000..4050065
--- a/dev/null
+++ b/noncore/net/wellenreiter/gui/graphwindow.h
@@ -0,0 +1,118 @@
1/**********************************************************************
2** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved.
3**
4** This file is part of Opie Environment.
5**
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
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
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.
13**
14**********************************************************************/
15
16#ifndef GRAPHWINDOW_H
17#define GRAPHWINDOW_H
18
19#include <qwidget.h>
20#include <qvbox.h>
21
22class MFrequencySpectrum : public QWidget
23{
24 public:
25 MFrequencySpectrum( int channels, QWidget* parent = 0, const char* name = "MFrequencySpectrum", WFlags f = 0 );
26 int value( int channel ) const { return _values[channel]; };
27 void setValue( int channel, int value )
28 {
29 if ( value > _values[channel] )
30 {
31 _values[channel] = value;
32 _dirty[channel] = true;
33 }
34 };
35 void decrease( int channel, int amount )
36 {
37 if ( _values[channel] >= amount )
38 {
39 _values[channel] -= amount;
40 _dirty[channel] = true;
41 }
42 };
43
44 protected:
45 virtual void paintEvent( QPaintEvent* );
46
47 void drawLine( QPainter* p, int x, int y, int width, const QColor& c );
48 void MFrequencySpectrum::drawBar( QPainter* p, int x, int y, int width, int height, int maxheight );
49
50 private:
51 int _channels;
52 int* _values;
53 bool* _dirty;
54};
55
56
57class Legende : public QFrame
58{
59 public:
60 Legende( int channels, QWidget* parent = 0, const char* name = "Legende", WFlags f = 0 );
61
62 protected:
63 virtual void drawContents( QPainter* );
64
65 private:
66 int _channels;
67};
68
69
70class MGraphWindow : public QVBox
71{
72 Q_OBJECT
73
74 public:
75 MGraphWindow( QWidget* parent = 0, const char* name = "MGraphWindow", WFlags f = 0 );
76 void traffic( int channel, int signal );
77
78 protected:
79 virtual void timerEvent( QTimerEvent* e );
80
81 protected slots:
82 virtual void testGraph();
83
84 protected:
85 MFrequencySpectrum* spectrum;
86 Legende* legende;
87
88};
89
90/* XPM */
91static char * background[] = {
92"16 16 6 1",
93 " c None",
94 ".c #52676E",
95 "+c #3F545B",
96 "@c #394E56",
97 "#c #2F454C",
98 "$c #364B52",
99".+++++++++++++++",
100"@###############",
101"+$$$$$$$$$$$$$$$",
102"@###############",
103"+$$$$$$$$$$$$$$$",
104"@###############",
105"+$$$$$$$$$$$$$$$",
106"@###############",
107"+$$$$$$$$$$$$$$$",
108"@###############",
109"+$$$$$$$$$$$$$$$",
110"@###############",
111"+$$$$$$$$$$$$$$$",
112"@###############",
113"+$$$$$$$$$$$$$$$",
114"@###############"};
115
116
117#endif
118
diff --git a/noncore/net/wellenreiter/gui/gui.pro b/noncore/net/wellenreiter/gui/gui.pro
index 476518a..927f4b7 100644
--- a/noncore/net/wellenreiter/gui/gui.pro
+++ b/noncore/net/wellenreiter/gui/gui.pro
@@ -1,45 +1,47 @@
1MOC_DIR = ./tmp 1MOC_DIR = ./tmp
2OBJECTS_DIR = ./tmp 2OBJECTS_DIR = ./tmp
3DESTDIR = $(OPIEDIR)/bin 3DESTDIR = $(OPIEDIR)/bin
4TEMPLATE = app 4TEMPLATE = app
5CONFIG = qt warn_on debug 5CONFIG = qt warn_on debug
6 6
7HEADERS = wellenreiterbase.h \ 7HEADERS = wellenreiterbase.h \
8 mainwindow.h \ 8 mainwindow.h \
9 wellenreiter.h \ 9 wellenreiter.h \
10 scanlist.h \ 10 scanlist.h \
11 logwindow.h \ 11 logwindow.h \
12 hexwindow.h \ 12 hexwindow.h \
13 statwindow.h \ 13 statwindow.h \
14 configwindow.h \ 14 configwindow.h \
15 manufacturers.h 15 manufacturers.h \
16 graphwindow.h
16 17
17SOURCES = main.cpp \ 18SOURCES = main.cpp \
18 mainwindow.cpp \ 19 mainwindow.cpp \
19 wellenreiterbase.cpp \ 20 wellenreiterbase.cpp \
20 wellenreiter.cpp \ 21 wellenreiter.cpp \
21 scanlist.cpp \ 22 scanlist.cpp \
22 logwindow.cpp \ 23 logwindow.cpp \
23 hexwindow.cpp \ 24 hexwindow.cpp \
24 statwindow.cpp \ 25 statwindow.cpp \
25 configwindow.cpp \ 26 configwindow.cpp \
26 manufacturers.cpp 27 manufacturers.cpp \
28 graphwindow.cpp
27 29
28INCLUDEPATH += $(OPIEDIR)/include 30INCLUDEPATH += $(OPIEDIR)/include
29DEPENDPATH += $(OPIEDIR)/include 31DEPENDPATH += $(OPIEDIR)/include
30INTERFACES = configbase.ui 32INTERFACES = configbase.ui
31TARGET = wellenreiter 33TARGET = wellenreiter
32 34
33!contains( platform, x11 ) { 35!contains( platform, x11 ) {
34 message( qws ) 36 message( qws )
35 include ( $(OPIEDIR)/include.pro ) 37 include ( $(OPIEDIR)/include.pro )
36 LIBS += -lqpe -lopie -lopiecore2 -lopieui2 -lopienet2 -lstdc++ 38 LIBS += -lqpe -lopie -lopiecore2 -lopieui2 -lopienet2 -lstdc++
37} 39}
38 40
39contains( platform, x11 ) { 41contains( platform, x11 ) {
40 LIBS += -L$(OPIEDIR)/output/lib -Wl,-rpath,$(OPIEDIR)/output/lib -Wl,-rpath,/usr/local/lib -lwellenreiter 42 LIBS += -L$(OPIEDIR)/output/lib -Wl,-rpath,$(OPIEDIR)/output/lib -Wl,-rpath,/usr/local/lib -lwellenreiter
41 SOURCES += resource.cpp 43 SOURCES += resource.cpp
42 HEADERS += resource.h 44 HEADERS += resource.h
43 DESTDIR = $(OPIEDIR)/output/bin 45 DESTDIR = $(OPIEDIR)/output/bin
44} 46}
45 47
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index 4b82c9a..c061319 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -37,48 +37,49 @@ using namespace Opie;
37#include <qlineedit.h> 37#include <qlineedit.h>
38#include <qmessagebox.h> 38#include <qmessagebox.h>
39#include <qregexp.h> 39#include <qregexp.h>
40#include <qspinbox.h> 40#include <qspinbox.h>
41#include <qtoolbutton.h> 41#include <qtoolbutton.h>
42#include <qmainwindow.h> 42#include <qmainwindow.h>
43 43
44// Standard 44// Standard
45 45
46#include <assert.h> 46#include <assert.h>
47#include <errno.h> 47#include <errno.h>
48#include <unistd.h> 48#include <unistd.h>
49#include <string.h> 49#include <string.h>
50#include <sys/types.h> 50#include <sys/types.h>
51#include <stdlib.h> 51#include <stdlib.h>
52 52
53// Local 53// Local
54 54
55#include "wellenreiter.h" 55#include "wellenreiter.h"
56#include "scanlist.h" 56#include "scanlist.h"
57#include "logwindow.h" 57#include "logwindow.h"
58#include "hexwindow.h" 58#include "hexwindow.h"
59#include "configwindow.h" 59#include "configwindow.h"
60#include "statwindow.h" 60#include "statwindow.h"
61#include "graphwindow.h"
61#include "manufacturers.h" 62#include "manufacturers.h"
62 63
63Wellenreiter::Wellenreiter( QWidget* parent ) 64Wellenreiter::Wellenreiter( QWidget* parent )
64 : WellenreiterBase( parent, 0, 0 ), 65 : WellenreiterBase( parent, 0, 0 ),
65 sniffing( false ), iface( 0 ), manufacturerdb( 0 ), configwindow( 0 ) 66 sniffing( false ), iface( 0 ), 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( "/usr/local/share/wellenreiter/manufacturers.dat" ); 77 manufile.sprintf( "/usr/local/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 //
@@ -145,48 +146,54 @@ void Wellenreiter::receivePacket(OPacket* p)
145 if ( beacon && beacon->managementType() == "Beacon" ) 146 if ( beacon && beacon->managementType() == "Beacon" )
146 { 147 {
147 QString type; 148 QString type;
148 if ( beacon->canIBSS() ) 149 if ( beacon->canIBSS() )
149 { 150 {
150 type = "adhoc"; 151 type = "adhoc";
151 } 152 }
152 else if ( beacon->canESS() ) 153 else if ( beacon->canESS() )
153 { 154 {
154 type = "managed"; 155 type = "managed";
155 } 156 }
156 else 157 else
157 { 158 {
158 qDebug( "Wellenreiter::invalid frame detected: '%s'", (const char*) p->dump( 16 ) ); 159 qDebug( "Wellenreiter::invalid frame detected: '%s'", (const char*) p->dump( 16 ) );
159 return; 160 return;
160 } 161 }
161 162
162 OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); 163 OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) );
163 QString essid = ssid ? ssid->ID() : QString("<unknown>"); 164 QString essid = ssid ? ssid->ID() : QString("<unknown>");
164 OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) ); 165 OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) );
165 int channel = ds ? ds->channel() : -1; 166 int channel = ds ? ds->channel() : -1;
166 167
167 OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); 168 OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) );
168 netView()->addNewItem( type, essid, header->macAddress2().toString(), beacon->canPrivacy(), channel, 0 ); 169 netView()->addNewItem( type, essid, header->macAddress2().toString(), beacon->canPrivacy(), channel, 0 );
170
171 // do we have a prism header?
172 OPrismHeaderPacket* prism = static_cast<OPrismHeaderPacket*>( p->child( "Prism" ) );
173 if ( ds && prism )
174 graphwindow->traffic( ds->channel(), prism->signalStrength() );
175
169 return; 176 return;
170 } 177 }
171 178
172 // check for a data frame 179 // check for a data frame
173 OWaveLanDataPacket* data = static_cast<OWaveLanDataPacket*>( p->child( "802.11 Data" ) ); 180 OWaveLanDataPacket* data = static_cast<OWaveLanDataPacket*>( p->child( "802.11 Data" ) );
174 if ( data ) 181 if ( data )
175 { 182 {
176 OWaveLanPacket* wlan = (OWaveLanPacket*) p->child( "802.11" ); 183 OWaveLanPacket* wlan = (OWaveLanPacket*) p->child( "802.11" );
177 if ( wlan->fromDS() && !wlan->toDS() ) 184 if ( wlan->fromDS() && !wlan->toDS() )
178 { 185 {
179 qDebug( "FromDS traffic: '%s' -> '%s' via '%s'", 186 qDebug( "FromDS traffic: '%s' -> '%s' via '%s'",
180 (const char*) wlan->macAddress3().toString(true), 187 (const char*) wlan->macAddress3().toString(true),
181 (const char*) wlan->macAddress1().toString(true), 188 (const char*) wlan->macAddress1().toString(true),
182 (const char*) wlan->macAddress2().toString(true) ); 189 (const char*) wlan->macAddress2().toString(true) );
183 netView()->fromDStraffic( wlan->macAddress3().toString(), 190 netView()->fromDStraffic( wlan->macAddress3().toString(),
184 wlan->macAddress1().toString(), 191 wlan->macAddress1().toString(),
185 wlan->macAddress2().toString() ); 192 wlan->macAddress2().toString() );
186 } 193 }
187 else 194 else
188 if ( !wlan->fromDS() && wlan->toDS() ) 195 if ( !wlan->fromDS() && wlan->toDS() )
189 { 196 {
190 qDebug( "ToDS traffic: '%s' -> '%s' via '%s'", 197 qDebug( "ToDS traffic: '%s' -> '%s' via '%s'",
191 (const char*) wlan->macAddress2().toString(true), 198 (const char*) wlan->macAddress2().toString(true),
192 (const char*) wlan->macAddress3().toString(true), 199 (const char*) wlan->macAddress3().toString(true),
diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp
index 9745069..36fbb9a 100644
--- a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp
@@ -10,96 +10,101 @@
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#include "graphwindow.h"
34 35
35#ifdef QWS 36#ifdef QWS
36#include <qpe/resource.h> 37#include <qpe/resource.h>
37#include <opie/otabwidget.h> 38#include <opie/otabwidget.h>
38#else 39#else
39#include "resource.h" 40#include "resource.h"
40#include <qtabwidget.h> 41#include <qtabwidget.h>
41#endif 42#endif
42 43
43 44
44/* 45/*
45 * Constructs a WellenreiterBase which is a child of 'parent', with the 46 * Constructs a WellenreiterBase which is a child of 'parent', with the
46 * name 'name' and widget flags set to 'f' 47 * name 'name' and widget flags set to 'f'
47 */ 48 */
48WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl ) 49WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl )
49 : QWidget( parent, name, fl ) 50 : QWidget( parent, name, fl )
50{ 51{
51 //ani1 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot0" ) ); 52 //ani1 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot0" ) );
52 //ani2 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot90" ) ); 53 //ani2 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot90" ) );
53 //ani3 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot180" ) ); 54 //ani3 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot180" ) );
54 //ani4 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot270" ) ); 55 //ani4 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot270" ) );
55 56
56 if ( !name ) 57 if ( !name )
57 setName( "WellenreiterBase" ); 58 setName( "WellenreiterBase" );
58 resize( 191, 294 ); 59 resize( 191, 294 );
59#ifdef QWS 60#ifdef QWS
60 setCaption( tr( "Wellenreiter/Opie" ) ); 61 setCaption( tr( "Wellenreiter/Opie" ) );
61#else 62#else
62 setCaption( tr( "Wellenreiter/X11" ) ); 63 setCaption( tr( "Wellenreiter/X11" ) );
63#endif 64#endif
64 WellenreiterBaseLayout = new QVBoxLayout( this ); 65 WellenreiterBaseLayout = new QVBoxLayout( this );
65 WellenreiterBaseLayout->setSpacing( 2 ); 66 WellenreiterBaseLayout->setSpacing( 2 );
66 WellenreiterBaseLayout->setMargin( 0 ); 67 WellenreiterBaseLayout->setMargin( 0 );
67#ifdef QWS 68#ifdef QWS
68 TabWidget = new OTabWidget( this, "TabWidget", OTabWidget::Global ); 69 TabWidget = new OTabWidget( this, "TabWidget", OTabWidget::Global );
69#else 70#else
70 TabWidget = new QTabWidget( this, "TabWidget" ); 71 TabWidget = new QTabWidget( this, "TabWidget" );
71#endif 72#endif
72 ap = new QWidget( TabWidget, "ap" ); 73 ap = new QWidget( TabWidget, "ap" );
73 apLayout = new QVBoxLayout( ap ); 74 apLayout = new QVBoxLayout( ap );
74 apLayout->setSpacing( 2 ); 75 apLayout->setSpacing( 2 );
75 apLayout->setMargin( 2 ); 76 apLayout->setMargin( 2 );
76 77
77 //--------- NETVIEW TAB -------------- 78 //--------- NETVIEW TAB --------------
78 79
79 netview = new MScanListView( ap ); 80 netview = new MScanListView( ap );
80 apLayout->addWidget( netview ); 81 apLayout->addWidget( netview );
81 82
83 //--------- GRAPH TAB --------------
84
85 graphwindow = new MGraphWindow( TabWidget, "Graph" );
86
82 //--------- LOG TAB -------------- 87 //--------- LOG TAB --------------
83 88
84 logwindow = new MLogWindow( TabWidget, "Log" ); 89 logwindow = new MLogWindow( TabWidget, "Log" );
85 90
86 //--------- HEX TAB -------------- 91 //--------- HEX TAB --------------
87 92
88 hexwindow = new MHexWindow( TabWidget, "Hex" ); 93 hexwindow = new MHexWindow( TabWidget, "Hex" );
89 94
90 //--------- STAT TAB -------------- 95 //--------- STAT TAB --------------
91 96
92 statwindow = new MStatWindow( TabWidget, "Stat" ); 97 statwindow = new MStatWindow( TabWidget, "Stat" );
93 98
94 //--------- ABOUT TAB -------------- 99 //--------- ABOUT TAB --------------
95 100
96 about = new QWidget( TabWidget, "about" ); 101 about = new QWidget( TabWidget, "about" );
97 aboutLayout = new QGridLayout( about ); 102 aboutLayout = new QGridLayout( about );
98 aboutLayout->setSpacing( 6 ); 103 aboutLayout->setSpacing( 6 );
99 aboutLayout->setMargin( 11 ); 104 aboutLayout->setMargin( 11 );
100 105
101 PixmapLabel1_3_2 = new QLabel( about, "PixmapLabel1_3_2" ); 106 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() ) ); 107 PixmapLabel1_3_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, PixmapLabel1_3_2->sizePolicy().hasHeightForWidth() ) );
103 PixmapLabel1_3_2->setFrameShape( QLabel::Panel ); 108 PixmapLabel1_3_2->setFrameShape( QLabel::Panel );
104 PixmapLabel1_3_2->setFrameShadow( QLabel::Sunken ); 109 PixmapLabel1_3_2->setFrameShadow( QLabel::Sunken );
105 PixmapLabel1_3_2->setLineWidth( 2 ); 110 PixmapLabel1_3_2->setLineWidth( 2 );
@@ -108,71 +113,73 @@ WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags f
108 PixmapLabel1_3_2->setPixmap( Resource::loadPixmap( "wellenreiter/logo" ) ); 113 PixmapLabel1_3_2->setPixmap( Resource::loadPixmap( "wellenreiter/logo" ) );
109 PixmapLabel1_3_2->setScaledContents( TRUE ); 114 PixmapLabel1_3_2->setScaledContents( TRUE );
110 PixmapLabel1_3_2->setAlignment( int( QLabel::AlignCenter ) ); 115 PixmapLabel1_3_2->setAlignment( int( QLabel::AlignCenter ) );
111 116
112 aboutLayout->addWidget( PixmapLabel1_3_2, 0, 0 ); 117 aboutLayout->addWidget( PixmapLabel1_3_2, 0, 0 );
113 118
114 TextLabel1_4_2 = new QLabel( about, "TextLabel1_4_2" ); 119 TextLabel1_4_2 = new QLabel( about, "TextLabel1_4_2" );
115 QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); 120 QFont TextLabel1_4_2_font( TextLabel1_4_2->font() );
116 TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); 121 TextLabel1_4_2_font.setFamily( "adobe-helvetica" );
117 TextLabel1_4_2_font.setPointSize( 10 ); 122 TextLabel1_4_2_font.setPointSize( 10 );
118 TextLabel1_4_2->setFont( TextLabel1_4_2_font ); 123 TextLabel1_4_2->setFont( TextLabel1_4_2_font );
119 TextLabel1_4_2->setText( tr( "<p align=center>\n" 124 TextLabel1_4_2->setText( tr( "<p align=center>\n"
120"<hr>\n" 125"<hr>\n"
121"Max Moser<br>\n" 126"Max Moser<br>\n"
122"Martin J. Muench<br>\n" 127"Martin J. Muench<br>\n"
123"Michael Lauer<br><hr>\n" 128"Michael Lauer<br><hr>\n"
124"<b>www.remote-exploit.org</b>\n" 129"<b>www.remote-exploit.org</b>\n"
125"</p>" ) ); 130"</p>" ) );
126 TextLabel1_4_2->setAlignment( int( QLabel::AlignCenter ) ); 131 TextLabel1_4_2->setAlignment( int( QLabel::AlignCenter ) );
127 132
128 aboutLayout->addWidget( TextLabel1_4_2, 1, 0 ); 133 aboutLayout->addWidget( TextLabel1_4_2, 1, 0 );
129 134
130#ifdef QWS 135#ifdef QWS
131 TabWidget->addTab( ap, "wellenreiter/networks", tr( "Nets" ) ); 136 TabWidget->addTab( ap, "wellenreiter/networks", tr( "Nets" ) );
137 TabWidget->addTab( graphwindow, "wellenreiter/graph", tr( "Graph" ) );
132 TabWidget->addTab( logwindow, "wellenreiter/log", tr( "Log" ) ); 138 TabWidget->addTab( logwindow, "wellenreiter/log", tr( "Log" ) );
133 TabWidget->addTab( hexwindow, "wellenreiter/hex", tr( "Hex" ) ); 139 TabWidget->addTab( hexwindow, "wellenreiter/hex", tr( "Hex" ) );
134 TabWidget->addTab( statwindow, "wellenreiter/stat", tr( "Stat" ) ); 140 TabWidget->addTab( statwindow, "wellenreiter/stat", tr( "Stat" ) );
135 TabWidget->addTab( about, "wellenreiter/about", tr( "About" ) ); 141 TabWidget->addTab( about, "wellenreiter/about", tr( "About" ) );
136#else 142#else
137 TabWidget->addTab( ap, /* "wellenreiter/networks", */ tr( "Networks" ) ); 143 TabWidget->addTab( ap, /* "wellenreiter/networks", */ tr( "Networks" ) );
144 TabWidget->addTab( graphwindow, /* "wellenreiter/graph", */ tr( "Graph" ) );
138 TabWidget->addTab( logwindow, /* "wellenreiter/log", */ tr( "Log" ) ); 145 TabWidget->addTab( logwindow, /* "wellenreiter/log", */ tr( "Log" ) );
139 TabWidget->addTab( hexwindow, /* "wellenreiter/hex", */ tr( "Hex" ) ); 146 TabWidget->addTab( hexwindow, /* "wellenreiter/hex", */ tr( "Hex" ) );
140 TabWidget->addTab( statwindow, /* "wellenreiter/hex", */ tr( "Stat" ) ); 147 TabWidget->addTab( statwindow, /* "wellenreiter/hex", */ tr( "Stat" ) );
141 TabWidget->addTab( about, /* "wellenreiter/about", */ tr( "About" ) ); 148 TabWidget->addTab( about, /* "wellenreiter/about", */ tr( "About" ) );
142#endif 149#endif
143 WellenreiterBaseLayout->addWidget( TabWidget ); 150 WellenreiterBaseLayout->addWidget( TabWidget );
144 151
145#ifdef QWS 152#ifdef QWS
146 TabWidget->setCurrentTab( tr( "Nets" ) ); 153 TabWidget->setCurrentTab( tr( "Nets" ) );
147#endif 154#endif
148 155
149} 156}
150 157
151/* 158/*
152 * Destroys the object and frees any allocated resources 159 * Destroys the object and frees any allocated resources
153 */ 160 */
154WellenreiterBase::~WellenreiterBase() 161WellenreiterBase::~WellenreiterBase()
155{ 162{
156 // no need to delete child widgets, Qt does it all for us 163 // no need to delete child widgets, Qt does it all for us
157} 164}
158 165
159/* 166/*
160 * Main event handler. Reimplemented to handle application 167 * Main event handler. Reimplemented to handle application
161 * font changes 168 * font changes
162 */ 169 */
163bool WellenreiterBase::event( QEvent* ev ) 170bool WellenreiterBase::event( QEvent* ev )
164{ 171{
165 bool ret = QWidget::event( ev ); 172 bool ret = QWidget::event( ev );
166 if ( ev->type() == QEvent::ApplicationFontChange ) { 173 if ( ev->type() == QEvent::ApplicationFontChange ) {
167 //QFont Log_2_font( Log_2->font() ); 174 //QFont Log_2_font( Log_2->font() );
168 //Log_2_font.setFamily( "adobe-courier" ); 175 //Log_2_font.setFamily( "adobe-courier" );
169 //Log_2_font.setPointSize( 8 ); 176 //Log_2_font.setPointSize( 8 );
170 //Log_2->setFont( Log_2_font ); 177 //Log_2->setFont( Log_2_font );
171 QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); 178 QFont TextLabel1_4_2_font( TextLabel1_4_2->font() );
172 TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); 179 TextLabel1_4_2_font.setFamily( "adobe-helvetica" );
173 TextLabel1_4_2_font.setPointSize( 10 ); 180 TextLabel1_4_2_font.setPointSize( 10 );
174 TextLabel1_4_2->setFont( TextLabel1_4_2_font ); 181 TextLabel1_4_2->setFont( TextLabel1_4_2_font );
175 } 182 }
176 return ret; 183 return ret;
177} 184}
178 185
diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.h b/noncore/net/wellenreiter/gui/wellenreiterbase.h
index ad2e96c..e8dc924 100644
--- a/noncore/net/wellenreiter/gui/wellenreiterbase.h
+++ b/noncore/net/wellenreiter/gui/wellenreiterbase.h
@@ -7,68 +7,70 @@
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>
21class QVBoxLayout; 21class QVBoxLayout;
22class QHBoxLayout; 22class QHBoxLayout;
23class QGridLayout; 23class QGridLayout;
24class QLabel; 24class QLabel;
25class MScanListView; 25class MScanListView;
26class MScanListItem; 26class MScanListItem;
27class QPushButton; 27class QPushButton;
28class MLogWindow; 28class MLogWindow;
29class MHexWindow; 29class MHexWindow;
30class MStatWindow; 30class MStatWindow;
31class MGraphWindow;
31 32
32#ifdef QWS 33#ifdef QWS
33class OTabWidget; 34class OTabWidget;
34#else 35#else
35class QTabWidget; 36class QTabWidget;
36#endif 37#endif
37 38
38class WellenreiterBase : public QWidget 39class WellenreiterBase : public QWidget
39{ 40{
40 Q_OBJECT 41 Q_OBJECT
41 42
42public: 43public:
43 WellenreiterBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 44 WellenreiterBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
44 ~WellenreiterBase(); 45 ~WellenreiterBase();
45 46
46#ifdef QWS 47#ifdef QWS
47 OTabWidget* TabWidget; 48 OTabWidget* TabWidget;
48#else 49#else
49 QTabWidget* TabWidget; 50 QTabWidget* TabWidget;
50#endif 51#endif
51 QWidget* ap; 52 QWidget* ap;
52 MScanListView* netview; 53 MScanListView* netview;
53 MLogWindow* logwindow; 54 MLogWindow* logwindow;
54 MHexWindow* hexwindow; 55 MHexWindow* hexwindow;
55 MStatWindow* statwindow; 56 MStatWindow* statwindow;
57 MGraphWindow* graphwindow;
56 QWidget* about; 58 QWidget* about;
57 QLabel* PixmapLabel1_3_2; 59 QLabel* PixmapLabel1_3_2;
58 QLabel* TextLabel1_4_2; 60 QLabel* TextLabel1_4_2;
59 61
60protected: 62protected:
61 QVBoxLayout* WellenreiterBaseLayout; 63 QVBoxLayout* WellenreiterBaseLayout;
62 QVBoxLayout* apLayout; 64 QVBoxLayout* apLayout;
63 QGridLayout* aboutLayout; 65 QGridLayout* aboutLayout;
64 bool event( QEvent* ); 66 bool event( QEvent* );
65 67
66 QPixmap* ani1; 68 QPixmap* ani1;
67 QPixmap* ani2; 69 QPixmap* ani2;
68 QPixmap* ani3; 70 QPixmap* ani3;
69 QPixmap* ani4; 71 QPixmap* ani4;
70 72
71 73
72}; 74};
73 75
74#endif // WELLENREITERBASE_H 76#endif // WELLENREITERBASE_H
diff --git a/noncore/net/wellenreiter/opie-wellenreiter.control b/noncore/net/wellenreiter/opie-wellenreiter.control
index f7267b4..8bb5b1c 100644
--- a/noncore/net/wellenreiter/opie-wellenreiter.control
+++ b/noncore/net/wellenreiter/opie-wellenreiter.control
@@ -1,10 +1,10 @@
1Package: opie-wellenreiter 1Package: opie-wellenreiter
2Files: bin/wellenreiter share/wellenreiter pics/wellenreiter apps/Applications/wellenreiter.desktop 2Files: bin/wellenreiter share/wellenreiter pics/wellenreiter apps/Applications/wellenreiter.desktop
3Priority: optional 3Priority: optional
4Section: opie/applications 4Section: opie/applications
5Maintainer: Michael 'Mickey' Lauer <mickeyl@handhelds.org> 5Maintainer: Michael 'Mickey' Lauer <mickeyl@handhelds.org>
6Architecture: arm 6Architecture: arm
7Version: $QPE_VERSION-$SUB_VERSION 7Version: 0.9.9-$SUB_VERSION
8Depends: task-opie-minimal, libpcap0, libopie2 (1.8.1) 8Depends: task-opie-minimal, libpcap0, libopie2 (1.8.1)
9Description: A WaveLAN Network Monitor 9Description: A WaveLAN Network Monitor
10 A WaveLAN Network Monitor/Sniffer for the Opie Environment. 10 A WaveLAN Network Monitor/Sniffer for the Opie Environment.