author | mickeyl <mickeyl> | 2002-12-14 18:30:49 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2002-12-14 18:30:49 (UTC) |
commit | 57918323f3b2e1377d9cf97ed6466e31b260d24a (patch) (unidiff) | |
tree | de2cc333e1239464d3af1f23fbe5a6006bcc8e85 | |
parent | ade8c5fddf3f125ee276c4c19d1646a9ef4cab08 (diff) | |
download | opie-57918323f3b2e1377d9cf97ed6466e31b260d24a.zip opie-57918323f3b2e1377d9cf97ed6466e31b260d24a.tar.gz opie-57918323f3b2e1377d9cf97ed6466e31b260d24a.tar.bz2 |
- support compilation for Qt/X11
-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 | 38 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiterbase.h | 11 |
7 files changed, 118 insertions, 11 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 | |||
@@ -37,4 +37,5 @@ int main( int argc, char **argv ) | |||
37 | #else | 37 | #else |
38 | a.setMainWidget(&e); | 38 | a.setMainWidget(&e); |
39 | e.show(); | ||
39 | #endif | 40 | #endif |
40 | 41 | ||
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 | |||
@@ -15,8 +15,13 @@ | |||
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; |
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 | |||
@@ -21,5 +21,4 @@ | |||
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> |
@@ -33,5 +32,11 @@ | |||
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 | ||
@@ -50,7 +55,9 @@ WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags f | |||
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 ); |
@@ -78,20 +85,18 @@ WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags f | |||
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 -------------- |
@@ -130,13 +135,28 @@ WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags f | |||
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" ) ); |
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 ); | ||
138 | WellenreiterBaseLayout->addWidget( button ); | 156 | WellenreiterBaseLayout->addWidget( button ); |
139 | 157 | ||
158 | #ifdef QWS | ||
140 | TabWidget->setCurrentTab( tr( "Networks" ) ); | 159 | TabWidget->setCurrentTab( tr( "Networks" ) ); |
160 | #endif | ||
141 | 161 | ||
142 | } | 162 | } |
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 | |||
@@ -26,9 +26,14 @@ 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 | { |
@@ -39,5 +44,9 @@ public: | |||
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; |