author | mickeyl <mickeyl> | 2002-12-08 19:31:23 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2002-12-08 19:31:23 (UTC) |
commit | 77ab301a0ab41befda91e6a210c64a72f0d7c264 (patch) (unidiff) | |
tree | 5c41c48b2f41dc1eb9350a138b8ba03fe3ac7fb1 /noncore/net/wellenreiter/gui | |
parent | f91aa29028f6807312e059229627ec4a8b1191d4 (diff) | |
download | opie-77ab301a0ab41befda91e6a210c64a72f0d7c264.zip opie-77ab301a0ab41befda91e6a210c64a72f0d7c264.tar.gz opie-77ab301a0ab41befda91e6a210c64a72f0d7c264.tar.bz2 |
started work on logwindow and hexwindow
Diffstat (limited to 'noncore/net/wellenreiter/gui') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/gui.pro | 4 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/hexwindow.cpp | 35 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/hexwindow.h | 38 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/logwindow.cpp | 38 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/logwindow.h | 38 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 11 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiterbase.cpp | 93 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiterbase.h | 11 |
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 @@ | |||
1 | DESTDIR = $(OPIEDIR)/bin | 1 | DESTDIR = $(OPIEDIR)/bin |
2 | TEMPLATE = app | 2 | TEMPLATE = app |
3 | CONFIG = qt warn_on debug | 3 | CONFIG = qt warn_on debug |
4 | #CONFIG = qt warn_on release | 4 | #CONFIG = qt warn_on release |
5 | HEADERS = wellenreiterbase.h wellenreiter.h scanlistitem.h scanlist.h | 5 | HEADERS = wellenreiterbase.h wellenreiter.h scanlistitem.h scanlist.h logwindow.h hexwindow.h |
6 | SOURCES = main.cpp wellenreiterbase.cpp wellenreiter.cpp scanlistitem.cpp scanlist.cpp | 6 | SOURCES = main.cpp wellenreiterbase.cpp wellenreiter.cpp scanlistitem.cpp scanlist.cpp logwindow.cpp hexwindow.cpp |
7 | INCLUDEPATH += $(OPIEDIR)/include ../daemon | 7 | INCLUDEPATH += $(OPIEDIR)/include ../daemon |
8 | DEPENDPATH += $(OPIEDIR)/include ../daemon | 8 | DEPENDPATH += $(OPIEDIR)/include ../daemon |
9 | LIBS += -lqpe -lopie -L../libwellenreiter/source -lwellenreiter | 9 | LIBS += -lqpe -lopie -L../libwellenreiter/source -lwellenreiter |
10 | INTERFACES = wellenreitertemplate.ui | 10 | INTERFACES = wellenreitertemplate.ui |
11 | TARGET = wellenreiter | 11 | TARGET = 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 | |||
19 | MHexWindow::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 | |||
28 | void 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 | |||
21 | class QString; | ||
22 | class QMultiLineEdit; | ||
23 | |||
24 | class 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 | |||
20 | MLogWindow::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 | |||
29 | void 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 | |||
21 | class QString; | ||
22 | class QMultiLineEdit; | ||
23 | |||
24 | class 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 | |||
@@ -17,43 +17,50 @@ | |||
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 | ||
34 | Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) | 36 | Wellenreiter::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 | ||
53 | Wellenreiter::~Wellenreiter() | 60 | Wellenreiter::~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 | ||
58 | void Wellenreiter::handleMessage() | 65 | void Wellenreiter::handleMessage() |
59 | { | 66 | { |
@@ -68,28 +75,30 @@ void Wellenreiter::handleMessage() | |||
68 | 75 | ||
69 | /* | 76 | /* |
70 | typedef struct { | 77 | typedef 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 ) |
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 | |||
@@ -19,24 +19,27 @@ | |||
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 | |||
31 | static const char* const image0_data[] = { | 34 | static 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", |
@@ -1113,103 +1116,29 @@ WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags f | |||
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 ); |
@@ -1258,24 +1187,24 @@ WellenreiterBase::~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 | */ |
1266 | bool WellenreiterBase::event( QEvent* ev ) | 1195 | bool 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 | |||
@@ -15,46 +15,43 @@ | |||
15 | 15 | ||
16 | #ifndef WELLENREITERBASE_H | 16 | #ifndef WELLENREITERBASE_H |
17 | #define WELLENREITERBASE_H | 17 | #define WELLENREITERBASE_H |
18 | 18 | ||
19 | #include <qvariant.h> | 19 | #include <qvariant.h> |
20 | #include <qwidget.h> | 20 | #include <qwidget.h> |
21 | class QVBoxLayout; | 21 | class QVBoxLayout; |
22 | class QHBoxLayout; | 22 | class QHBoxLayout; |
23 | class QGridLayout; | 23 | class QGridLayout; |
24 | class QLabel; | 24 | class QLabel; |
25 | class QListView; | 25 | class QListView; |
26 | class QListViewItem; | 26 | class QListViewItem; |
27 | class QMultiLineEdit; | ||
28 | class QPushButton; | 27 | class QPushButton; |
29 | class OTabWidget; | 28 | class OTabWidget; |
29 | class MLogWindow; | ||
30 | class MHexWindow; | ||
30 | 31 | ||
31 | class WellenreiterBase : public QWidget | 32 | class WellenreiterBase : public QWidget |
32 | { | 33 | { |
33 | Q_OBJECT | 34 | Q_OBJECT |
34 | 35 | ||
35 | public: | 36 | public: |
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 | ||
51 | protected: | 50 | protected: |
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 |