author | mickeyl <mickeyl> | 2004-05-03 14:15:54 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-05-03 14:15:54 (UTC) |
commit | 1ca586e85263f06f0de2e58d174da34fee4bf937 (patch) (unidiff) | |
tree | 2852372b1f8c8a143a8b8bb37d41842891c8ff73 /noncore/net/wellenreiter/gui/wellenreiterbase.cpp | |
parent | aad04cffe30ef133edcd5051ce7e486f27599d83 (diff) | |
download | opie-1ca586e85263f06f0de2e58d174da34fee4bf937.zip opie-1ca586e85263f06f0de2e58d174da34fee4bf937.tar.gz opie-1ca586e85263f06f0de2e58d174da34fee4bf937.tar.bz2 |
I hereby declare his Version 1.0.3.
Diffstat (limited to 'noncore/net/wellenreiter/gui/wellenreiterbase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiterbase.cpp | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp index 9bdf3e0..a29d520 100644 --- a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp | |||
@@ -1,182 +1,190 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Wellenreiter II. | 4 | ** This file is part of Wellenreiter II. |
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 <qlabel.h> | 18 | #include <qlabel.h> |
19 | #include <qlayout.h> | 19 | #include <qlayout.h> |
20 | 20 | ||
21 | #include "logwindow.h" | 21 | #include "logwindow.h" |
22 | #include "packetview.h" | 22 | #include "packetview.h" |
23 | #include "scanlist.h" | 23 | #include "scanlist.h" |
24 | #include "statwindow.h" | 24 | #include "statwindow.h" |
25 | #include "graphwindow.h" | 25 | #include "graphwindow.h" |
26 | 26 | ||
27 | #ifdef QWS | 27 | #ifdef QWS |
28 | #include <qpe/resource.h> | 28 | #include <qpe/resource.h> |
29 | #include <opie2/otabwidget.h> | 29 | #include <opie2/otabwidget.h> |
30 | using namespace Opie; | 30 | using namespace Opie; |
31 | #else | 31 | #else |
32 | #include "resource.h" | 32 | #include "resource.h" |
33 | #include <qtabwidget.h> | 33 | #include <qtabwidget.h> |
34 | #endif | 34 | #endif |
35 | 35 | ||
36 | #define WELLENREITER_VERSION "V1.0.3 (unofficial)" | ||
36 | 37 | ||
37 | /* | 38 | /* |
38 | * Constructs a WellenreiterBase which is a child of 'parent', with the | 39 | * Constructs a WellenreiterBase which is a child of 'parent', with the |
39 | * name 'name' and widget flags set to 'f' | 40 | * name 'name' and widget flags set to 'f' |
40 | */ | 41 | */ |
41 | using namespace Opie::Ui; | 42 | using namespace Opie::Ui; |
42 | using namespace Opie::Ui; | 43 | using namespace Opie::Ui; |
43 | using namespace Opie::Ui; | 44 | using namespace Opie::Ui; |
44 | WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl ) | 45 | WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl ) |
45 | : QWidget( parent, name, fl ) | 46 | : QWidget( parent, name, fl ) |
46 | { | 47 | { |
47 | //ani1 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot0" ) ); | 48 | //ani1 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot0" ) ); |
48 | //ani2 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot90" ) ); | 49 | //ani2 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot90" ) ); |
49 | //ani3 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot180" ) ); | 50 | //ani3 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot180" ) ); |
50 | //ani4 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot270" ) ); | 51 | //ani4 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot270" ) ); |
51 | 52 | ||
52 | if ( !name ) | 53 | if ( !name ) |
53 | setName( "WellenreiterBase" ); | 54 | setName( "WellenreiterBase" ); |
54 | resize( 191, 294 ); | 55 | resize( 191, 294 ); |
55 | #ifdef QWS | 56 | #ifdef QWS |
56 | setCaption( tr( "Wellenreiter/Opie" ) ); | 57 | setCaption( tr( "Wellenreiter/Opie" ) ); |
57 | #else | 58 | #else |
58 | setCaption( tr( "Wellenreiter/X11" ) ); | 59 | setCaption( tr( "Wellenreiter/X11" ) ); |
59 | #endif | 60 | #endif |
60 | WellenreiterBaseLayout = new QVBoxLayout( this ); | 61 | WellenreiterBaseLayout = new QVBoxLayout( this ); |
61 | WellenreiterBaseLayout->setSpacing( 2 ); | 62 | WellenreiterBaseLayout->setSpacing( 2 ); |
62 | WellenreiterBaseLayout->setMargin( 0 ); | 63 | WellenreiterBaseLayout->setMargin( 0 ); |
63 | #ifdef QWS | 64 | #ifdef QWS |
64 | TabWidget = new OTabWidget( this, "TabWidget", OTabWidget::Global ); | 65 | TabWidget = new OTabWidget( this, "TabWidget", OTabWidget::Global ); |
65 | #else | 66 | #else |
66 | TabWidget = new QTabWidget( this, "TabWidget" ); | 67 | TabWidget = new QTabWidget( this, "TabWidget" ); |
67 | #endif | 68 | #endif |
68 | ap = new QWidget( TabWidget, "ap" ); | 69 | ap = new QWidget( TabWidget, "ap" ); |
69 | apLayout = new QVBoxLayout( ap ); | 70 | apLayout = new QVBoxLayout( ap ); |
70 | apLayout->setSpacing( 2 ); | 71 | apLayout->setSpacing( 2 ); |
71 | apLayout->setMargin( 2 ); | 72 | apLayout->setMargin( 2 ); |
72 | 73 | ||
73 | //--------- NETVIEW TAB -------------- | 74 | //--------- NETVIEW TAB -------------- |
74 | 75 | ||
75 | netview = new MScanListView( ap ); | 76 | netview = new MScanListView( ap ); |
76 | apLayout->addWidget( netview ); | 77 | apLayout->addWidget( netview ); |
77 | 78 | ||
78 | //--------- GRAPH TAB -------------- | 79 | //--------- GRAPH TAB -------------- |
79 | 80 | ||
80 | graphwindow = new MGraphWindow( TabWidget, "Graph" ); | 81 | graphwindow = new MGraphWindow( TabWidget, "Graph" ); |
81 | 82 | ||
82 | //--------- LOG TAB -------------- | 83 | //--------- LOG TAB -------------- |
83 | 84 | ||
84 | logwindow = new MLogWindow( TabWidget, "Log" ); | 85 | logwindow = new MLogWindow( TabWidget, "Log" ); |
85 | 86 | ||
86 | //--------- HEX TAB -------------- | 87 | //--------- HEX TAB -------------- |
87 | 88 | ||
88 | hexwindow = new PacketView( TabWidget, "Hex" ); | 89 | hexwindow = new PacketView( TabWidget, "Hex" ); |
89 | 90 | ||
90 | //--------- STAT TAB -------------- | 91 | //--------- STAT TAB -------------- |
91 | 92 | ||
92 | statwindow = new MStatWindow( TabWidget, "Stat" ); | 93 | statwindow = new MStatWindow( TabWidget, "Stat" ); |
93 | 94 | ||
94 | //--------- ABOUT TAB -------------- | 95 | //--------- ABOUT TAB -------------- |
95 | 96 | ||
96 | about = new QWidget( TabWidget, "about" ); | 97 | about = new QWidget( TabWidget, "about" ); |
97 | aboutLayout = new QGridLayout( about ); | 98 | aboutLayout = new QGridLayout( about ); |
98 | aboutLayout->setSpacing( 6 ); | 99 | aboutLayout->setSpacing( 6 ); |
99 | aboutLayout->setMargin( 11 ); | 100 | aboutLayout->setMargin( 11 ); |
100 | 101 | ||
101 | PixmapLabel1_3_2 = new QLabel( about, "PixmapLabel1_3_2" ); | 102 | 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() ) ); | 103 | PixmapLabel1_3_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, PixmapLabel1_3_2->sizePolicy().hasHeightForWidth() ) ); |
103 | PixmapLabel1_3_2->setFrameShape( QLabel::Panel ); | 104 | PixmapLabel1_3_2->setFrameShape( QLabel::Panel ); |
104 | PixmapLabel1_3_2->setFrameShadow( QLabel::Sunken ); | 105 | PixmapLabel1_3_2->setFrameShadow( QLabel::Sunken ); |
105 | PixmapLabel1_3_2->setLineWidth( 2 ); | 106 | PixmapLabel1_3_2->setLineWidth( 2 ); |
106 | PixmapLabel1_3_2->setMargin( 0 ); | 107 | PixmapLabel1_3_2->setMargin( 0 ); |
107 | PixmapLabel1_3_2->setMidLineWidth( 0 ); | 108 | PixmapLabel1_3_2->setMidLineWidth( 0 ); |
108 | PixmapLabel1_3_2->setPixmap( Resource::loadPixmap( "wellenreiter/logo" ) ); | 109 | |
110 | QPixmap logo = Resource::loadPixmap( "wellenreiter/logo" ); | ||
111 | QPainter draw( &logo ); | ||
112 | draw.setPen( Qt::black ); | ||
113 | draw.setFont( QFont( "Fixed", 8 ) ); | ||
114 | draw.drawText( 30, 10, WELLENREITER_VERSION ); | ||
115 | |||
116 | PixmapLabel1_3_2->setPixmap( logo ); | ||
109 | PixmapLabel1_3_2->setScaledContents( TRUE ); | 117 | PixmapLabel1_3_2->setScaledContents( TRUE ); |
110 | PixmapLabel1_3_2->setAlignment( int( QLabel::AlignCenter ) ); | 118 | PixmapLabel1_3_2->setAlignment( int( QLabel::AlignCenter ) ); |
111 | 119 | ||
112 | aboutLayout->addWidget( PixmapLabel1_3_2, 0, 0 ); | 120 | aboutLayout->addWidget( PixmapLabel1_3_2, 0, 0 ); |
113 | 121 | ||
114 | TextLabel1_4_2 = new QLabel( about, "TextLabel1_4_2" ); | 122 | TextLabel1_4_2 = new QLabel( about, "TextLabel1_4_2" ); |
115 | QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); | 123 | QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); |
116 | TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); | 124 | TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); |
117 | TextLabel1_4_2_font.setPointSize( 10 ); | 125 | TextLabel1_4_2_font.setPointSize( 10 ); |
118 | TextLabel1_4_2->setFont( TextLabel1_4_2_font ); | 126 | TextLabel1_4_2->setFont( TextLabel1_4_2_font ); |
119 | TextLabel1_4_2->setText( | 127 | TextLabel1_4_2->setText( |
120 | "<p align=center>" | 128 | "<p align=center>" |
121 | "<hr>" | 129 | "<hr>" |
122 | "<b>(C) Michael 'Mickey' Lauer</b><br>" | 130 | "<b>(C) Michael 'Mickey' Lauer</b><br>" |
123 | "<hr>" | 131 | "<hr>" |
124 | "mickey@Vanille.de<br>" | 132 | "mickey@Vanille.de<br>" |
125 | "www.Vanille.de/projects/wellenreiter.html<br>" | 133 | "www.Vanille.de/projects/wellenreiter.html<br>" |
126 | "www.wellenreiter.net" | 134 | "www.wellenreiter.net" |
127 | "</p>" ); | 135 | "</p>" ); |
128 | TextLabel1_4_2->setAlignment( int( QLabel::AlignCenter ) ); | 136 | TextLabel1_4_2->setAlignment( int( QLabel::AlignCenter ) ); |
129 | 137 | ||
130 | aboutLayout->addWidget( TextLabel1_4_2, 1, 0 ); | 138 | aboutLayout->addWidget( TextLabel1_4_2, 1, 0 ); |
131 | 139 | ||
132 | #ifdef QWS | 140 | #ifdef QWS |
133 | TabWidget->addTab( ap, "wellenreiter/networks", tr( "Nets" ) ); | 141 | TabWidget->addTab( ap, "wellenreiter/networks", tr( "Nets" ) ); |
134 | TabWidget->addTab( graphwindow, "wellenreiter/graph", tr( "Graph" ) ); | 142 | TabWidget->addTab( graphwindow, "wellenreiter/graph", tr( "Graph" ) ); |
135 | TabWidget->addTab( logwindow, "wellenreiter/log", tr( "Log" ) ); | 143 | TabWidget->addTab( logwindow, "wellenreiter/log", tr( "Log" ) ); |
136 | TabWidget->addTab( hexwindow, "wellenreiter/hex", tr( "Hex" ) ); | 144 | TabWidget->addTab( hexwindow, "wellenreiter/hex", tr( "Hex" ) ); |
137 | TabWidget->addTab( statwindow, "wellenreiter/stat", tr( "Stat" ) ); | 145 | TabWidget->addTab( statwindow, "wellenreiter/stat", tr( "Stat" ) ); |
138 | TabWidget->addTab( about, "wellenreiter/about", tr( "About" ) ); | 146 | TabWidget->addTab( about, "wellenreiter/about", tr( "About" ) ); |
139 | #else | 147 | #else |
140 | TabWidget->addTab( ap, /* "wellenreiter/networks", */ tr( "Networks" ) ); | 148 | TabWidget->addTab( ap, /* "wellenreiter/networks", */ tr( "Networks" ) ); |
141 | TabWidget->addTab( graphwindow, /* "wellenreiter/graph", */ tr( "Graph" ) ); | 149 | TabWidget->addTab( graphwindow, /* "wellenreiter/graph", */ tr( "Graph" ) ); |
142 | TabWidget->addTab( logwindow, /* "wellenreiter/log", */ tr( "Log" ) ); | 150 | TabWidget->addTab( logwindow, /* "wellenreiter/log", */ tr( "Log" ) ); |
143 | TabWidget->addTab( hexwindow, /* "wellenreiter/hex", */ tr( "Hex" ) ); | 151 | TabWidget->addTab( hexwindow, /* "wellenreiter/hex", */ tr( "Hex" ) ); |
144 | TabWidget->addTab( statwindow, /* "wellenreiter/hex", */ tr( "Stat" ) ); | 152 | TabWidget->addTab( statwindow, /* "wellenreiter/hex", */ tr( "Stat" ) ); |
145 | TabWidget->addTab( about, /* "wellenreiter/about", */ tr( "About" ) ); | 153 | TabWidget->addTab( about, /* "wellenreiter/about", */ tr( "About" ) ); |
146 | #endif | 154 | #endif |
147 | WellenreiterBaseLayout->addWidget( TabWidget ); | 155 | WellenreiterBaseLayout->addWidget( TabWidget ); |
148 | 156 | ||
149 | #ifdef QWS | 157 | #ifdef QWS |
150 | TabWidget->setCurrentTab( tr( "Nets" ) ); | 158 | TabWidget->setCurrentTab( tr( "Nets" ) ); |
151 | #endif | 159 | #endif |
152 | 160 | ||
153 | } | 161 | } |
154 | 162 | ||
155 | /* | 163 | /* |
156 | * Destroys the object and frees any allocated resources | 164 | * Destroys the object and frees any allocated resources |
157 | */ | 165 | */ |
158 | WellenreiterBase::~WellenreiterBase() | 166 | WellenreiterBase::~WellenreiterBase() |
159 | { | 167 | { |
160 | // no need to delete child widgets, Qt does it all for us | 168 | // no need to delete child widgets, Qt does it all for us |
161 | } | 169 | } |
162 | 170 | ||
163 | /* | 171 | /* |
164 | * Main event handler. Reimplemented to handle application | 172 | * Main event handler. Reimplemented to handle application |
165 | * font changes | 173 | * font changes |
166 | */ | 174 | */ |
167 | bool WellenreiterBase::event( QEvent* ev ) | 175 | bool WellenreiterBase::event( QEvent* ev ) |
168 | { | 176 | { |
169 | bool ret = QWidget::event( ev ); | 177 | bool ret = QWidget::event( ev ); |
170 | if ( ev->type() == QEvent::ApplicationFontChange ) { | 178 | if ( ev->type() == QEvent::ApplicationFontChange ) { |
171 | //QFont Log_2_font( Log_2->font() ); | 179 | //QFont Log_2_font( Log_2->font() ); |
172 | //Log_2_font.setFamily( "adobe-courier" ); | 180 | //Log_2_font.setFamily( "adobe-courier" ); |
173 | //Log_2_font.setPointSize( 8 ); | 181 | //Log_2_font.setPointSize( 8 ); |
174 | //Log_2->setFont( Log_2_font ); | 182 | //Log_2->setFont( Log_2_font ); |
175 | QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); | 183 | QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); |
176 | TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); | 184 | TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); |
177 | TextLabel1_4_2_font.setPointSize( 10 ); | 185 | TextLabel1_4_2_font.setPointSize( 10 ); |
178 | TextLabel1_4_2->setFont( TextLabel1_4_2_font ); | 186 | TextLabel1_4_2->setFont( TextLabel1_4_2_font ); |
179 | } | 187 | } |
180 | return ret; | 188 | return ret; |
181 | } | 189 | } |
182 | 190 | ||