summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/cornucopia/olistview.cpp8
-rw-r--r--noncore/net/wellenreiter/gui/mainwindow.cpp60
-rw-r--r--noncore/net/wellenreiter/gui/mainwindow.h4
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp32
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.h10
-rw-r--r--noncore/net/wellenreiter/gui/scanlistitem.cpp21
-rw-r--r--noncore/net/wellenreiter/gui/scanlistitem.h4
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp5
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.h1
9 files changed, 118 insertions, 27 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
@@ -204,6 +204,6 @@ bool OListViewItem::isAlternate()
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
@@ -223,3 +223,3 @@ bool OListViewItem::isAlternate()
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 }
@@ -235,3 +235,3 @@ bool OListViewItem::isAlternate()
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 }
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
@@ -26,2 +26,3 @@
26#include <qmenubar.h> 26#include <qmenubar.h>
27#include <qmessagebox.h>
27#include <qpopupmenu.h> 28#include <qpopupmenu.h>
@@ -61,3 +62,5 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n
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
@@ -73,3 +76,5 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n
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 );
@@ -78,3 +83,5 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n
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 );
@@ -89,6 +96,11 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n
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 );
@@ -174,7 +186,7 @@ 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}
@@ -190,3 +202,21 @@ void WellenreiterMainWindow::fileSaveLog()
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 );
204 }
205 else
206 {
207 qDebug( "Problem saving log to file '%s'", (const char*) fname );
208 }
209
210}
211
212void 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 );
192 } 222 }
@@ -194,5 +224,17 @@ void WellenreiterMainWindow::fileSaveLog()
194 { 224 {
195 qDebug( "Problem saving log in file '%s'", (const char*) fname ); 225 qDebug( "Problem saving session to file '%s'", (const char*) fname );
196 } 226 }
227}
197 228
198} \ No newline at end of file 229void 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
@@ -45,2 +45,5 @@ class WellenreiterMainWindow: public QMainWindow
45 45
46 protected:
47 virtual void closeEvent( QCloseEvent* );
48
46 public slots: 49 public slots:
@@ -49,2 +52,3 @@ class WellenreiterMainWindow: public QMainWindow
49 void fileSaveLog(); 52 void fileSaveLog();
53 void fileSaveSession();
50}; 54};
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
@@ -22,2 +22,4 @@
22 22
23#include <qtextstream.h>
24
23MScanListView::MScanListView( QWidget* parent, const char* name ) 25MScanListView::MScanListView( QWidget* parent, const char* name )
@@ -28,3 +30,3 @@ MScanListView::MScanListView( QWidget* parent, const char* name )
28 setFrameShadow( QListView::Sunken ); 30 setFrameShadow( QListView::Sunken );
29 31
30 addColumn( tr( "Net/Station" ) ); 32 addColumn( tr( "Net/Station" ) );
@@ -127,13 +129,13 @@ void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bo
127 s.sprintf( "(i) new network: '%s'", (const char*) essid ); 129 s.sprintf( "(i) new network: '%s'", (const char*) essid );
128 130
129 network = new MScanListItem( this, "networks", essid, QString::null, 0, 0, 0 ); 131 network = new MScanListItem( this, "networks", essid, QString::null, 0, 0, 0 );
130 } 132 }
131 133
132 134
133 // insert new station as child from network 135 // insert new station as child from network
134 136
135 // no essid to reduce clutter, maybe later we have a nick or stationname to display!? 137 // no essid to reduce clutter, maybe later we have a nick or stationname to display!?
136 138
137 qDebug( "inserting new station %s", (const char*) macaddr ); 139 qDebug( "inserting new station %s", (const char*) macaddr );
138 140
139 MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal ); 141 MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal );
@@ -150,4 +152,16 @@ void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bo
150 } 152 }
151 153
152} 154}
153 155
156void 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
@@ -20,4 +20,5 @@
20 20
21class QString; 21#include <qtextstream.h>
22 22
23class QString;
23class ManufacturerDB; 24class ManufacturerDB;
@@ -27,3 +28,3 @@ class MScanListView: public OListView
27 Q_OBJECT 28 Q_OBJECT
28 29
29 public: 30 public:
@@ -31,5 +32,6 @@ class MScanListView: public OListView
31 virtual ~MScanListView(); 32 virtual ~MScanListView();
32 33
33 void setManufacturerDB( ManufacturerDB* manufacturerdb ); 34 void setManufacturerDB( ManufacturerDB* manufacturerdb );
34 35 void dump( QTextStream& t ) const;
36
35 public slots: 37 public slots:
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
@@ -85,3 +85,8 @@ void MScanListItem::decorateItem( QString type, QString essid, QString macaddr,
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}
@@ -102 +107,15 @@ void MScanListItem::receivedBeacon()
102} 107}
108
109void 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
@@ -20,2 +20,4 @@
20 20
21#include <qtextstream.h>
22
21class QString; 23class QString;
@@ -66,2 +68,4 @@ class MScanListItem: public OListViewItem
66 68
69 void dump( QTextStream& t ) const;
70
67 private: 71 private:
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
@@ -125,2 +125,7 @@ Wellenreiter::~Wellenreiter()
125 delete manufacturerdb; 125 delete manufacturerdb;
126 if ( daemon_fd != -1 )
127 {
128 qDebug( "closing comm socket" );
129 close( daemon_fd );
130 }
126} 131}
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
@@ -55,2 +55,3 @@ class Wellenreiter : public WellenreiterBase {
55 MLogWindow* logWindow() const { return logwindow; }; 55 MLogWindow* logWindow() const { return logwindow; };
56 bool isDaemonRunning() const { return daemonRunning; };
56 57