-rw-r--r-- | noncore/net/wellenreiter/gui/gui-x11.pro | 11 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/main.cpp | 1 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/resource.cpp | 35 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/resource.h | 26 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlistitem.cpp | 7 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiterbase.cpp | 40 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiterbase.h | 11 |
7 files changed, 119 insertions, 12 deletions
diff --git a/noncore/net/wellenreiter/gui/gui-x11.pro b/noncore/net/wellenreiter/gui/gui-x11.pro new file mode 100644 index 0000000..0cddd22 --- a/dev/null +++ b/noncore/net/wellenreiter/gui/gui-x11.pro | |||
@@ -0,0 +1,11 @@ | |||
1 | DESTDIR = . | ||
2 | TEMPLATE = app | ||
3 | CONFIG = qt warn_on debug | ||
4 | #CONFIG = qt warn_on release | ||
5 | HEADERS = wellenreiterbase.h wellenreiter.h scanlistitem.h scanlist.h logwindow.h hexwindow.h configwindow.h resource.h | ||
6 | SOURCES = main.cpp wellenreiterbase.cpp wellenreiter.cpp scanlistitem.cpp scanlist.cpp logwindow.cpp hexwindow.cpp configwindow.cpp resource.cpp | ||
7 | INCLUDEPATH += ../daemon | ||
8 | DEPENDPATH += ../daemon | ||
9 | LIBS += -lwellenreiter | ||
10 | INTERFACES = configbase.ui | ||
11 | TARGET = wellenreiter | ||
diff --git a/noncore/net/wellenreiter/gui/main.cpp b/noncore/net/wellenreiter/gui/main.cpp index 4b8d489..3307d49 100644 --- a/noncore/net/wellenreiter/gui/main.cpp +++ b/noncore/net/wellenreiter/gui/main.cpp | |||
@@ -1,42 +1,43 @@ | |||
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 "wellenreiter.h" | 16 | #include "wellenreiter.h" |
17 | 17 | ||
18 | #ifdef QWS | 18 | #ifdef QWS |
19 | #include <qpe/qpeapplication.h> | 19 | #include <qpe/qpeapplication.h> |
20 | #else | 20 | #else |
21 | #include <qapplication.h> | 21 | #include <qapplication.h> |
22 | #endif | 22 | #endif |
23 | 23 | ||
24 | int main( int argc, char **argv ) | 24 | int main( int argc, char **argv ) |
25 | { | 25 | { |
26 | #ifdef QWS | 26 | #ifdef QWS |
27 | QPEApplication a( argc, argv ); | 27 | QPEApplication a( argc, argv ); |
28 | #else | 28 | #else |
29 | QApplication a( argc, argv ); | 29 | QApplication a( argc, argv ); |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | Wellenreiter e; | 32 | Wellenreiter e; |
33 | 33 | ||
34 | e.setCaption( Wellenreiter::tr("Wellenreiter") ); | 34 | e.setCaption( Wellenreiter::tr("Wellenreiter") ); |
35 | #ifdef QWS | 35 | #ifdef QWS |
36 | a.showMainWidget(&e); | 36 | a.showMainWidget(&e); |
37 | #else | 37 | #else |
38 | a.setMainWidget(&e); | 38 | a.setMainWidget(&e); |
39 | e.show(); | ||
39 | #endif | 40 | #endif |
40 | 41 | ||
41 | return a.exec(); | 42 | return a.exec(); |
42 | } | 43 | } |
diff --git a/noncore/net/wellenreiter/gui/resource.cpp b/noncore/net/wellenreiter/gui/resource.cpp new file mode 100644 index 0000000..58c6bed --- a/dev/null +++ b/noncore/net/wellenreiter/gui/resource.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 "resource.h" | ||
17 | |||
18 | #define PIXMAPPATH "/home/mickey/work/opie/pics" | ||
19 | |||
20 | namespace Resource | ||
21 | { | ||
22 | |||
23 | QPixmap loadPixmap( const QString& pix ) | ||
24 | { | ||
25 | QString filename; | ||
26 | filename.sprintf( "%s/%s.png", (const char*) PIXMAPPATH, (const char*) pix ); | ||
27 | QPixmap pixmap( filename ); | ||
28 | if ( pixmap.isNull() ) | ||
29 | { | ||
30 | qDebug( "Wellenreiter::Resource: can't find pixmap " + filename ); | ||
31 | } | ||
32 | return pixmap; | ||
33 | }; | ||
34 | |||
35 | }; | ||
diff --git a/noncore/net/wellenreiter/gui/resource.h b/noncore/net/wellenreiter/gui/resource.h new file mode 100644 index 0000000..6a3cc99 --- a/dev/null +++ b/noncore/net/wellenreiter/gui/resource.h | |||
@@ -0,0 +1,26 @@ | |||
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 RESOURCE_H | ||
17 | #define RESOURCE_H | ||
18 | |||
19 | #include <qpixmap.h> | ||
20 | |||
21 | namespace Resource | ||
22 | { | ||
23 | QPixmap loadPixmap( const QString& ); | ||
24 | } | ||
25 | |||
26 | #endif // RESOURCE_H | ||
diff --git a/noncore/net/wellenreiter/gui/scanlistitem.cpp b/noncore/net/wellenreiter/gui/scanlistitem.cpp index 398b42d..1e2a52e 100644 --- a/noncore/net/wellenreiter/gui/scanlistitem.cpp +++ b/noncore/net/wellenreiter/gui/scanlistitem.cpp | |||
@@ -1,68 +1,73 @@ | |||
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 "scanlistitem.h" | 16 | #include "scanlistitem.h" |
17 | #include <qpe/resource.h> | ||
18 | #include <assert.h> | 17 | #include <assert.h> |
19 | #include <qpixmap.h> | 18 | #include <qpixmap.h> |
20 | 19 | ||
20 | #ifdef QWS | ||
21 | #include <qpe/resource.h> | ||
22 | #else | ||
23 | #include "resource.h" | ||
24 | #endif | ||
25 | |||
21 | const int col_type = 0; | 26 | const int col_type = 0; |
22 | const int col_essid = 0; | 27 | const int col_essid = 0; |
23 | const int col_sig = 1; | 28 | const int col_sig = 1; |
24 | const int col_ap = 2; | 29 | const int col_ap = 2; |
25 | const int col_channel = 3; | 30 | const int col_channel = 3; |
26 | const int col_wep = 4; | 31 | const int col_wep = 4; |
27 | const int col_traffic = 5; | 32 | const int col_traffic = 5; |
28 | 33 | ||
29 | MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QString macaddr, | 34 | MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QString macaddr, |
30 | bool wep, int channel, int signal ) | 35 | bool wep, int channel, int signal ) |
31 | :QListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) | 36 | :QListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) |
32 | { | 37 | { |
33 | qDebug( "creating scanlist item" ); | 38 | qDebug( "creating scanlist item" ); |
34 | decorateItem( type, essid, macaddr, wep, channel, signal ); | 39 | decorateItem( type, essid, macaddr, wep, channel, signal ); |
35 | } | 40 | } |
36 | 41 | ||
37 | MScanListItem::MScanListItem( QListViewItem* parent, QString type, QString essid, QString macaddr, | 42 | MScanListItem::MScanListItem( QListViewItem* parent, QString type, QString essid, QString macaddr, |
38 | bool wep, int channel, int signal ) | 43 | bool wep, int channel, int signal ) |
39 | :QListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) | 44 | :QListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) |
40 | { | 45 | { |
41 | qDebug( "creating scanlist item" ); | 46 | qDebug( "creating scanlist item" ); |
42 | decorateItem( type, essid, macaddr, wep, channel, signal ); | 47 | decorateItem( type, essid, macaddr, wep, channel, signal ); |
43 | } | 48 | } |
44 | 49 | ||
45 | void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ) | 50 | void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ) |
46 | { | 51 | { |
47 | qDebug( "decorating scanlist item %s / %s / %s [%d]", | 52 | qDebug( "decorating scanlist item %s / %s / %s [%d]", |
48 | (const char*) type, | 53 | (const char*) type, |
49 | (const char*) essid, | 54 | (const char*) essid, |
50 | (const char*) macaddr, | 55 | (const char*) macaddr, |
51 | channel ); | 56 | channel ); |
52 | 57 | ||
53 | // set icon for managed or adhoc mode | 58 | // set icon for managed or adhoc mode |
54 | QString name; | 59 | QString name; |
55 | name.sprintf( "wellenreiter/%s", (const char*) type ); | 60 | name.sprintf( "wellenreiter/%s", (const char*) type ); |
56 | setPixmap( col_type, Resource::loadPixmap( name ) ); | 61 | setPixmap( col_type, Resource::loadPixmap( name ) ); |
57 | 62 | ||
58 | // set icon for wep (wireless encryption protocol) | 63 | // set icon for wep (wireless encryption protocol) |
59 | if ( wep ) | 64 | if ( wep ) |
60 | setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); // rename the pixmap! | 65 | setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); // rename the pixmap! |
61 | 66 | ||
62 | // set channel and signal text | 67 | // set channel and signal text |
63 | 68 | ||
64 | if ( signal != -1 ) | 69 | if ( signal != -1 ) |
65 | setText( col_sig, QString::number( signal ) ); | 70 | setText( col_sig, QString::number( signal ) ); |
66 | if ( channel != -1 ) | 71 | if ( channel != -1 ) |
67 | setText( col_channel, QString::number( channel ) ); | 72 | setText( col_channel, QString::number( channel ) ); |
68 | 73 | ||
diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp index aa94c81..5017b08 100644 --- a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp | |||
@@ -1,171 +1,191 @@ | |||
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> | ||
24 | #include <qlayout.h> | 23 | #include <qlayout.h> |
25 | #include <qvariant.h> | 24 | #include <qvariant.h> |
26 | #include <qtooltip.h> | 25 | #include <qtooltip.h> |
27 | #include <qwhatsthis.h> | 26 | #include <qwhatsthis.h> |
28 | #include <qimage.h> | 27 | #include <qimage.h> |
29 | #include <qpixmap.h> | 28 | #include <qpixmap.h> |
30 | 29 | ||
31 | #include "logwindow.h" | 30 | #include "logwindow.h" |
32 | #include "hexwindow.h" | 31 | #include "hexwindow.h" |
33 | #include "configwindow.h" | 32 | #include "configwindow.h" |
34 | 33 | ||
34 | #ifdef QWS | ||
35 | #include <qpe/resource.h> | 35 | #include <qpe/resource.h> |
36 | #include <opie/otabwidget.h> | ||
37 | #else | ||
38 | #include "resource.h" | ||
39 | #include <qtabwidget.h> | ||
40 | #endif | ||
36 | 41 | ||
37 | 42 | ||
38 | /* | 43 | /* |
39 | * Constructs a WellenreiterBase which is a child of 'parent', with the | 44 | * Constructs a WellenreiterBase which is a child of 'parent', with the |
40 | * name 'name' and widget flags set to 'f' | 45 | * name 'name' and widget flags set to 'f' |
41 | */ | 46 | */ |
42 | WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl ) | 47 | WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl ) |
43 | : QWidget( parent, name, fl ) | 48 | : QWidget( parent, name, fl ) |
44 | { | 49 | { |
45 | if ( !name ) | 50 | if ( !name ) |
46 | setName( "WellenreiterBase" ); | 51 | setName( "WellenreiterBase" ); |
47 | resize( 191, 294 ); | 52 | resize( 191, 294 ); |
48 | setCaption( tr( "Wellenreiter" ) ); | 53 | setCaption( tr( "Wellenreiter" ) ); |
49 | WellenreiterBaseLayout = new QVBoxLayout( this ); | 54 | WellenreiterBaseLayout = new QVBoxLayout( this ); |
50 | WellenreiterBaseLayout->setSpacing( 2 ); | 55 | WellenreiterBaseLayout->setSpacing( 2 ); |
51 | WellenreiterBaseLayout->setMargin( 0 ); | 56 | WellenreiterBaseLayout->setMargin( 0 ); |
52 | 57 | #ifdef QWS | |
53 | TabWidget = new OTabWidget( this, "TabWidget", OTabWidget::Global ); | 58 | TabWidget = new OTabWidget( this, "TabWidget", OTabWidget::Global ); |
54 | 59 | #else | |
60 | TabWidget = new QTabWidget( this, "TabWidget" ); | ||
61 | #endif | ||
55 | ap = new QWidget( TabWidget, "ap" ); | 62 | ap = new QWidget( TabWidget, "ap" ); |
56 | apLayout = new QVBoxLayout( ap ); | 63 | apLayout = new QVBoxLayout( ap ); |
57 | apLayout->setSpacing( 2 ); | 64 | apLayout->setSpacing( 2 ); |
58 | apLayout->setMargin( 2 ); | 65 | apLayout->setMargin( 2 ); |
59 | 66 | ||
60 | //--------- NETVIEW TAB -------------- | 67 | //--------- NETVIEW TAB -------------- |
61 | 68 | ||
62 | netview = new QListView( ap, "netview" ); | 69 | netview = new QListView( ap, "netview" ); |
63 | netview->addColumn( tr( "SSID" ) ); | 70 | netview->addColumn( tr( "SSID" ) ); |
64 | netview->setColumnAlignment( 0, AlignLeft || AlignVCenter ); | 71 | netview->setColumnAlignment( 0, AlignLeft || AlignVCenter ); |
65 | netview->addColumn( tr( "Sig" ) ); | 72 | netview->addColumn( tr( "Sig" ) ); |
66 | netview->setColumnAlignment( 1, AlignCenter ); | 73 | netview->setColumnAlignment( 1, AlignCenter ); |
67 | netview->addColumn( tr( "AP" ) ); | 74 | netview->addColumn( tr( "AP" ) ); |
68 | netview->setColumnAlignment( 2, AlignCenter ); | 75 | netview->setColumnAlignment( 2, AlignCenter ); |
69 | netview->addColumn( tr( "Chn" ) ); | 76 | netview->addColumn( tr( "Chn" ) ); |
70 | netview->setColumnAlignment( 3, AlignCenter ); | 77 | netview->setColumnAlignment( 3, AlignCenter ); |
71 | netview->addColumn( tr( "W" ) ); | 78 | netview->addColumn( tr( "W" ) ); |
72 | netview->setColumnAlignment( 4, AlignCenter ); | 79 | netview->setColumnAlignment( 4, AlignCenter ); |
73 | netview->addColumn( tr( "T" ) ); | 80 | netview->addColumn( tr( "T" ) ); |
74 | netview->setColumnAlignment( 5, AlignCenter ); | 81 | netview->setColumnAlignment( 5, AlignCenter ); |
75 | 82 | ||
76 | netview->setFrameShape( QListView::StyledPanel ); | 83 | netview->setFrameShape( QListView::StyledPanel ); |
77 | netview->setFrameShadow( QListView::Sunken ); | 84 | netview->setFrameShadow( QListView::Sunken ); |
78 | netview->setRootIsDecorated( TRUE ); | 85 | netview->setRootIsDecorated( TRUE ); |
79 | apLayout->addWidget( netview ); | 86 | apLayout->addWidget( netview ); |
80 | TabWidget->addTab( ap, "wellenreiter/networks", tr( "Networks" ) ); | 87 | |
81 | 88 | ||
82 | //--------- LOG TAB -------------- | 89 | //--------- LOG TAB -------------- |
83 | 90 | ||
84 | logwindow = new MLogWindow( TabWidget, "Log" ); | 91 | logwindow = new MLogWindow( TabWidget, "Log" ); |
85 | TabWidget->addTab( logwindow, "wellenreiter/log", tr( "Log" ) ); | 92 | |
86 | 93 | ||
87 | //--------- HEX TAB -------------- | 94 | //--------- HEX TAB -------------- |
88 | 95 | ||
89 | hexwindow = new MHexWindow( TabWidget, "Hex" ); | 96 | hexwindow = new MHexWindow( TabWidget, "Hex" ); |
90 | TabWidget->addTab( hexwindow, "wellenreiter/hex", tr( "Hex" ) ); | ||
91 | 97 | ||
92 | //--------- CONFIG TAB -------------- | 98 | //--------- CONFIG TAB -------------- |
93 | 99 | ||
94 | configwindow = new WellenreiterConfigWindow( TabWidget, "Config" ); | 100 | configwindow = new WellenreiterConfigWindow( TabWidget, "Config" ); |
95 | TabWidget->addTab( configwindow, "wellenreiter/config", tr( "Config" ) ); | ||
96 | 101 | ||
97 | //--------- ABOUT TAB -------------- | 102 | //--------- ABOUT TAB -------------- |
98 | 103 | ||
99 | about = new QWidget( TabWidget, "about" ); | 104 | about = new QWidget( TabWidget, "about" ); |
100 | aboutLayout = new QGridLayout( about ); | 105 | aboutLayout = new QGridLayout( about ); |
101 | aboutLayout->setSpacing( 6 ); | 106 | aboutLayout->setSpacing( 6 ); |
102 | aboutLayout->setMargin( 11 ); | 107 | aboutLayout->setMargin( 11 ); |
103 | 108 | ||
104 | PixmapLabel1_3_2 = new QLabel( about, "PixmapLabel1_3_2" ); | 109 | PixmapLabel1_3_2 = new QLabel( about, "PixmapLabel1_3_2" ); |
105 | PixmapLabel1_3_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, PixmapLabel1_3_2->sizePolicy().hasHeightForWidth() ) ); | 110 | PixmapLabel1_3_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, PixmapLabel1_3_2->sizePolicy().hasHeightForWidth() ) ); |
106 | PixmapLabel1_3_2->setFrameShape( QLabel::Panel ); | 111 | PixmapLabel1_3_2->setFrameShape( QLabel::Panel ); |
107 | PixmapLabel1_3_2->setFrameShadow( QLabel::Sunken ); | 112 | PixmapLabel1_3_2->setFrameShadow( QLabel::Sunken ); |
108 | PixmapLabel1_3_2->setLineWidth( 2 ); | 113 | PixmapLabel1_3_2->setLineWidth( 2 ); |
109 | PixmapLabel1_3_2->setMargin( 0 ); | 114 | PixmapLabel1_3_2->setMargin( 0 ); |
110 | PixmapLabel1_3_2->setMidLineWidth( 0 ); | 115 | PixmapLabel1_3_2->setMidLineWidth( 0 ); |
111 | PixmapLabel1_3_2->setPixmap( Resource::loadPixmap( "wellenreiter/logo" ) ); | 116 | PixmapLabel1_3_2->setPixmap( Resource::loadPixmap( "wellenreiter/logo" ) ); |
112 | PixmapLabel1_3_2->setScaledContents( TRUE ); | 117 | PixmapLabel1_3_2->setScaledContents( TRUE ); |
113 | PixmapLabel1_3_2->setAlignment( int( QLabel::AlignCenter ) ); | 118 | PixmapLabel1_3_2->setAlignment( int( QLabel::AlignCenter ) ); |
114 | 119 | ||
115 | aboutLayout->addWidget( PixmapLabel1_3_2, 0, 0 ); | 120 | aboutLayout->addWidget( PixmapLabel1_3_2, 0, 0 ); |
116 | 121 | ||
117 | TextLabel1_4_2 = new QLabel( about, "TextLabel1_4_2" ); | 122 | TextLabel1_4_2 = new QLabel( about, "TextLabel1_4_2" ); |
118 | QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); | 123 | QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); |
119 | TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); | 124 | TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); |
120 | TextLabel1_4_2_font.setPointSize( 10 ); | 125 | TextLabel1_4_2_font.setPointSize( 10 ); |
121 | TextLabel1_4_2->setFont( TextLabel1_4_2_font ); | 126 | TextLabel1_4_2->setFont( TextLabel1_4_2_font ); |
122 | TextLabel1_4_2->setText( tr( "<p align=center>\n" | 127 | TextLabel1_4_2->setText( tr( "<p align=center>\n" |
123 | "<hr>\n" | 128 | "<hr>\n" |
124 | "Max Moser<br>\n" | 129 | "Max Moser<br>\n" |
125 | "Martin J. Muench<br>\n" | 130 | "Martin J. Muench<br>\n" |
126 | "Michael Lauer<br><hr>\n" | 131 | "Michael Lauer<br><hr>\n" |
127 | "<b>www.remote-exploit.org</b>\n" | 132 | "<b>www.remote-exploit.org</b>\n" |
128 | "</p>" ) ); | 133 | "</p>" ) ); |
129 | TextLabel1_4_2->setAlignment( int( QLabel::AlignCenter ) ); | 134 | TextLabel1_4_2->setAlignment( int( QLabel::AlignCenter ) ); |
130 | 135 | ||
131 | aboutLayout->addWidget( TextLabel1_4_2, 1, 0 ); | 136 | aboutLayout->addWidget( TextLabel1_4_2, 1, 0 ); |
132 | TabWidget->addTab( about, "wellenreiter/about", tr( "About" ) ); | ||
133 | WellenreiterBaseLayout->addWidget( TabWidget ); | ||
134 | 137 | ||
135 | button = new QPushButton( this, "button" ); | 138 | button = new QPushButton( this, "button" ); |
136 | button->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, button->sizePolicy().hasHeightForWidth() ) ); | 139 | button->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, button->sizePolicy().hasHeightForWidth() ) ); |
137 | button->setText( tr( "Start Scanning" ) ); | 140 | button->setText( tr( "Start Scanning" ) ); |
138 | WellenreiterBaseLayout->addWidget( button ); | ||
139 | 141 | ||
142 | #ifdef QWS | ||
143 | TabWidget->addTab( ap, "wellenreiter/networks", tr( "Networks" ) ); | ||
144 | TabWidget->addTab( logwindow, "wellenreiter/log", tr( "Log" ) ); | ||
145 | TabWidget->addTab( hexwindow, "wellenreiter/hex", tr( "Hex" ) ); | ||
146 | TabWidget->addTab( configwindow, "wellenreiter/config", tr( "Config" ) ); | ||
147 | TabWidget->addTab( about, "wellenreiter/about", tr( "About" ) ); | ||
148 | #else | ||
149 | TabWidget->addTab( ap, /* "wellenreiter/networks", */ tr( "Networks" ) ); | ||
150 | TabWidget->addTab( logwindow, /* "wellenreiter/log", */ tr( "Log" ) ); | ||
151 | TabWidget->addTab( hexwindow, /* "wellenreiter/hex", */ tr( "Hex" ) ); | ||
152 | TabWidget->addTab( configwindow, /* "wellenreiter/config", */ tr( "Config" ) ); | ||
153 | TabWidget->addTab( about, /* "wellenreiter/about", */ tr( "About" ) ); | ||
154 | #endif | ||
155 | WellenreiterBaseLayout->addWidget( TabWidget ); | ||
156 | WellenreiterBaseLayout->addWidget( button ); | ||
157 | |||
158 | #ifdef QWS | ||
140 | TabWidget->setCurrentTab( tr( "Networks" ) ); | 159 | TabWidget->setCurrentTab( tr( "Networks" ) ); |
160 | #endif | ||
141 | 161 | ||
142 | } | 162 | } |
143 | 163 | ||
144 | /* | 164 | /* |
145 | * Destroys the object and frees any allocated resources | 165 | * Destroys the object and frees any allocated resources |
146 | */ | 166 | */ |
147 | WellenreiterBase::~WellenreiterBase() | 167 | WellenreiterBase::~WellenreiterBase() |
148 | { | 168 | { |
149 | // no need to delete child widgets, Qt does it all for us | 169 | // no need to delete child widgets, Qt does it all for us |
150 | } | 170 | } |
151 | 171 | ||
152 | /* | 172 | /* |
153 | * Main event handler. Reimplemented to handle application | 173 | * Main event handler. Reimplemented to handle application |
154 | * font changes | 174 | * font changes |
155 | */ | 175 | */ |
156 | bool WellenreiterBase::event( QEvent* ev ) | 176 | bool WellenreiterBase::event( QEvent* ev ) |
157 | { | 177 | { |
158 | bool ret = QWidget::event( ev ); | 178 | bool ret = QWidget::event( ev ); |
159 | if ( ev->type() == QEvent::ApplicationFontChange ) { | 179 | if ( ev->type() == QEvent::ApplicationFontChange ) { |
160 | //QFont Log_2_font( Log_2->font() ); | 180 | //QFont Log_2_font( Log_2->font() ); |
161 | //Log_2_font.setFamily( "adobe-courier" ); | 181 | //Log_2_font.setFamily( "adobe-courier" ); |
162 | //Log_2_font.setPointSize( 8 ); | 182 | //Log_2_font.setPointSize( 8 ); |
163 | //Log_2->setFont( Log_2_font ); | 183 | //Log_2->setFont( Log_2_font ); |
164 | QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); | 184 | QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); |
165 | TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); | 185 | TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); |
166 | TextLabel1_4_2_font.setPointSize( 10 ); | 186 | TextLabel1_4_2_font.setPointSize( 10 ); |
167 | TextLabel1_4_2->setFont( TextLabel1_4_2_font ); | 187 | TextLabel1_4_2->setFont( TextLabel1_4_2_font ); |
168 | } | 188 | } |
169 | return ret; | 189 | return ret; |
170 | } | 190 | } |
171 | 191 | ||
diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.h b/noncore/net/wellenreiter/gui/wellenreiterbase.h index 4e5ca94..fce25d1 100644 --- a/noncore/net/wellenreiter/gui/wellenreiterbase.h +++ b/noncore/net/wellenreiter/gui/wellenreiterbase.h | |||
@@ -1,59 +1,68 @@ | |||
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> |
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 QPushButton; | 27 | class QPushButton; |
28 | class OTabWidget; | ||
29 | class MLogWindow; | 28 | class MLogWindow; |
30 | class MHexWindow; | 29 | class MHexWindow; |
31 | class WellenreiterConfigWindow; | 30 | class WellenreiterConfigWindow; |
32 | 31 | ||
32 | #ifdef QWS | ||
33 | class OTabWidget; | ||
34 | #else | ||
35 | class QTabWidget; | ||
36 | #endif | ||
37 | |||
33 | class WellenreiterBase : public QWidget | 38 | class WellenreiterBase : public QWidget |
34 | { | 39 | { |
35 | Q_OBJECT | 40 | Q_OBJECT |
36 | 41 | ||
37 | public: | 42 | public: |
38 | WellenreiterBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 43 | WellenreiterBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
39 | ~WellenreiterBase(); | 44 | ~WellenreiterBase(); |
40 | 45 | ||
46 | #ifdef QWS | ||
41 | OTabWidget* TabWidget; | 47 | OTabWidget* TabWidget; |
48 | #else | ||
49 | QTabWidget* TabWidget; | ||
50 | #endif | ||
42 | QWidget* ap; | 51 | QWidget* ap; |
43 | QListView* netview; | 52 | QListView* netview; |
44 | MLogWindow* logwindow; | 53 | MLogWindow* logwindow; |
45 | MHexWindow* hexwindow; | 54 | MHexWindow* hexwindow; |
46 | WellenreiterConfigWindow* configwindow; | 55 | WellenreiterConfigWindow* configwindow; |
47 | QWidget* about; | 56 | QWidget* about; |
48 | QLabel* PixmapLabel1_3_2; | 57 | QLabel* PixmapLabel1_3_2; |
49 | QLabel* TextLabel1_4_2; | 58 | QLabel* TextLabel1_4_2; |
50 | QPushButton* button; | 59 | QPushButton* button; |
51 | 60 | ||
52 | protected: | 61 | protected: |
53 | QVBoxLayout* WellenreiterBaseLayout; | 62 | QVBoxLayout* WellenreiterBaseLayout; |
54 | QVBoxLayout* apLayout; | 63 | QVBoxLayout* apLayout; |
55 | QGridLayout* aboutLayout; | 64 | QGridLayout* aboutLayout; |
56 | bool event( QEvent* ); | 65 | bool event( QEvent* ); |
57 | }; | 66 | }; |
58 | 67 | ||
59 | #endif // WELLENREITERBASE_H | 68 | #endif // WELLENREITERBASE_H |