summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/hexwindow.cpp10
-rw-r--r--noncore/net/wellenreiter/gui/hexwindow.h1
-rw-r--r--noncore/net/wellenreiter/gui/mainwindow.cpp23
-rw-r--r--noncore/net/wellenreiter/gui/mainwindow.h1
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp4
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp5
6 files changed, 38 insertions, 6 deletions
diff --git a/noncore/net/wellenreiter/gui/hexwindow.cpp b/noncore/net/wellenreiter/gui/hexwindow.cpp
index a3022f4..8b17285 100644
--- a/noncore/net/wellenreiter/gui/hexwindow.cpp
+++ b/noncore/net/wellenreiter/gui/hexwindow.cpp
@@ -21,7 +21,8 @@ MHexWindow::MHexWindow( QWidget * parent, const char * name, WFlags f )
{
ledit = new QMultiLineEdit( this );
-
+ ledit->setFont( QFont( "fixed", 10 ) );
+
// FIXME: Set properties( font, read-only, etc...)
-
+
};
@@ -33,4 +34,9 @@ void MHexWindow::log( QString text )
};
+const QString MHexWindow::getLog() const
+{
+ return ledit->text();
+}
+
void MHexWindow::clear()
{
diff --git a/noncore/net/wellenreiter/gui/hexwindow.h b/noncore/net/wellenreiter/gui/hexwindow.h
index 2618b8c..f2f870c 100644
--- a/noncore/net/wellenreiter/gui/hexwindow.h
+++ b/noncore/net/wellenreiter/gui/hexwindow.h
@@ -29,4 +29,5 @@ class MHexWindow: public QVBox
void log( QString text );
+ const QString getLog() const;
void clear();
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp
index 8e0164f..69d2b3a 100644
--- a/noncore/net/wellenreiter/gui/mainwindow.cpp
+++ b/noncore/net/wellenreiter/gui/mainwindow.cpp
@@ -108,5 +108,6 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n
QPopupMenu* fileSave = new QPopupMenu( mb );
fileSave->insertItem( "&Session...", this, SLOT( fileSaveSession() ) );
- fileSave->insertItem( "&Log...", this, SLOT( fileSaveLog() ) );
+ fileSave->insertItem( "&Text Log...", this, SLOT( fileSaveLog() ) );
+ fileSave->insertItem( "&Hex Log...", this, SLOT( fileSaveHex() ) );
QPopupMenu* fileLoad = new QPopupMenu( mb );
@@ -281,4 +282,24 @@ void WellenreiterMainWindow::fileSaveSession()
}
+void WellenreiterMainWindow::fileSaveHex()
+{
+ QString fname = getFileName( true );
+ if ( !fname.isEmpty() )
+ {
+ QFile f( fname );
+ if ( f.open(IO_WriteOnly) )
+ {
+ QTextStream t( &f );
+ t << mw->hexWindow()->getLog();
+ f.close();
+ qDebug( "Saved hex log to file '%s'", (const char*) fname );
+ }
+ else
+ {
+ qDebug( "Problem saving hex log to file '%s'", (const char*) fname );
+ }
+ }
+}
+
void WellenreiterMainWindow::fileLoadSession()
{
diff --git a/noncore/net/wellenreiter/gui/mainwindow.h b/noncore/net/wellenreiter/gui/mainwindow.h
index e06a60c..1b08c5b 100644
--- a/noncore/net/wellenreiter/gui/mainwindow.h
+++ b/noncore/net/wellenreiter/gui/mainwindow.h
@@ -54,4 +54,5 @@ class WellenreiterMainWindow: public QMainWindow
void demoAddStations();
void fileSaveLog();
+ void fileSaveHex();
void fileSaveSession();
void fileLoadSession();
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index a006a3c..34c69f5 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -195,5 +195,5 @@ MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QS
:OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ),
_type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ),
- _channel( channel ), _signal( signal ), _beacons( 0 )
+ _channel( channel ), _signal( signal ), _beacons( 1 )
{
qDebug( "creating scanlist item" );
@@ -275,5 +275,5 @@ void MScanListItem::decorateItem( QString type, QString essid, QString macaddr,
_macaddr = macaddr;
_channel = channel;
- _beacons = 0;
+ _beacons = 1;
_signal = 0;
}
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index d80a6e6..aa33158 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -111,4 +111,6 @@ void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw )
void Wellenreiter::receivePacket(OPacket* p)
{
+ hexWindow()->log( p->dump( 8 ) );
+
// check if we received a beacon frame
// static_cast is justified here
@@ -162,4 +164,5 @@ void Wellenreiter::startStopClicked()
system( "cardctl reset; sleep 1" ); //FIXME: Use OProcess
+ logwindow->log( "(i) Stopped Scanning." );
// message the user
@@ -223,5 +226,5 @@ void Wellenreiter::startStopClicked()
connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) );
- logwindow->log( "(i) Daemon has been started." );
+ logwindow->log( "(i) Started Scanning." );
#ifdef QWS
oApp->setTitle( "Scanning ..." );