summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2002-12-08 19:31:23 (UTC)
committer mickeyl <mickeyl>2002-12-08 19:31:23 (UTC)
commit77ab301a0ab41befda91e6a210c64a72f0d7c264 (patch) (unidiff)
tree5c41c48b2f41dc1eb9350a138b8ba03fe3ac7fb1
parentf91aa29028f6807312e059229627ec4a8b1191d4 (diff)
downloadopie-77ab301a0ab41befda91e6a210c64a72f0d7c264.zip
opie-77ab301a0ab41befda91e6a210c64a72f0d7c264.tar.gz
opie-77ab301a0ab41befda91e6a210c64a72f0d7c264.tar.bz2
started work on logwindow and hexwindow
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/gui.pro4
-rw-r--r--noncore/net/wellenreiter/gui/hexwindow.cpp35
-rw-r--r--noncore/net/wellenreiter/gui/hexwindow.h38
-rw-r--r--noncore/net/wellenreiter/gui/logwindow.cpp38
-rw-r--r--noncore/net/wellenreiter/gui/logwindow.h38
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp11
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiterbase.cpp93
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiterbase.h11
8 files changed, 176 insertions, 92 deletions
diff --git a/noncore/net/wellenreiter/gui/gui.pro b/noncore/net/wellenreiter/gui/gui.pro
index fbe2c11..6b9944d 100644
--- a/noncore/net/wellenreiter/gui/gui.pro
+++ b/noncore/net/wellenreiter/gui/gui.pro
@@ -1,11 +1,11 @@
1DESTDIR = $(OPIEDIR)/bin 1DESTDIR = $(OPIEDIR)/bin
2TEMPLATE = app 2TEMPLATE = app
3CONFIG = qt warn_on debug 3CONFIG = qt warn_on debug
4#CONFIG = qt warn_on release 4#CONFIG = qt warn_on release
5HEADERS = wellenreiterbase.h wellenreiter.h scanlistitem.h scanlist.h 5HEADERS = wellenreiterbase.h wellenreiter.h scanlistitem.h scanlist.h logwindow.h hexwindow.h
6SOURCES = main.cpp wellenreiterbase.cpp wellenreiter.cpp scanlistitem.cpp scanlist.cpp 6SOURCES = main.cpp wellenreiterbase.cpp wellenreiter.cpp scanlistitem.cpp scanlist.cpp logwindow.cpp hexwindow.cpp
7INCLUDEPATH += $(OPIEDIR)/include ../daemon 7INCLUDEPATH += $(OPIEDIR)/include ../daemon
8DEPENDPATH += $(OPIEDIR)/include ../daemon 8DEPENDPATH += $(OPIEDIR)/include ../daemon
9LIBS += -lqpe -lopie -L../libwellenreiter/source -lwellenreiter 9LIBS += -lqpe -lopie -L../libwellenreiter/source -lwellenreiter
10INTERFACES = wellenreitertemplate.ui 10INTERFACES = wellenreitertemplate.ui
11TARGET = wellenreiter 11TARGET = wellenreiter
diff --git a/noncore/net/wellenreiter/gui/hexwindow.cpp b/noncore/net/wellenreiter/gui/hexwindow.cpp
new file mode 100644
index 0000000..91aa6f7
--- a/dev/null
+++ b/noncore/net/wellenreiter/gui/hexwindow.cpp
@@ -0,0 +1,35 @@
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 "hexwindow.h"
17#include <qmultilineedit.h>
18
19MHexWindow::MHexWindow( QWidget * parent, const char * name, WFlags f )
20 :QVBox( parent, name, f )
21{
22 ledit = new QMultiLineEdit( this );
23
24 // FIXME: Set properties( font, read-only, etc...)
25
26};
27
28void MHexWindow::log( QString text )
29{
30
31 ledit->append( text );
32
33};
34
35
diff --git a/noncore/net/wellenreiter/gui/hexwindow.h b/noncore/net/wellenreiter/gui/hexwindow.h
new file mode 100644
index 0000000..eec1be0
--- a/dev/null
+++ b/noncore/net/wellenreiter/gui/hexwindow.h
@@ -0,0 +1,38 @@
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 HEXWINDOW_H
17#define HEXWINDOW_H
18
19#include <qvbox.h>
20
21class QString;
22class QMultiLineEdit;
23
24class MHexWindow: public QVBox
25{
26
27 public:
28 MHexWindow( QWidget * parent = 0, const char * name = "MHexWindow", WFlags f = 0 );
29
30 void log( QString text );
31
32 protected:
33 QMultiLineEdit* ledit;
34
35};
36
37#endif
38
diff --git a/noncore/net/wellenreiter/gui/logwindow.cpp b/noncore/net/wellenreiter/gui/logwindow.cpp
new file mode 100644
index 0000000..dafb429
--- a/dev/null
+++ b/noncore/net/wellenreiter/gui/logwindow.cpp
@@ -0,0 +1,38 @@
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 "logwindow.h"
17#include <qmultilineedit.h>
18#include <qdatetime.h>
19
20MLogWindow::MLogWindow( QWidget * parent, const char * name, WFlags f )
21 :QVBox( parent, name, f )
22{
23 ledit = new QMultiLineEdit( this );
24
25 // FIXME: Set properties( font, read-only, etc...)
26
27};
28
29void MLogWindow::log( QString text )
30{
31 QTime time = QTime::currentTime();
32 QString line;
33 line.sprintf( "[%s] %s", (const char*) time.toString(), (const char*) text );
34 ledit->append( line );
35
36};
37
38
diff --git a/noncore/net/wellenreiter/gui/logwindow.h b/noncore/net/wellenreiter/gui/logwindow.h
new file mode 100644
index 0000000..325f8d0
--- a/dev/null
+++ b/noncore/net/wellenreiter/gui/logwindow.h
@@ -0,0 +1,38 @@
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 LOGWINDOW_H
17#define LOGWINDOW_H
18
19#include <qvbox.h>
20
21class QString;
22class QMultiLineEdit;
23
24class MLogWindow: public QVBox
25{
26
27 public:
28 MLogWindow( QWidget * parent = 0, const char * name = "MLogWindow", WFlags f = 0 );
29
30 void log( QString text );
31
32 protected:
33 QMultiLineEdit* ledit;
34
35};
36
37#endif
38
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index 11cdaef..e983b4d 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -1,115 +1,124 @@
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// Qt 16// Qt
17 17
18#include <qpushbutton.h> 18#include <qpushbutton.h>
19 19
20// Standard 20// Standard
21 21
22#include <unistd.h> 22#include <unistd.h>
23#include <sys/types.h> 23#include <sys/types.h>
24 24
25// Local 25// Local
26 26
27#include "wellenreiter.h" 27#include "wellenreiter.h"
28#include "scanlistitem.h" 28#include "scanlistitem.h"
29#include "logwindow.h"
30#include "hexwindow.h"
29 31
30#include "../libwellenreiter/source/sock.hh" // <--- ugly path, FIX THIS! 32#include "../libwellenreiter/source/sock.hh" // <--- ugly path, FIX THIS!
31#include "../libwellenreiter/source/proto.hh" // <--- ugly path, FIX THIS! 33#include "../libwellenreiter/source/proto.hh" // <--- ugly path, FIX THIS!
32#include "../daemon/source/config.hh" // <--- ugly path, FIX THIS! 34#include "../daemon/source/config.hh" // <--- ugly path, FIX THIS!
33 35
34Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) 36Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl )
35 : WellenreiterBase( parent, name, fl ) 37 : WellenreiterBase( parent, name, fl )
36{ 38{
37 39
40 logwindow->log( "(i) Wellenreiter has been started." );
41
38 connect( button, SIGNAL( clicked() ), this, SLOT( buttonClicked() ) ); 42 connect( button, SIGNAL( clicked() ), this, SLOT( buttonClicked() ) );
39 netview->setColumnWidthMode( 1, QListView::Manual ); 43 netview->setColumnWidthMode( 1, QListView::Manual );
40 44
41 // 45 //
42 // setup socket for daemon communication and start poller 46 // setup socket for daemon communication and start poller
43 // 47 //
44 48
45 daemon_fd = commsock( GUIADDR, GUIPORT ); 49 daemon_fd = commsock( GUIADDR, GUIPORT );
46 if ( daemon_fd == -1 ) 50 if ( daemon_fd == -1 )
51 {
52 logwindow->log( "(E) Couldn't get file descriptor for commsocket." );
47 qDebug( "D'oh! Could not get file descriptor for daemon-->gui communication socket." ); 53 qDebug( "D'oh! Could not get file descriptor for daemon-->gui communication socket." );
54 }
48 else 55 else
49 startTimer( 700 ); 56 startTimer( 700 );
50 57
51} 58}
52 59
53Wellenreiter::~Wellenreiter() 60Wellenreiter::~Wellenreiter()
54{ 61{
55 // no need to delete child widgets, Qt does it all for us 62 // no need to delete child widgets, Qt does it all for us
56} 63}
57 64
58void Wellenreiter::handleMessage() 65void Wellenreiter::handleMessage()
59{ 66{
60 // FIXME: receive message and handle it 67 // FIXME: receive message and handle it
61 68
62 qDebug( "received message from daemon." ); 69 qDebug( "received message from daemon." );
63 70
64 char buffer[128]; 71 char buffer[128];
65 72
66 int result = recvcomm( &daemon_fd, (char*) &buffer, sizeof(buffer) ); 73 int result = recvcomm( &daemon_fd, (char*) &buffer, sizeof(buffer) );
67 qDebug( "received %d from recvcomm", result ); 74 qDebug( "received %d from recvcomm", result );
68 75
69/* 76/*
70typedef struct { 77typedef struct {
71 int net_type; 1 = Accesspoint ; 2 = Ad-Hoc 78 int net_type; 1 = Accesspoint ; 2 = Ad-Hoc
72 int ssid_len; Length of SSID 79 int ssid_len; Length of SSID
73 int channel; Channel 80 int channel; Channel
74 int wep; 1 = WEP enabled ; 0 = disabled 81 int wep; 1 = WEP enabled ; 0 = disabled
75 char mac[64]; MAC address of Accesspoint 82 char mac[64]; MAC address of Accesspoint
76 char bssid[128]; BSSID of Accesspoint 83 char bssid[128]; BSSID of Accesspoint
77} wl_network_t; 84} wl_network_t;
78*/ 85*/
79 86
80 qDebug( "Sniffer sent: '%s'", buffer ); 87 qDebug( "Sniffer sent: '%s'", (const char*) &buffer );
88 hexwindow->log( (const char*) &buffer );
81 89
82 if ( result == NETFOUND ) /* new network found */ 90 if ( result == NETFOUND ) /* new network found */
83 { 91 {
92 logwindow->log( "(i) found new network" );
84 qDebug( "Sniffer said: new network found." ); 93 qDebug( "Sniffer said: new network found." );
85 wl_network_t n; 94 wl_network_t n;
86 get_network_found( &n, (char*) &buffer ); 95 get_network_found( &n, (char*) &buffer );
87 96
88 qDebug( "Sniffer said: net_type is %d.", n.net_type ); 97 qDebug( "Sniffer said: net_type is %d.", n.net_type );
89 qDebug( "Sniffer said: MAC is %s", (const char*) &n.mac ); 98 qDebug( "Sniffer said: MAC is %s", (const char*) &n.mac );
90 99
91 //n.bssid[n.ssid_len] = "\0"; 100 //n.bssid[n.ssid_len] = "\0";
92 101
93 QString type; 102 QString type;
94 103
95 if ( n.net_type == 1 ) 104 if ( n.net_type == 1 )
96 type = "managed"; 105 type = "managed";
97 else 106 else
98 type = "adhoc"; 107 type = "adhoc";
99 108
100 addNewItem( type, n.bssid, QString( (const char*) &n.mac ), n.wep, n.channel, 0 ); 109 addNewItem( type, n.bssid, QString( (const char*) &n.mac ), n.wep, n.channel, 0 );
101 110
102 } 111 }
103 112
104 else 113 else
105 114
106 { 115 {
107 qDebug( "unknown sniffer command." ); 116 qDebug( "unknown sniffer command." );
108 } 117 }
109 118
110} 119}
111 120
112 121
113bool Wellenreiter::hasMessage() 122bool Wellenreiter::hasMessage()
114{ 123{
115 124
diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp
index d938561..7849e12 100644
--- a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp
@@ -1,62 +1,65 @@
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 <opie/otabwidget.h> 23#include <opie/otabwidget.h>
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qvariant.h> 25#include <qvariant.h>
26#include <qtooltip.h> 26#include <qtooltip.h>
27#include <qwhatsthis.h> 27#include <qwhatsthis.h>
28#include <qimage.h> 28#include <qimage.h>
29#include <qpixmap.h> 29#include <qpixmap.h>
30 30
31#include "logwindow.h"
32#include "hexwindow.h"
33
31static const char* const image0_data[] = { 34static const char* const image0_data[] = {
32"150 105 949 2", 35"150 105 949 2",
33"g0 c #000000", 36"g0 c #000000",
34"g3 c #000008", 37"g3 c #000008",
35"g1 c #000400", 38"g1 c #000400",
36"i5 c #000408", 39"i5 c #000408",
37"g2 c #080000", 40"g2 c #080000",
38"hD c #080008", 41"hD c #080008",
39"hB c #080400", 42"hB c #080400",
40"g4 c #080408", 43"g4 c #080408",
41"gA c #080808", 44"gA c #080808",
42"gz c #080c08", 45"gz c #080c08",
43"kk c #080c10", 46"kk c #080c10",
44"ij c #100000", 47"ij c #100000",
45"kQ c #100408", 48"kQ c #100408",
46"hA c #100c10", 49"hA c #100c10",
47"gB c #101010", 50"gB c #101010",
48"lD c #101410", 51"lD c #101410",
49"ie c #180000", 52"ie c #180000",
50"iC c #180400", 53"iC c #180400",
51"gC c #181418", 54"gC c #181418",
52"lb c #181810", 55"lb c #181810",
53"gy c #181818", 56"gy c #181818",
54"kM c #181c18", 57"kM c #181c18",
55"j2 c #182018", 58"j2 c #182018",
56"lB c #200000", 59"lB c #200000",
57"jx c #200408", 60"jx c #200408",
58"jv c #201820", 61"jv c #201820",
59"hY c #201c20", 62"hY c #201c20",
60"iz c #202020", 63"iz c #202020",
61"ho c #202420", 64"ho c #202420",
62"lR c #290000", 65"lR c #290000",
@@ -1093,143 +1096,69 @@ static const char* const image0_data[] = {
1093WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl ) 1096WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl )
1094 : QWidget( parent, name, fl ) 1097 : QWidget( parent, name, fl )
1095{ 1098{
1096 QPixmap image0( ( const char** ) image0_data ); 1099 QPixmap image0( ( const char** ) image0_data );
1097 if ( !name ) 1100 if ( !name )
1098 setName( "WellenreiterBase" ); 1101 setName( "WellenreiterBase" );
1099 resize( 191, 294 ); 1102 resize( 191, 294 );
1100 setCaption( tr( "Wellenreiter" ) ); 1103 setCaption( tr( "Wellenreiter" ) );
1101 WellenreiterBaseLayout = new QVBoxLayout( this ); 1104 WellenreiterBaseLayout = new QVBoxLayout( this );
1102 WellenreiterBaseLayout->setSpacing( 2 ); 1105 WellenreiterBaseLayout->setSpacing( 2 );
1103 WellenreiterBaseLayout->setMargin( 0 ); 1106 WellenreiterBaseLayout->setMargin( 0 );
1104 1107
1105 TabWidget = new OTabWidget( this, "TabWidget", OTabWidget::Global ); 1108 TabWidget = new OTabWidget( this, "TabWidget", OTabWidget::Global );
1106 1109
1107 ap = new QWidget( TabWidget, "ap" ); 1110 ap = new QWidget( TabWidget, "ap" );
1108 apLayout = new QVBoxLayout( ap ); 1111 apLayout = new QVBoxLayout( ap );
1109 apLayout->setSpacing( 2 ); 1112 apLayout->setSpacing( 2 );
1110 apLayout->setMargin( 2 ); 1113 apLayout->setMargin( 2 );
1111 1114
1112 netview = new QListView( ap, "netview" ); 1115 netview = new QListView( ap, "netview" );
1113 netview->addColumn( tr( "SSID" ) ); 1116 netview->addColumn( tr( "SSID" ) );
1114 netview->addColumn( tr( "Sig" ) ); 1117 netview->addColumn( tr( "Sig" ) );
1115 netview->addColumn( tr( "AP" ) ); 1118 netview->addColumn( tr( "AP" ) );
1116 netview->addColumn( tr( "Chn" ) ); 1119 netview->addColumn( tr( "Chn" ) );
1117 netview->addColumn( tr( "W" ) ); 1120 netview->addColumn( tr( "W" ) );
1118 netview->addColumn( tr( "T" ) ); 1121 netview->addColumn( tr( "T" ) );
1119 netview->setFrameShape( QListView::StyledPanel ); 1122 netview->setFrameShape( QListView::StyledPanel );
1120 netview->setFrameShadow( QListView::Sunken ); 1123 netview->setFrameShadow( QListView::Sunken );
1121 netview->setRootIsDecorated( TRUE ); 1124 netview->setRootIsDecorated( TRUE );
1122 apLayout->addWidget( netview ); 1125 apLayout->addWidget( netview );
1123 TabWidget->addTab( ap, "wellenreiter/networks", tr( "Networks" ) ); 1126 TabWidget->addTab( ap, "wellenreiter/networks", tr( "Networks" ) );
1124 1127
1125 Log = new QWidget( TabWidget, "Log" ); 1128 logwindow = new MLogWindow( TabWidget, "Log" );
1126 LogLayout = new QVBoxLayout( Log ); 1129 TabWidget->addTab( logwindow, "wellenreiter/log", tr( "Log" ) );
1127 LogLayout->setSpacing( 2 );
1128 LogLayout->setMargin( 2 );
1129
1130 Log_2 = new QMultiLineEdit( Log, "Log_2" );
1131 Log_2->setText( tr( "11/18 18:15 - log started\n"
1132"11/19 20:13 - new net : \"ELAN\"\n"
1133"11/19 20:15 - new station : \"pegasus\"" ) );
1134 LogLayout->addWidget( Log_2 );
1135 TabWidget->addTab( Log, "wellenreiter/log", tr( "Log" ) );
1136
1137 tab = new QWidget( TabWidget, "tab" );
1138 tabLayout = new QGridLayout( tab );
1139 tabLayout->setSpacing( 2 );
1140 tabLayout->setMargin( 2 );
1141
1142 Log_2_2 = new QMultiLineEdit( tab, "Log_2_2" );
1143 QPalette pal;
1144 QColorGroup cg;
1145 cg.setColor( QColorGroup::Foreground, white );
1146 cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
1147 cg.setColor( QColorGroup::Light, white );
1148 cg.setColor( QColorGroup::Midlight, QColor( 223, 223, 223) );
1149 cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
1150 cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
1151 cg.setColor( QColorGroup::Text, white );
1152 cg.setColor( QColorGroup::BrightText, white );
1153 cg.setColor( QColorGroup::ButtonText, white );
1154 cg.setColor( QColorGroup::Base, black );
1155 cg.setColor( QColorGroup::Background, black );
1156 cg.setColor( QColorGroup::Shadow, black );
1157 cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
1158 cg.setColor( QColorGroup::HighlightedText, white );
1159 pal.setActive( cg );
1160 cg.setColor( QColorGroup::Foreground, white );
1161 cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
1162 cg.setColor( QColorGroup::Light, white );
1163 cg.setColor( QColorGroup::Midlight, QColor( 220, 220, 220) );
1164 cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
1165 cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
1166 cg.setColor( QColorGroup::Text, white );
1167 cg.setColor( QColorGroup::BrightText, white );
1168 cg.setColor( QColorGroup::ButtonText, white );
1169 cg.setColor( QColorGroup::Base, black );
1170 cg.setColor( QColorGroup::Background, black );
1171 cg.setColor( QColorGroup::Shadow, black );
1172 cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
1173 cg.setColor( QColorGroup::HighlightedText, white );
1174 pal.setInactive( cg );
1175 cg.setColor( QColorGroup::Foreground, QColor( 128, 128, 128) );
1176 cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
1177 cg.setColor( QColorGroup::Light, white );
1178 cg.setColor( QColorGroup::Midlight, QColor( 220, 220, 220) );
1179 cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
1180 cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
1181 cg.setColor( QColorGroup::Text, QColor( 128, 128, 128) );
1182 cg.setColor( QColorGroup::BrightText, white );
1183 cg.setColor( QColorGroup::ButtonText, QColor( 128, 128, 128) );
1184 cg.setColor( QColorGroup::Base, black );
1185 cg.setColor( QColorGroup::Background, black );
1186 cg.setColor( QColorGroup::Shadow, black );
1187 cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
1188 cg.setColor( QColorGroup::HighlightedText, white );
1189 pal.setDisabled( cg );
1190 Log_2_2->setPalette( pal );
1191 QFont Log_2_2_font( Log_2_2->font() );
1192 Log_2_2_font.setFamily( "adobe-courier" );
1193 Log_2_2_font.setPointSize( 8 );
1194 Log_2_2->setFont( Log_2_2_font );
1195 Log_2_2->setText( tr( "00 0a 20 00 a8 00 e2 00 ...ESD..\n"
1196"00 0a 20 00 a8 00 e2 00 .*&23...\n"
1197"00 0a 20 00 a8 00 e2 00 ........\n"
1198"00 0a 20 00 a8 00 e2 00 ........\n"
1199"00 0a 20 00 a8 00 e2 00 ........\n"
1200"00 0a 20 00 a8 00 e2 00 ...BRA22" ) );
1201 1130
1202 tabLayout->addWidget( Log_2_2, 0, 0 ); 1131 hexwindow = new MHexWindow( TabWidget, "tab" );
1203 TabWidget->addTab( tab, "wellenreiter/hex", tr( "Hex" ) ); 1132 TabWidget->addTab( hexwindow, "wellenreiter/hex", tr( "Hex" ) );
1204 1133
1205 about = new QWidget( TabWidget, "about" ); 1134 about = new QWidget( TabWidget, "about" );
1206 aboutLayout = new QGridLayout( about ); 1135 aboutLayout = new QGridLayout( about );
1207 aboutLayout->setSpacing( 6 ); 1136 aboutLayout->setSpacing( 6 );
1208 aboutLayout->setMargin( 11 ); 1137 aboutLayout->setMargin( 11 );
1209 1138
1210 PixmapLabel1_3_2 = new QLabel( about, "PixmapLabel1_3_2" ); 1139 PixmapLabel1_3_2 = new QLabel( about, "PixmapLabel1_3_2" );
1211 PixmapLabel1_3_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, PixmapLabel1_3_2->sizePolicy().hasHeightForWidth() ) ); 1140 PixmapLabel1_3_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, PixmapLabel1_3_2->sizePolicy().hasHeightForWidth() ) );
1212 PixmapLabel1_3_2->setFrameShape( QLabel::Panel ); 1141 PixmapLabel1_3_2->setFrameShape( QLabel::Panel );
1213 PixmapLabel1_3_2->setFrameShadow( QLabel::Sunken ); 1142 PixmapLabel1_3_2->setFrameShadow( QLabel::Sunken );
1214 PixmapLabel1_3_2->setLineWidth( 2 ); 1143 PixmapLabel1_3_2->setLineWidth( 2 );
1215 PixmapLabel1_3_2->setMargin( 0 ); 1144 PixmapLabel1_3_2->setMargin( 0 );
1216 PixmapLabel1_3_2->setMidLineWidth( 0 ); 1145 PixmapLabel1_3_2->setMidLineWidth( 0 );
1217 PixmapLabel1_3_2->setPixmap( image0 ); 1146 PixmapLabel1_3_2->setPixmap( image0 );
1218 PixmapLabel1_3_2->setScaledContents( TRUE ); 1147 PixmapLabel1_3_2->setScaledContents( TRUE );
1219 PixmapLabel1_3_2->setAlignment( int( QLabel::AlignCenter ) ); 1148 PixmapLabel1_3_2->setAlignment( int( QLabel::AlignCenter ) );
1220 1149
1221 aboutLayout->addWidget( PixmapLabel1_3_2, 0, 0 ); 1150 aboutLayout->addWidget( PixmapLabel1_3_2, 0, 0 );
1222 1151
1223 TextLabel1_4_2 = new QLabel( about, "TextLabel1_4_2" ); 1152 TextLabel1_4_2 = new QLabel( about, "TextLabel1_4_2" );
1224 QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); 1153 QFont TextLabel1_4_2_font( TextLabel1_4_2->font() );
1225 TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); 1154 TextLabel1_4_2_font.setFamily( "adobe-helvetica" );
1226 TextLabel1_4_2_font.setPointSize( 10 ); 1155 TextLabel1_4_2_font.setPointSize( 10 );
1227 TextLabel1_4_2->setFont( TextLabel1_4_2_font ); 1156 TextLabel1_4_2->setFont( TextLabel1_4_2_font );
1228 TextLabel1_4_2->setText( tr( "<p align=center>\n" 1157 TextLabel1_4_2->setText( tr( "<p align=center>\n"
1229"<hr>\n" 1158"<hr>\n"
1230"Max Moser<br>\n" 1159"Max Moser<br>\n"
1231"Martin J. Muench<br>\n" 1160"Martin J. Muench<br>\n"
1232"Michael Lauer<br><hr>\n" 1161"Michael Lauer<br><hr>\n"
1233"<b>www.remote-exploit.org</b>\n" 1162"<b>www.remote-exploit.org</b>\n"
1234"</p>" ) ); 1163"</p>" ) );
1235 TextLabel1_4_2->setAlignment( int( QLabel::AlignCenter ) ); 1164 TextLabel1_4_2->setAlignment( int( QLabel::AlignCenter ) );
@@ -1238,44 +1167,44 @@ WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags f
1238 TabWidget->addTab( about, "wellenreiter/about", tr( "About" ) ); 1167 TabWidget->addTab( about, "wellenreiter/about", tr( "About" ) );
1239 WellenreiterBaseLayout->addWidget( TabWidget ); 1168 WellenreiterBaseLayout->addWidget( TabWidget );
1240 1169
1241 button = new QPushButton( this, "button" ); 1170 button = new QPushButton( this, "button" );
1242 button->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, button->sizePolicy().hasHeightForWidth() ) ); 1171 button->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, button->sizePolicy().hasHeightForWidth() ) );
1243 button->setText( tr( "Start Scanning" ) ); 1172 button->setText( tr( "Start Scanning" ) );
1244 WellenreiterBaseLayout->addWidget( button ); 1173 WellenreiterBaseLayout->addWidget( button );
1245 1174
1246 // tab order 1175 // tab order
1247 setTabOrder( button, netview ); 1176 setTabOrder( button, netview );
1248 setTabOrder( netview, TabWidget ); 1177 setTabOrder( netview, TabWidget );
1249 1178
1250 TabWidget->setCurrentTab( tr( "Networks" ) ); 1179 TabWidget->setCurrentTab( tr( "Networks" ) );
1251 1180
1252} 1181}
1253 1182
1254/* 1183/*
1255 * Destroys the object and frees any allocated resources 1184 * Destroys the object and frees any allocated resources
1256 */ 1185 */
1257WellenreiterBase::~WellenreiterBase() 1186WellenreiterBase::~WellenreiterBase()
1258{ 1187{
1259 // no need to delete child widgets, Qt does it all for us 1188 // no need to delete child widgets, Qt does it all for us
1260} 1189}
1261 1190
1262/* 1191/*
1263 * Main event handler. Reimplemented to handle application 1192 * Main event handler. Reimplemented to handle application
1264 * font changes 1193 * font changes
1265 */ 1194 */
1266bool WellenreiterBase::event( QEvent* ev ) 1195bool WellenreiterBase::event( QEvent* ev )
1267{ 1196{
1268 bool ret = QWidget::event( ev ); 1197 bool ret = QWidget::event( ev );
1269 if ( ev->type() == QEvent::ApplicationFontChange ) { 1198 if ( ev->type() == QEvent::ApplicationFontChange ) {
1270 QFont Log_2_font( Log_2->font() ); 1199 //QFont Log_2_font( Log_2->font() );
1271 Log_2_font.setFamily( "adobe-courier" ); 1200 //Log_2_font.setFamily( "adobe-courier" );
1272 Log_2_font.setPointSize( 8 ); 1201 //Log_2_font.setPointSize( 8 );
1273 Log_2->setFont( Log_2_font ); 1202 //Log_2->setFont( Log_2_font );
1274 QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); 1203 QFont TextLabel1_4_2_font( TextLabel1_4_2->font() );
1275 TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); 1204 TextLabel1_4_2_font.setFamily( "adobe-helvetica" );
1276 TextLabel1_4_2_font.setPointSize( 10 ); 1205 TextLabel1_4_2_font.setPointSize( 10 );
1277 TextLabel1_4_2->setFont( TextLabel1_4_2_font ); 1206 TextLabel1_4_2->setFont( TextLabel1_4_2_font );
1278 } 1207 }
1279 return ret; 1208 return ret;
1280} 1209}
1281 1210
diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.h b/noncore/net/wellenreiter/gui/wellenreiterbase.h
index b133d28..b7bd820 100644
--- a/noncore/net/wellenreiter/gui/wellenreiterbase.h
+++ b/noncore/net/wellenreiter/gui/wellenreiterbase.h
@@ -1,60 +1,57 @@
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>
21class QVBoxLayout; 21class QVBoxLayout;
22class QHBoxLayout; 22class QHBoxLayout;
23class QGridLayout; 23class QGridLayout;
24class QLabel; 24class QLabel;
25class QListView; 25class QListView;
26class QListViewItem; 26class QListViewItem;
27class QMultiLineEdit;
28class QPushButton; 27class QPushButton;
29class OTabWidget; 28class OTabWidget;
29class MLogWindow;
30class MHexWindow;
30 31
31class WellenreiterBase : public QWidget 32class WellenreiterBase : public QWidget
32{ 33{
33 Q_OBJECT 34 Q_OBJECT
34 35
35public: 36public:
36 WellenreiterBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 37 WellenreiterBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
37 ~WellenreiterBase(); 38 ~WellenreiterBase();
38 39
39 OTabWidget* TabWidget; 40 OTabWidget* TabWidget;
40 QWidget* ap; 41 QWidget* ap;
41 QListView* netview; 42 QListView* netview;
42 QWidget* Log; 43 MLogWindow* logwindow;
43 QMultiLineEdit* Log_2; 44 MHexWindow* hexwindow;
44 QWidget* tab;
45 QMultiLineEdit* Log_2_2;
46 QWidget* about; 45 QWidget* about;
47 QLabel* PixmapLabel1_3_2; 46 QLabel* PixmapLabel1_3_2;
48 QLabel* TextLabel1_4_2; 47 QLabel* TextLabel1_4_2;
49 QPushButton* button; 48 QPushButton* button;
50 49
51protected: 50protected:
52 QVBoxLayout* WellenreiterBaseLayout; 51 QVBoxLayout* WellenreiterBaseLayout;
53 QVBoxLayout* apLayout; 52 QVBoxLayout* apLayout;
54 QVBoxLayout* LogLayout;
55 QGridLayout* tabLayout;
56 QGridLayout* aboutLayout; 53 QGridLayout* aboutLayout;
57 bool event( QEvent* ); 54 bool event( QEvent* );
58}; 55};
59 56
60#endif // WELLENREITERBASE_H 57#endif // WELLENREITERBASE_H