-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 | |||
@@ -4,4 +4,4 @@ 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 |
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 | |||
@@ -28,2 +28,4 @@ | |||
28 | #include "scanlistitem.h" | 28 | #include "scanlistitem.h" |
29 | #include "logwindow.h" | ||
30 | #include "hexwindow.h" | ||
29 | 31 | ||
@@ -37,2 +39,4 @@ Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) | |||
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() ) ); |
@@ -46,3 +50,6 @@ Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) | |||
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 |
@@ -79,3 +86,4 @@ typedef struct { | |||
79 | 86 | ||
80 | qDebug( "Sniffer sent: '%s'", buffer ); | 87 | qDebug( "Sniffer sent: '%s'", (const char*) &buffer ); |
88 | hexwindow->log( (const char*) &buffer ); | ||
81 | 89 | ||
@@ -83,2 +91,3 @@ typedef struct { | |||
83 | { | 91 | { |
92 | logwindow->log( "(i) found new network" ); | ||
84 | qDebug( "Sniffer said: new network found." ); | 93 | qDebug( "Sniffer said: new network found." ); |
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 | |||
@@ -30,2 +30,5 @@ | |||
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[] = { |
@@ -1124,81 +1127,7 @@ WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags f | |||
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 | ||
@@ -1269,6 +1198,6 @@ bool WellenreiterBase::event( QEvent* 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() ); |
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 | |||
@@ -26,5 +26,6 @@ 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 | ||
@@ -41,6 +42,4 @@ public: | |||
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; |
@@ -53,4 +52,2 @@ protected: | |||
53 | QVBoxLayout* apLayout; | 52 | QVBoxLayout* apLayout; |
54 | QVBoxLayout* LogLayout; | ||
55 | QGridLayout* tabLayout; | ||
56 | QGridLayout* aboutLayout; | 53 | QGridLayout* aboutLayout; |