summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2003-03-04 14:24:58 (UTC)
committer mickeyl <mickeyl>2003-03-04 14:24:58 (UTC)
commit8642232f4435bc5341037527d1eb12d1f39781f4 (patch) (unidiff)
tree495a20be66433317753e7b98aec57a0de8ca53b3
parent3adca473d5440b00e15781627e00465350e9118b (diff)
downloadopie-8642232f4435bc5341037527d1eb12d1f39781f4.zip
opie-8642232f4435bc5341037527d1eb12d1f39781f4.tar.gz
opie-8642232f4435bc5341037527d1eb12d1f39781f4.tar.bz2
add missing header for x11 standalone build
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/mainwindow.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp
index 1185f84..d4988af 100644
--- a/noncore/net/wellenreiter/gui/mainwindow.cpp
+++ b/noncore/net/wellenreiter/gui/mainwindow.cpp
@@ -1,167 +1,168 @@
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 "configwindow.h" 16#include "configwindow.h"
17#include "logwindow.h" 17#include "logwindow.h"
18#include "mainwindow.h" 18#include "mainwindow.h"
19#include "wellenreiter.h" 19#include "wellenreiter.h"
20 20
21#include "scanlist.h" 21#include "scanlist.h"
22 22
23#include <qcombobox.h> 23#include <qcombobox.h>
24#include <qdatastream.h> 24#include <qdatastream.h>
25#include <qfile.h> 25#include <qfile.h>
26#include <qfileinfo.h> 26#include <qfileinfo.h>
27#include <qiconset.h> 27#include <qiconset.h>
28#include <qmenubar.h> 28#include <qmenubar.h>
29#include <qmessagebox.h> 29#include <qmessagebox.h>
30#include <qpopupmenu.h> 30#include <qpopupmenu.h>
31#include <qstatusbar.h> 31#include <qstatusbar.h>
32#include <qtextstream.h> 32#include <qtextstream.h>
33#include <qtoolbutton.h> 33#include <qtoolbutton.h>
34 34
35#ifdef QWS 35#ifdef QWS
36#include <qpe/resource.h> 36#include <qpe/resource.h>
37#include <opie/ofiledialog.h> 37#include <opie/ofiledialog.h>
38#else 38#else
39#include "resource.h" 39#include "resource.h"
40#include <qapplication.h>
40#include <qfiledialog.h> 41#include <qfiledialog.h>
41#endif 42#endif
42 43
43WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * name, WFlags f ) 44WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * name, WFlags f )
44 :QMainWindow( parent, name, f ) 45 :QMainWindow( parent, name, f )
45{ 46{
46 cw = new WellenreiterConfigWindow( this ); 47 cw = new WellenreiterConfigWindow( this );
47 mw = new Wellenreiter( this ); 48 mw = new Wellenreiter( this );
48 mw->setConfigWindow( cw ); 49 mw->setConfigWindow( cw );
49 setCentralWidget( mw ); 50 setCentralWidget( mw );
50 51
51 // setup application icon 52 // setup application icon
52 53
53 #ifndef QWS 54 #ifndef QWS
54 setIcon( Resource::loadPixmap( "wellenreiter/appicon-trans" ) ); 55 setIcon( Resource::loadPixmap( "wellenreiter/appicon-trans" ) );
55 setIconText( "Wellenreiter/X11" ); 56 setIconText( "Wellenreiter/X11" );
56 #endif 57 #endif
57 58
58 // setup icon sets 59 // setup icon sets
59 60
60 infoIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/InfoIcon" ) ); 61 infoIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/InfoIcon" ) );
61 settingsIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SettingsIcon" ) ); 62 settingsIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SettingsIcon" ) );
62 #ifdef QWS 63 #ifdef QWS
63 searchIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SearchIcon" ) ); 64 searchIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SearchIcon" ) );
64 cancelIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/CancelIcon" ) ); 65 cancelIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/CancelIcon" ) );
65 #else 66 #else
66 startStopIconSet = new QIconSet(); 67 startStopIconSet = new QIconSet();
67 startStopIconSet->setPixmap( Resource::loadPixmap( "wellenreiter/SearchIcon" ), QIconSet::Automatic, QIconSet::Normal, QIconSet::Off ); 68 startStopIconSet->setPixmap( Resource::loadPixmap( "wellenreiter/SearchIcon" ), QIconSet::Automatic, QIconSet::Normal, QIconSet::Off );
68 startStopIconSet->setPixmap( Resource::loadPixmap( "wellenreiter/CancelIcon" ), QIconSet::Automatic, QIconSet::Normal, QIconSet::On ); 69 startStopIconSet->setPixmap( Resource::loadPixmap( "wellenreiter/CancelIcon" ), QIconSet::Automatic, QIconSet::Normal, QIconSet::On );
69 #endif 70 #endif
70 71
71 // setup tool buttons 72 // setup tool buttons
72 73
73 startStopButton = new QToolButton( 0 ); 74 startStopButton = new QToolButton( 0 );
74 #ifdef QWS 75 #ifdef QWS
75 startStopButton->setAutoRaise( true ); 76 startStopButton->setAutoRaise( true );
76 #endif 77 #endif
77 #ifdef QWS 78 #ifdef QWS
78 startStopButton->setOnIconSet( *cancelIconSet ); 79 startStopButton->setOnIconSet( *cancelIconSet );
79 startStopButton->setOffIconSet( *searchIconSet ); 80 startStopButton->setOffIconSet( *searchIconSet );
80 #else 81 #else
81 startStopButton->setIconSet( *startStopIconSet ); 82 startStopButton->setIconSet( *startStopIconSet );
82 #endif 83 #endif
83 startStopButton->setToggleButton( true ); 84 startStopButton->setToggleButton( true );
84 connect( startStopButton, SIGNAL( clicked() ), mw, SLOT( startStopClicked() ) ); 85 connect( startStopButton, SIGNAL( clicked() ), mw, SLOT( startStopClicked() ) );
85 startStopButton->setEnabled( false ); 86 startStopButton->setEnabled( false );
86 87
87 QToolButton* c = new QToolButton( 0 ); 88 QToolButton* c = new QToolButton( 0 );
88 #ifdef QWS 89 #ifdef QWS
89 c->setAutoRaise( true ); 90 c->setAutoRaise( true );
90 #endif 91 #endif
91 c->setIconSet( *infoIconSet ); 92 c->setIconSet( *infoIconSet );
92 c->setEnabled( false ); 93 c->setEnabled( false );
93 94
94 QToolButton* d = new QToolButton( 0 ); 95 QToolButton* d = new QToolButton( 0 );
95 #ifdef QWS 96 #ifdef QWS
96 d->setAutoRaise( true ); 97 d->setAutoRaise( true );
97 #endif 98 #endif
98 d->setIconSet( *settingsIconSet ); 99 d->setIconSet( *settingsIconSet );
99 connect( d, SIGNAL( clicked() ), this, SLOT( showConfigure() ) ); 100 connect( d, SIGNAL( clicked() ), this, SLOT( showConfigure() ) );
100 101
101 // setup menu bar 102 // setup menu bar
102 103
103 int id; 104 int id;
104 105
105 QMenuBar* mb = menuBar(); 106 QMenuBar* mb = menuBar();
106 107
107 QPopupMenu* fileSave = new QPopupMenu( mb ); 108 QPopupMenu* fileSave = new QPopupMenu( mb );
108 fileSave->insertItem( "&Session...", this, SLOT( fileSaveSession() ) ); 109 fileSave->insertItem( "&Session...", this, SLOT( fileSaveSession() ) );
109 fileSave->insertItem( "&Log...", this, SLOT( fileSaveLog() ) ); 110 fileSave->insertItem( "&Log...", this, SLOT( fileSaveLog() ) );
110 111
111 QPopupMenu* fileLoad = new QPopupMenu( mb ); 112 QPopupMenu* fileLoad = new QPopupMenu( mb );
112 fileLoad->insertItem( "&Session...", this, SLOT( fileLoadSession() ) ); 113 fileLoad->insertItem( "&Session...", this, SLOT( fileLoadSession() ) );
113 //fileLoad->insertItem( "&Log", this, SLOT( fileLoadLog() ) ); 114 //fileLoad->insertItem( "&Log", this, SLOT( fileLoadLog() ) );
114 115
115 QPopupMenu* file = new QPopupMenu( mb ); 116 QPopupMenu* file = new QPopupMenu( mb );
116 id = file->insertItem( "&Load", fileLoad ); 117 id = file->insertItem( "&Load", fileLoad );
117 file->insertItem( "&Save", fileSave ); 118 file->insertItem( "&Save", fileSave );
118 file->insertSeparator(); 119 file->insertSeparator();
119 file->insertItem( "&Exit", qApp, SLOT( quit() ) ); 120 file->insertItem( "&Exit", qApp, SLOT( quit() ) );
120 121
121 QPopupMenu* view = new QPopupMenu( mb ); 122 QPopupMenu* view = new QPopupMenu( mb );
122 view->insertItem( "&Configure..." ); 123 view->insertItem( "&Configure..." );
123 124
124 QPopupMenu* sniffer = new QPopupMenu( mb ); 125 QPopupMenu* sniffer = new QPopupMenu( mb );
125 sniffer->insertItem( "&Configure..." ); 126 sniffer->insertItem( "&Configure..." );
126 sniffer->insertSeparator(); 127 sniffer->insertSeparator();
127 128
128 QPopupMenu* demo = new QPopupMenu( mb ); 129 QPopupMenu* demo = new QPopupMenu( mb );
129 demo->insertItem( "&Add something", this, SLOT( demoAddStations() ) ); 130 demo->insertItem( "&Add something", this, SLOT( demoAddStations() ) );
130 131
131 id = mb->insertItem( "&File", file ); 132 id = mb->insertItem( "&File", file );
132 id = mb->insertItem( "&View", view ); 133 id = mb->insertItem( "&View", view );
133 mb->setItemEnabled( id, false ); 134 mb->setItemEnabled( id, false );
134 id = mb->insertItem( "&Sniffer", sniffer ); 135 id = mb->insertItem( "&Sniffer", sniffer );
135 mb->setItemEnabled( id, false ); 136 mb->setItemEnabled( id, false );
136 id = mb->insertItem( "&Demo", demo ); 137 id = mb->insertItem( "&Demo", demo );
137 mb->setItemEnabled( id, true ); 138 mb->setItemEnabled( id, true );
138 139
139 #ifdef QWS 140 #ifdef QWS
140 mb->insertItem( startStopButton ); 141 mb->insertItem( startStopButton );
141 mb->insertItem( c ); 142 mb->insertItem( c );
142 mb->insertItem( d ); 143 mb->insertItem( d );
143 #else // Qt3 changed the insertion order. It's now totally random :( 144 #else // Qt3 changed the insertion order. It's now totally random :(
144 mb->insertItem( d ); 145 mb->insertItem( d );
145 mb->insertItem( c ); 146 mb->insertItem( c );
146 mb->insertItem( startStopButton ); 147 mb->insertItem( startStopButton );
147 #endif 148 #endif
148 149
149 // setup status bar (for now only on X11) 150 // setup status bar (for now only on X11)
150 151
151 #ifndef QWS 152 #ifndef QWS
152 statusBar()->message( "Ready." ); 153 statusBar()->message( "Ready." );
153 #endif 154 #endif
154 155
155}; 156};
156 157
157void WellenreiterMainWindow::showConfigure() 158void WellenreiterMainWindow::showConfigure()
158{ 159{
159 qDebug( "show configure..." ); 160 qDebug( "show configure..." );
160 cw->setCaption( tr( "Configure" ) ); 161 cw->setCaption( tr( "Configure" ) );
161 #ifdef QWS 162 #ifdef QWS
162 cw->showMaximized(); 163 cw->showMaximized();
163 #endif 164 #endif
164 int result = cw->exec(); 165 int result = cw->exec();
165 166
166 if ( result ) 167 if ( result )
167 { 168 {