author | mickeyl <mickeyl> | 2003-02-24 21:37:49 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-02-24 21:37:49 (UTC) |
commit | d14b92ef8984ae654ff187bf6c8f5946d3ba218d (patch) (unidiff) | |
tree | fd209280150b48eb137315d9bfe693892525697e /noncore/net | |
parent | 93151a1467b45759d320ce6673160190d6ab8872 (diff) | |
download | opie-d14b92ef8984ae654ff187bf6c8f5946d3ba218d.zip opie-d14b92ef8984ae654ff187bf6c8f5946d3ba218d.tar.gz opie-d14b92ef8984ae654ff187bf6c8f5946d3ba218d.tar.bz2 |
- work around yet another g++ 2.x bug
- started work on saving session to xml
[ any classes from libopie I can reuse without too much effort? ]
-rw-r--r-- | noncore/net/wellenreiter/cornucopia/olistview.cpp | 8 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.cpp | 58 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.h | 4 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.cpp | 14 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.h | 4 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlistitem.cpp | 21 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlistitem.h | 4 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 5 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.h | 1 |
9 files changed, 105 insertions, 14 deletions
diff --git a/noncore/net/wellenreiter/cornucopia/olistview.cpp b/noncore/net/wellenreiter/cornucopia/olistview.cpp index bca17b2..8bc59de 100644 --- a/noncore/net/wellenreiter/cornucopia/olistview.cpp +++ b/noncore/net/wellenreiter/cornucopia/olistview.cpp | |||
@@ -199,16 +199,16 @@ const QColor &OListViewItem::backgroundColor() | |||
199 | bool OListViewItem::isAlternate() | 199 | bool OListViewItem::isAlternate() |
200 | { | 200 | { |
201 | OListView *lv = static_cast<OListView*>( listView() ); | 201 | OListView *lv = static_cast<OListView*>( listView() ); |
202 | 202 | ||
203 | // check if the item above is an OListViewItem | 203 | // check if the item above is an OListViewItem |
204 | OListViewItem *above = static_cast<OListViewItem*>( itemAbove() ); | 204 | OListViewItem *above = static_cast<OListViewItem*>( itemAbove() ); |
205 | /*if (not itemAbove()->inherits( "OListViewItem" )) return false;*/ | 205 | /*if (! itemAbove()->inherits( "OListViewItem" )) return false;*/ |
206 | 206 | ||
207 | // check if we have a valid alternate background color | 207 | // check if we have a valid alternate background color |
208 | if (not (lv && lv->alternateBackground().isValid())) return false; | 208 | if (!(lv && lv->alternateBackground().isValid())) return false; |
209 | 209 | ||
210 | m_known = above ? above->m_known : true; | 210 | m_known = above ? above->m_known : true; |
211 | if (m_known) | 211 | if (m_known) |
212 | { | 212 | { |
213 | m_odd = above ? !above->m_odd : false; | 213 | m_odd = above ? !above->m_odd : false; |
214 | } | 214 | } |
@@ -218,25 +218,25 @@ bool OListViewItem::isAlternate() | |||
218 | bool previous = true; | 218 | bool previous = true; |
219 | if (parent()) | 219 | if (parent()) |
220 | { | 220 | { |
221 | item = static_cast<OListViewItem *>(parent()); | 221 | item = static_cast<OListViewItem *>(parent()); |
222 | if ( item /*&& item->inherits( "OListViewItem" )*/ ) previous = item->m_odd; | 222 | if ( item /*&& item->inherits( "OListViewItem" )*/ ) previous = item->m_odd; |
223 | item = static_cast<OListViewItem *>(parent()->firstChild()); | 223 | item = static_cast<OListViewItem *>(parent()->firstChild()); |
224 | /* if !( item.inherits( "OListViewItem" ) item = 0; */ | 224 | /* if ( !item.inherits( "OListViewItem" ) item = 0; */ |
225 | } | 225 | } |
226 | else | 226 | else |
227 | { | 227 | { |
228 | item = static_cast<OListViewItem *>(lv->firstChild()); | 228 | item = static_cast<OListViewItem *>(lv->firstChild()); |
229 | } | 229 | } |
230 | 230 | ||
231 | while(item) | 231 | while(item) |
232 | { | 232 | { |
233 | item->m_odd = previous = !previous; | 233 | item->m_odd = previous = !previous; |
234 | item->m_known = true; | 234 | item->m_known = true; |
235 | item = static_cast<OListViewItem *>(item->nextSibling()); | 235 | item = static_cast<OListViewItem *>(item->nextSibling()); |
236 | /* if !(item.inherits( "OListViewItem" ) ) break; */ | 236 | /* if (!item.inherits( "OListViewItem" ) ) break; */ |
237 | } | 237 | } |
238 | } | 238 | } |
239 | return m_odd; | 239 | return m_odd; |
240 | } | 240 | } |
241 | 241 | ||
242 | void OListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) | 242 | void OListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) |
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp index cb003dd..e388fc5 100644 --- a/noncore/net/wellenreiter/gui/mainwindow.cpp +++ b/noncore/net/wellenreiter/gui/mainwindow.cpp | |||
@@ -21,12 +21,13 @@ | |||
21 | #include "scanlist.h" | 21 | #include "scanlist.h" |
22 | 22 | ||
23 | #include <qcombobox.h> | 23 | #include <qcombobox.h> |
24 | #include <qfile.h> | 24 | #include <qfile.h> |
25 | #include <qiconset.h> | 25 | #include <qiconset.h> |
26 | #include <qmenubar.h> | 26 | #include <qmenubar.h> |
27 | #include <qmessagebox.h> | ||
27 | #include <qpopupmenu.h> | 28 | #include <qpopupmenu.h> |
28 | #include <qstatusbar.h> | 29 | #include <qstatusbar.h> |
29 | #include <qtextstream.h> | 30 | #include <qtextstream.h> |
30 | #include <qtoolbutton.h> | 31 | #include <qtoolbutton.h> |
31 | 32 | ||
32 | #ifdef QWS | 33 | #ifdef QWS |
@@ -56,44 +57,55 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n | |||
56 | startStopIconSet->setPixmap( Resource::loadPixmap( "wellenreiter/CancelIcon" ), QIconSet::Automatic, QIconSet::Normal, QIconSet::On ); | 57 | startStopIconSet->setPixmap( Resource::loadPixmap( "wellenreiter/CancelIcon" ), QIconSet::Automatic, QIconSet::Normal, QIconSet::On ); |
57 | #endif | 58 | #endif |
58 | 59 | ||
59 | // setup tool buttons | 60 | // setup tool buttons |
60 | 61 | ||
61 | startStopButton = new QToolButton( 0 ); | 62 | startStopButton = new QToolButton( 0 ); |
63 | #ifdef QWS | ||
62 | startStopButton->setAutoRaise( true ); | 64 | startStopButton->setAutoRaise( true ); |
65 | #endif | ||
63 | #ifdef QWS | 66 | #ifdef QWS |
64 | startStopButton->setOnIconSet( *cancelIconSet ); | 67 | startStopButton->setOnIconSet( *cancelIconSet ); |
65 | startStopButton->setOffIconSet( *searchIconSet ); | 68 | startStopButton->setOffIconSet( *searchIconSet ); |
66 | #else | 69 | #else |
67 | startStopButton->setIconSet( *startStopIconSet ); | 70 | startStopButton->setIconSet( *startStopIconSet ); |
68 | #endif | 71 | #endif |
69 | startStopButton->setToggleButton( true ); | 72 | startStopButton->setToggleButton( true ); |
70 | connect( startStopButton, SIGNAL( clicked() ), mw, SLOT( startStopClicked() ) ); | 73 | connect( startStopButton, SIGNAL( clicked() ), mw, SLOT( startStopClicked() ) ); |
71 | startStopButton->setEnabled( false ); | 74 | startStopButton->setEnabled( false ); |
72 | 75 | ||
73 | QToolButton* c = new QToolButton( 0 ); | 76 | QToolButton* c = new QToolButton( 0 ); |
77 | #ifdef QWS | ||
74 | c->setAutoRaise( true ); | 78 | c->setAutoRaise( true ); |
79 | #endif | ||
75 | c->setIconSet( *infoIconSet ); | 80 | c->setIconSet( *infoIconSet ); |
76 | c->setEnabled( false ); | 81 | c->setEnabled( false ); |
77 | 82 | ||
78 | QToolButton* d = new QToolButton( 0 ); | 83 | QToolButton* d = new QToolButton( 0 ); |
84 | #ifdef QWS | ||
79 | d->setAutoRaise( true ); | 85 | d->setAutoRaise( true ); |
86 | #endif | ||
80 | d->setIconSet( *settingsIconSet ); | 87 | d->setIconSet( *settingsIconSet ); |
81 | connect( d, SIGNAL( clicked() ), this, SLOT( showConfigure() ) ); | 88 | connect( d, SIGNAL( clicked() ), this, SLOT( showConfigure() ) ); |
82 | 89 | ||
83 | // setup menu bar | 90 | // setup menu bar |
84 | 91 | ||
85 | int id; | 92 | int id; |
86 | 93 | ||
87 | QMenuBar* mb = menuBar(); | 94 | QMenuBar* mb = menuBar(); |
88 | 95 | ||
89 | QPopupMenu* fileSave = new QPopupMenu( mb ); | 96 | QPopupMenu* fileSave = new QPopupMenu( mb ); |
97 | fileSave->insertItem( "&Session", this, SLOT( fileSaveSession() ) ); | ||
90 | fileSave->insertItem( "&Log", this, SLOT( fileSaveLog() ) ); | 98 | fileSave->insertItem( "&Log", this, SLOT( fileSaveLog() ) ); |
91 | 99 | ||
100 | QPopupMenu* fileLoad = new QPopupMenu( mb ); | ||
101 | fileLoad->insertItem( "&Session", this, SLOT( fileLoadSession() ) ); | ||
102 | fileLoad->insertItem( "&Log", this, SLOT( fileLoadLog() ) ); | ||
103 | |||
92 | QPopupMenu* file = new QPopupMenu( mb ); | 104 | QPopupMenu* file = new QPopupMenu( mb ); |
93 | id = file->insertItem( "&Load" ); | 105 | id = file->insertItem( "&Load", fileLoad ); |
94 | file->setItemEnabled( id, false ); | 106 | file->setItemEnabled( id, false ); |
95 | file->insertItem( "&Save", fileSave ); | 107 | file->insertItem( "&Save", fileSave ); |
96 | 108 | ||
97 | QPopupMenu* view = new QPopupMenu( mb ); | 109 | QPopupMenu* view = new QPopupMenu( mb ); |
98 | view->insertItem( "&Configure..." ); | 110 | view->insertItem( "&Configure..." ); |
99 | 111 | ||
@@ -169,30 +181,60 @@ WellenreiterMainWindow::~WellenreiterMainWindow() | |||
169 | #endif | 181 | #endif |
170 | 182 | ||
171 | }; | 183 | }; |
172 | 184 | ||
173 | void WellenreiterMainWindow::demoAddStations() | 185 | void WellenreiterMainWindow::demoAddStations() |
174 | { | 186 | { |
175 | mw->netView()->addNewItem( "managed", "Vanille", "04:00:20:EF:A6:43", true, 6, 80 ); | 187 | mw->netView()->addNewItem( "managed", "Vanille", "00:00:20:EF:A6:43", true, 6, 80 ); |
176 | mw->netView()->addNewItem( "managed", "Vanille", "04:00:20:EF:A6:23", true, 11, 10 ); | 188 | mw->netView()->addNewItem( "managed", "Vanille", "00:00:1c:EF:A6:23", true, 11, 10 ); |
177 | mw->netView()->addNewItem( "adhoc", "ELAN", "40:03:43:E7:16:22", false, 3, 10 ); | 189 | mw->netView()->addNewItem( "adhoc", "ELAN", "00:A0:F8:E7:16:22", false, 3, 10 ); |
178 | mw->netView()->addNewItem( "adhoc", "ELAN", "40:03:53:E7:56:62", false, 3, 15 ); | 190 | mw->netView()->addNewItem( "adhoc", "ELAN", "00:AA:01:E7:56:62", false, 3, 15 ); |
179 | mw->netView()->addNewItem( "adhoc", "ELAN", "40:03:63:E7:56:E2", false, 3, 20 ); | 191 | mw->netView()->addNewItem( "adhoc", "ELAN", "00:B0:8E:E7:56:E2", false, 3, 20 ); |
180 | } | 192 | } |
181 | 193 | ||
182 | void WellenreiterMainWindow::fileSaveLog() | 194 | void WellenreiterMainWindow::fileSaveLog() |
183 | { | 195 | { |
184 | const QString fname( "/tmp/log.txt" ); | 196 | const QString fname( "/tmp/log.txt" ); |
185 | QFile f( fname ); | 197 | QFile f( fname ); |
186 | if ( f.open(IO_WriteOnly) ) | 198 | if ( f.open(IO_WriteOnly) ) |
187 | { | 199 | { |
188 | QTextStream t( &f ); | 200 | QTextStream t( &f ); |
189 | t << mw->logWindow()->getLog(); | 201 | t << mw->logWindow()->getLog(); |
190 | f.close(); | 202 | f.close(); |
191 | qDebug( "saved log in file '%s'", (const char*) fname ); | 203 | qDebug( "Saved log to file '%s'", (const char*) fname ); |
192 | } | 204 | } |
193 | else | 205 | else |
194 | { | 206 | { |
195 | qDebug( "Problem saving log in file '%s'", (const char*) fname ); | 207 | qDebug( "Problem saving log to file '%s'", (const char*) fname ); |
196 | } | 208 | } |
197 | 209 | ||
198 | } \ No newline at end of file | 210 | } \ No newline at end of file |
211 | |||
212 | void WellenreiterMainWindow::fileSaveSession() | ||
213 | { | ||
214 | const QString fname( "/tmp/session.xml" ); | ||
215 | QFile f( fname ); | ||
216 | if ( f.open(IO_WriteOnly) ) | ||
217 | { | ||
218 | QTextStream t( &f ); | ||
219 | mw->netView()->dump( t ); | ||
220 | f.close(); | ||
221 | qDebug( "Saved session to file '%s'", (const char*) fname ); | ||
222 | } | ||
223 | else | ||
224 | { | ||
225 | qDebug( "Problem saving session to file '%s'", (const char*) fname ); | ||
226 | } | ||
227 | } | ||
228 | |||
229 | void WellenreiterMainWindow::closeEvent( QCloseEvent* e ) | ||
230 | { | ||
231 | if ( mw->isDaemonRunning() ) | ||
232 | { | ||
233 | QMessageBox::warning( this, "Wellenreiter/Opie", "Sniffing in progress!\nPlease stop sniffing before closing." ); | ||
234 | e->ignore(); | ||
235 | } | ||
236 | else | ||
237 | { | ||
238 | QMainWindow::closeEvent( e ); | ||
239 | } | ||
240 | } | ||
diff --git a/noncore/net/wellenreiter/gui/mainwindow.h b/noncore/net/wellenreiter/gui/mainwindow.h index 03aa08a..8bfccf3 100644 --- a/noncore/net/wellenreiter/gui/mainwindow.h +++ b/noncore/net/wellenreiter/gui/mainwindow.h | |||
@@ -40,13 +40,17 @@ class WellenreiterMainWindow: public QMainWindow | |||
40 | const QIconSet* infoIconSet; | 40 | const QIconSet* infoIconSet; |
41 | const QIconSet* settingsIconSet; | 41 | const QIconSet* settingsIconSet; |
42 | const QIconSet* cancelIconSet; | 42 | const QIconSet* cancelIconSet; |
43 | 43 | ||
44 | QToolButton* startStopButton; | 44 | QToolButton* startStopButton; |
45 | 45 | ||
46 | protected: | ||
47 | virtual void closeEvent( QCloseEvent* ); | ||
48 | |||
46 | public slots: | 49 | public slots: |
47 | void showConfigure(); | 50 | void showConfigure(); |
48 | void demoAddStations(); | 51 | void demoAddStations(); |
49 | void fileSaveLog(); | 52 | void fileSaveLog(); |
53 | void fileSaveSession(); | ||
50 | }; | 54 | }; |
51 | 55 | ||
52 | #endif | 56 | #endif |
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp index 6d3469c..cdc2c48 100644 --- a/noncore/net/wellenreiter/gui/scanlist.cpp +++ b/noncore/net/wellenreiter/gui/scanlist.cpp | |||
@@ -17,12 +17,14 @@ | |||
17 | #include "scanlistitem.h" | 17 | #include "scanlistitem.h" |
18 | 18 | ||
19 | #include <assert.h> | 19 | #include <assert.h> |
20 | 20 | ||
21 | #include "manufacturers.h" | 21 | #include "manufacturers.h" |
22 | 22 | ||
23 | #include <qtextstream.h> | ||
24 | |||
23 | MScanListView::MScanListView( QWidget* parent, const char* name ) | 25 | MScanListView::MScanListView( QWidget* parent, const char* name ) |
24 | :OListView( parent, name ), _manufacturerdb( 0 ) | 26 | :OListView( parent, name ), _manufacturerdb( 0 ) |
25 | { | 27 | { |
26 | 28 | ||
27 | setFrameShape( QListView::StyledPanel ); | 29 | setFrameShape( QListView::StyledPanel ); |
28 | setFrameShadow( QListView::Sunken ); | 30 | setFrameShadow( QListView::Sunken ); |
@@ -148,6 +150,18 @@ void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bo | |||
148 | { | 150 | { |
149 | s.sprintf( "(i) new adhoc station in '%s' [%d]", (const char*) essid, channel ); | 151 | s.sprintf( "(i) new adhoc station in '%s' [%d]", (const char*) essid, channel ); |
150 | } | 152 | } |
151 | 153 | ||
152 | } | 154 | } |
153 | 155 | ||
156 | void MScanListView::dump( QTextStream& t ) const | ||
157 | { | ||
158 | qDebug( "dumping scanlist..." ); | ||
159 | |||
160 | QListViewItemIterator it( const_cast<MScanListView*>( this ) ); | ||
161 | for ( ; it.current(); ++it ) | ||
162 | { | ||
163 | static_cast<MScanListItem*>( it.current() )->dump( t ); | ||
164 | } | ||
165 | |||
166 | qDebug( "dump finished." ); | ||
167 | } | ||
diff --git a/noncore/net/wellenreiter/gui/scanlist.h b/noncore/net/wellenreiter/gui/scanlist.h index 475f7b6..f06f251 100644 --- a/noncore/net/wellenreiter/gui/scanlist.h +++ b/noncore/net/wellenreiter/gui/scanlist.h | |||
@@ -15,25 +15,27 @@ | |||
15 | 15 | ||
16 | #ifndef SCANLIST_H | 16 | #ifndef SCANLIST_H |
17 | #define SCANLIST_H | 17 | #define SCANLIST_H |
18 | 18 | ||
19 | #include <cornucopia/olistview.h> | 19 | #include <cornucopia/olistview.h> |
20 | 20 | ||
21 | class QString; | 21 | #include <qtextstream.h> |
22 | 22 | ||
23 | class QString; | ||
23 | class ManufacturerDB; | 24 | class ManufacturerDB; |
24 | 25 | ||
25 | class MScanListView: public OListView | 26 | class MScanListView: public OListView |
26 | { | 27 | { |
27 | Q_OBJECT | 28 | Q_OBJECT |
28 | 29 | ||
29 | public: | 30 | public: |
30 | MScanListView( QWidget* parent = 0, const char* name = 0 ); | 31 | MScanListView( QWidget* parent = 0, const char* name = 0 ); |
31 | virtual ~MScanListView(); | 32 | virtual ~MScanListView(); |
32 | 33 | ||
33 | void setManufacturerDB( ManufacturerDB* manufacturerdb ); | 34 | void setManufacturerDB( ManufacturerDB* manufacturerdb ); |
35 | void dump( QTextStream& t ) const; | ||
34 | 36 | ||
35 | public slots: | 37 | public slots: |
36 | void addNewItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ); | 38 | void addNewItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ); |
37 | 39 | ||
38 | private: | 40 | private: |
39 | ManufacturerDB* _manufacturerdb; | 41 | ManufacturerDB* _manufacturerdb; |
diff --git a/noncore/net/wellenreiter/gui/scanlistitem.cpp b/noncore/net/wellenreiter/gui/scanlistitem.cpp index bfa7aa9..4aecd2b 100644 --- a/noncore/net/wellenreiter/gui/scanlistitem.cpp +++ b/noncore/net/wellenreiter/gui/scanlistitem.cpp | |||
@@ -80,13 +80,18 @@ void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, | |||
80 | setText( col_firstseen, QTime::currentTime().toString() ); | 80 | setText( col_firstseen, QTime::currentTime().toString() ); |
81 | //setText( col_lastseen, QTime::currentTime().toString() ); | 81 | //setText( col_lastseen, QTime::currentTime().toString() ); |
82 | 82 | ||
83 | listView()->triggerUpdate(); | 83 | listView()->triggerUpdate(); |
84 | 84 | ||
85 | this->type = type; | 85 | this->type = type; |
86 | 86 | _type = type; | |
87 | _essid = essid; | ||
88 | _macaddr = macaddr; | ||
89 | _channel = channel; | ||
90 | _beacons = 0; | ||
91 | _signal = 0; | ||
87 | } | 92 | } |
88 | 93 | ||
89 | void MScanListItem::setManufacturer( const QString& manufacturer ) | 94 | void MScanListItem::setManufacturer( const QString& manufacturer ) |
90 | { | 95 | { |
91 | setText( col_manuf, manufacturer ); | 96 | setText( col_manuf, manufacturer ); |
92 | } | 97 | } |
@@ -97,6 +102,20 @@ void MScanListItem::receivedBeacon() | |||
97 | #ifdef DEBUG | 102 | #ifdef DEBUG |
98 | qDebug( "MScanListItem %s: received beacon #%d", (const char*) _macaddr, _beacons ); | 103 | qDebug( "MScanListItem %s: received beacon #%d", (const char*) _macaddr, _beacons ); |
99 | #endif | 104 | #endif |
100 | setText( col_sig, QString::number( _beacons ) ); | 105 | setText( col_sig, QString::number( _beacons ) ); |
101 | setText( col_lastseen, QTime::currentTime().toString() ); | 106 | setText( col_lastseen, QTime::currentTime().toString() ); |
102 | } | 107 | } |
108 | |||
109 | void MScanListItem::dump( QTextStream& t ) const | ||
110 | { | ||
111 | qDebug( "dumping scanlistitem at <%d>", this ); | ||
112 | t << "<ITEM type=" << _type; | ||
113 | t << " ESSID='" << _essid; | ||
114 | t << "' MAC=" << _macaddr; | ||
115 | t << " WEP=" << _wep; | ||
116 | t << " CHANNEL=" << _channel; | ||
117 | t << " SIGNAL=" << _signal; | ||
118 | t << " BEACONS=" << _beacons; | ||
119 | t << ">\n"; | ||
120 | } | ||
121 | |||
diff --git a/noncore/net/wellenreiter/gui/scanlistitem.h b/noncore/net/wellenreiter/gui/scanlistitem.h index 89b3bc4..5f6ae40 100644 --- a/noncore/net/wellenreiter/gui/scanlistitem.h +++ b/noncore/net/wellenreiter/gui/scanlistitem.h | |||
@@ -15,12 +15,14 @@ | |||
15 | 15 | ||
16 | #ifndef SCANLISTITEM_H | 16 | #ifndef SCANLISTITEM_H |
17 | #define SCANLISTITEM_H | 17 | #define SCANLISTITEM_H |
18 | 18 | ||
19 | #include <cornucopia/olistview.h> | 19 | #include <cornucopia/olistview.h> |
20 | 20 | ||
21 | #include <qtextstream.h> | ||
22 | |||
21 | class QString; | 23 | class QString; |
22 | 24 | ||
23 | class MScanListItem: public OListViewItem | 25 | class MScanListItem: public OListViewItem |
24 | { | 26 | { |
25 | public: | 27 | public: |
26 | 28 | ||
@@ -61,12 +63,14 @@ class MScanListItem: public OListViewItem | |||
61 | 63 | ||
62 | void setSignal( int signal ) { /* TODO */ }; | 64 | void setSignal( int signal ) { /* TODO */ }; |
63 | void receivedBeacon(); | 65 | void receivedBeacon(); |
64 | 66 | ||
65 | void setManufacturer( const QString& manufacturer ); | 67 | void setManufacturer( const QString& manufacturer ); |
66 | 68 | ||
69 | void dump( QTextStream& t ) const; | ||
70 | |||
67 | private: | 71 | private: |
68 | QString _type; | 72 | QString _type; |
69 | QString _essid; | 73 | QString _essid; |
70 | QString _macaddr; | 74 | QString _macaddr; |
71 | bool _wep; | 75 | bool _wep; |
72 | int _channel; | 76 | int _channel; |
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index c599bb4..1ccf971 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -120,12 +120,17 @@ Wellenreiter::Wellenreiter( QWidget* parent ) | |||
120 | 120 | ||
121 | Wellenreiter::~Wellenreiter() | 121 | Wellenreiter::~Wellenreiter() |
122 | { | 122 | { |
123 | // no need to delete child widgets, Qt does it all for us | 123 | // no need to delete child widgets, Qt does it all for us |
124 | 124 | ||
125 | delete manufacturerdb; | 125 | delete manufacturerdb; |
126 | if ( daemon_fd != -1 ) | ||
127 | { | ||
128 | qDebug( "closing comm socket" ); | ||
129 | close( daemon_fd ); | ||
130 | } | ||
126 | } | 131 | } |
127 | 132 | ||
128 | void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) | 133 | void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) |
129 | { | 134 | { |
130 | configwindow = cw; | 135 | configwindow = cw; |
131 | } | 136 | } |
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h index ff523d4..ee9dca9 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.h +++ b/noncore/net/wellenreiter/gui/wellenreiter.h | |||
@@ -50,12 +50,13 @@ class Wellenreiter : public WellenreiterBase { | |||
50 | Wellenreiter( QWidget* parent = 0 ); | 50 | Wellenreiter( QWidget* parent = 0 ); |
51 | ~Wellenreiter(); | 51 | ~Wellenreiter(); |
52 | 52 | ||
53 | void setConfigWindow( WellenreiterConfigWindow* cw ); | 53 | void setConfigWindow( WellenreiterConfigWindow* cw ); |
54 | MScanListView* netView() const { return netview; }; | 54 | MScanListView* netView() const { return netview; }; |
55 | MLogWindow* logWindow() const { return logwindow; }; | 55 | MLogWindow* logWindow() const { return logwindow; }; |
56 | bool isDaemonRunning() const { return daemonRunning; }; | ||
56 | 57 | ||
57 | protected: | 58 | protected: |
58 | bool daemonRunning; | 59 | bool daemonRunning; |
59 | 60 | ||
60 | public slots: | 61 | public slots: |
61 | void dataReceived(); | 62 | void dataReceived(); |