author | mickeyl <mickeyl> | 2003-02-23 18:48:17 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-02-23 18:48:17 (UTC) |
commit | a195865dfdb03b4c7c972acfc8cfd87743ab3e6f (patch) (side-by-side diff) | |
tree | 9be601d3d82e40ea144d12027869dd9bc39a33cd /noncore/net/wellenreiter | |
parent | 9f24ae5ae12aa1eb0f974b072d46868ba048e65d (diff) | |
download | opie-a195865dfdb03b4c7c972acfc8cfd87743ab3e6f.zip opie-a195865dfdb03b4c7c972acfc8cfd87743ab3e6f.tar.gz opie-a195865dfdb03b4c7c972acfc8cfd87743ab3e6f.tar.bz2 |
- write simple log
- record first seen / last seen per item
-rw-r--r-- | noncore/net/wellenreiter/gui/logwindow.cpp | 9 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/logwindow.h | 5 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.cpp | 32 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.h | 1 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.cpp | 4 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlistitem.cpp | 14 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.h | 1 |
7 files changed, 53 insertions, 13 deletions
diff --git a/noncore/net/wellenreiter/gui/logwindow.cpp b/noncore/net/wellenreiter/gui/logwindow.cpp index c355f09..f132f56 100644 --- a/noncore/net/wellenreiter/gui/logwindow.cpp +++ b/noncore/net/wellenreiter/gui/logwindow.cpp @@ -26,3 +26,3 @@ MLogWindow::MLogWindow( QWidget * parent, const char * name, WFlags f ) -}; +} @@ -36,4 +36,7 @@ void MLogWindow::log( QString text ) -}; - +} +const QString MLogWindow::getLog() const +{ + return ledit->text(); +} diff --git a/noncore/net/wellenreiter/gui/logwindow.h b/noncore/net/wellenreiter/gui/logwindow.h index 325f8d0..253defa 100644 --- a/noncore/net/wellenreiter/gui/logwindow.h +++ b/noncore/net/wellenreiter/gui/logwindow.h @@ -28,5 +28,6 @@ class MLogWindow: public QVBox MLogWindow( QWidget * parent = 0, const char * name = "MLogWindow", WFlags f = 0 ); - + void log( QString text ); - + const QString getLog() const; + protected: diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp index 2d5ecd2..cb003dd 100644 --- a/noncore/net/wellenreiter/gui/mainwindow.cpp +++ b/noncore/net/wellenreiter/gui/mainwindow.cpp @@ -16,2 +16,3 @@ #include "configwindow.h" +#include "logwindow.h" #include "mainwindow.h" @@ -22,2 +23,3 @@ #include <qcombobox.h> +#include <qfile.h> #include <qiconset.h> @@ -26,2 +28,3 @@ #include <qstatusbar.h> +#include <qtextstream.h> #include <qtoolbutton.h> @@ -81,7 +84,13 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n + int id; + QMenuBar* mb = menuBar(); + QPopupMenu* fileSave = new QPopupMenu( mb ); + fileSave->insertItem( "&Log", this, SLOT( fileSaveLog() ) ); + QPopupMenu* file = new QPopupMenu( mb ); - file->insertItem( "&Load..." ); - file->insertItem( "&Save..." ); + id = file->insertItem( "&Load" ); + file->setItemEnabled( id, false ); + file->insertItem( "&Save", fileSave ); @@ -97,5 +106,3 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n - int id; id = mb->insertItem( "&File", file ); - mb->setItemEnabled( id, false ); id = mb->insertItem( "&View", view ); @@ -174 +181,18 @@ void WellenreiterMainWindow::demoAddStations() +void WellenreiterMainWindow::fileSaveLog() +{ + const QString fname( "/tmp/log.txt" ); + QFile f( fname ); + if ( f.open(IO_WriteOnly) ) + { + QTextStream t( &f ); + t << mw->logWindow()->getLog(); + f.close(); + qDebug( "saved log in file '%s'", (const char*) fname ); + } + else + { + qDebug( "Problem saving log in file '%s'", (const char*) fname ); + } + +}
\ No newline at end of file diff --git a/noncore/net/wellenreiter/gui/mainwindow.h b/noncore/net/wellenreiter/gui/mainwindow.h index 22c21e8..03aa08a 100644 --- a/noncore/net/wellenreiter/gui/mainwindow.h +++ b/noncore/net/wellenreiter/gui/mainwindow.h @@ -48,2 +48,3 @@ class WellenreiterMainWindow: public QMainWindow void demoAddStations(); + void fileSaveLog(); }; diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp index ab19701..a689cca 100644 --- a/noncore/net/wellenreiter/gui/scanlist.cpp +++ b/noncore/net/wellenreiter/gui/scanlist.cpp @@ -43,2 +43,6 @@ MScanListView::MScanListView( QWidget* parent, const char* name ) setColumnAlignment( 6, AlignCenter ); + addColumn( tr( "First Seen" ) ); + setColumnAlignment( 7, AlignCenter ); + addColumn( tr( "Last Seen" ) ); + setColumnAlignment( 8, AlignCenter ); setRootIsDecorated( true ); diff --git a/noncore/net/wellenreiter/gui/scanlistitem.cpp b/noncore/net/wellenreiter/gui/scanlistitem.cpp index 15aef0c..dd33f5f 100644 --- a/noncore/net/wellenreiter/gui/scanlistitem.cpp +++ b/noncore/net/wellenreiter/gui/scanlistitem.cpp @@ -17,2 +17,3 @@ #include <assert.h> +#include <qdatetime.h> #include <qpixmap.h> @@ -33,2 +34,4 @@ const int col_traffic = 5; const int col_manuf = 6; +const int col_firstseen = 7; +const int col_lastseen = 8; @@ -67,6 +70,6 @@ void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, if ( wep ) - setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); // rename the pixmap! + setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap! // set channel and signal text - + if ( signal != -1 ) @@ -76,4 +79,7 @@ void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, + setText( col_firstseen, QTime::currentTime().toString() ); + //setText( col_lastseen, QTime::currentTime().toString() ); + listView()->triggerUpdate(); - + this->type = type; @@ -94,3 +100,3 @@ void MScanListItem::receivedBeacon() setText( col_sig, QString::number( _beacons ) ); + setText( col_lastseen, QTime::currentTime().toString() ); } - diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h index 61960d2..ff523d4 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.h +++ b/noncore/net/wellenreiter/gui/wellenreiter.h @@ -54,2 +54,3 @@ class Wellenreiter : public WellenreiterBase { MScanListView* netView() const { return netview; }; + MLogWindow* logWindow() const { return logwindow; }; |