-rw-r--r-- | noncore/net/wellenreiter/gui/gui.pro | 2 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/hexwindow.cpp | 4 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/hexwindow.h | 1 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/logwindow.cpp | 5 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/logwindow.h | 1 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.cpp | 10 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.h | 1 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.h | 4 |
8 files changed, 26 insertions, 2 deletions
diff --git a/noncore/net/wellenreiter/gui/gui.pro b/noncore/net/wellenreiter/gui/gui.pro index 200bfc1..505d376 100644 --- a/noncore/net/wellenreiter/gui/gui.pro +++ b/noncore/net/wellenreiter/gui/gui.pro @@ -12,32 +12,32 @@ HEADERS = wellenreiterbase.h \ hexwindow.h \ configwindow.h \ manufacturers.h SOURCES = main.cpp \ mainwindow.cpp \ wellenreiterbase.cpp \ wellenreiter.cpp \ scanlist.cpp \ logwindow.cpp \ hexwindow.cpp \ configwindow.cpp \ manufacturers.cpp INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -L. -lwellenreiter -lopiecore2 -lopieui2 -lopienet2 +LIBS += -lopiecore2 -lopieui2 -lopienet2 INTERFACES = configbase.ui TARGET = wellenreiter !contains( platform, x11 ) { message( qws ) include ( $(OPIEDIR)/include.pro ) LIBS += -lqpe -lopie } contains( platform, x11 ) { LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib SOURCES += resource.cpp HEADERS += resource.h } diff --git a/noncore/net/wellenreiter/gui/hexwindow.cpp b/noncore/net/wellenreiter/gui/hexwindow.cpp index 91aa6f7..a3022f4 100644 --- a/noncore/net/wellenreiter/gui/hexwindow.cpp +++ b/noncore/net/wellenreiter/gui/hexwindow.cpp @@ -19,17 +19,21 @@ MHexWindow::MHexWindow( QWidget * parent, const char * name, WFlags f ) :QVBox( parent, name, f ) { ledit = new QMultiLineEdit( this ); // FIXME: Set properties( font, read-only, etc...) }; void MHexWindow::log( QString text ) { ledit->append( text ); }; +void MHexWindow::clear() +{ + ledit->clear(); +} diff --git a/noncore/net/wellenreiter/gui/hexwindow.h b/noncore/net/wellenreiter/gui/hexwindow.h index eec1be0..2618b8c 100644 --- a/noncore/net/wellenreiter/gui/hexwindow.h +++ b/noncore/net/wellenreiter/gui/hexwindow.h @@ -15,24 +15,25 @@ #ifndef HEXWINDOW_H #define HEXWINDOW_H #include <qvbox.h> class QString; class QMultiLineEdit; class MHexWindow: public QVBox { public: MHexWindow( QWidget * parent = 0, const char * name = "MHexWindow", WFlags f = 0 ); void log( QString text ); + void clear(); protected: QMultiLineEdit* ledit; }; #endif diff --git a/noncore/net/wellenreiter/gui/logwindow.cpp b/noncore/net/wellenreiter/gui/logwindow.cpp index f132f56..55e2ccb 100644 --- a/noncore/net/wellenreiter/gui/logwindow.cpp +++ b/noncore/net/wellenreiter/gui/logwindow.cpp @@ -23,20 +23,25 @@ MLogWindow::MLogWindow( QWidget * parent, const char * name, WFlags f ) ledit = new QMultiLineEdit( this ); // FIXME: Set properties( font, read-only, etc...) } void MLogWindow::log( QString text ) { QTime time = QTime::currentTime(); QString line; line.sprintf( "[%s] %s", (const char*) time.toString(), (const char*) text ); ledit->append( line ); qDebug( line ); } +void MLogWindow::clear() +{ + ledit->clear(); +} + 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 253defa..6e0fe50 100644 --- a/noncore/net/wellenreiter/gui/logwindow.h +++ b/noncore/net/wellenreiter/gui/logwindow.h @@ -16,24 +16,25 @@ #ifndef LOGWINDOW_H #define LOGWINDOW_H #include <qvbox.h> class QString; class QMultiLineEdit; class MLogWindow: public QVBox { public: MLogWindow( QWidget * parent = 0, const char * name = "MLogWindow", WFlags f = 0 ); void log( QString text ); const QString getLog() const; + void clear(); protected: QMultiLineEdit* ledit; }; #endif diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp index d4988af..8e0164f 100644 --- a/noncore/net/wellenreiter/gui/mainwindow.cpp +++ b/noncore/net/wellenreiter/gui/mainwindow.cpp @@ -2,35 +2,35 @@ ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. ** ** This file is part of Opie Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** **********************************************************************/ #include "configwindow.h" #include "logwindow.h" +#include "hexwindow.h" #include "mainwindow.h" #include "wellenreiter.h" - #include "scanlist.h" #include <qcombobox.h> #include <qdatastream.h> #include <qfile.h> #include <qfileinfo.h> #include <qiconset.h> #include <qmenubar.h> #include <qmessagebox.h> #include <qpopupmenu.h> #include <qstatusbar.h> #include <qtextstream.h> #include <qtoolbutton.h> #ifdef QWS #include <qpe/resource.h> @@ -101,32 +101,33 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n // setup menu bar int id; QMenuBar* mb = menuBar(); QPopupMenu* fileSave = new QPopupMenu( mb ); fileSave->insertItem( "&Session...", this, SLOT( fileSaveSession() ) ); fileSave->insertItem( "&Log...", this, SLOT( fileSaveLog() ) ); QPopupMenu* fileLoad = new QPopupMenu( mb ); fileLoad->insertItem( "&Session...", this, SLOT( fileLoadSession() ) ); //fileLoad->insertItem( "&Log", this, SLOT( fileLoadLog() ) ); QPopupMenu* file = new QPopupMenu( mb ); + file->insertItem( "&New", this, SLOT( fileNew() ) ); id = file->insertItem( "&Load", fileLoad ); file->insertItem( "&Save", fileSave ); file->insertSeparator(); file->insertItem( "&Exit", qApp, SLOT( quit() ) ); QPopupMenu* view = new QPopupMenu( mb ); view->insertItem( "&Configure..." ); QPopupMenu* sniffer = new QPopupMenu( mb ); sniffer->insertItem( "&Configure..." ); sniffer->insertSeparator(); QPopupMenu* demo = new QPopupMenu( mb ); demo->insertItem( "&Add something", this, SLOT( demoAddStations() ) ); id = mb->insertItem( "&File", file ); @@ -286,28 +287,35 @@ void WellenreiterMainWindow::fileLoadSession() { QFile f( fname ); if ( f.open(IO_ReadOnly) ) { QDataStream t( &f ); t >> *mw->netView(); f.close(); qDebug( "Loaded session from file '%s'", (const char*) fname ); } else { qDebug( "Problem loading session from file '%s'", (const char*) fname ); } } } +void WellenreiterMainWindow::fileNew() +{ + mw->netView()->clear(); + mw->logWindow()->clear(); + mw->hexWindow()->clear(); +} + void WellenreiterMainWindow::closeEvent( QCloseEvent* e ) { if ( mw->isDaemonRunning() ) { QMessageBox::warning( this, "Wellenreiter/Opie", "Sniffing in progress!\nPlease stop sniffing before closing." ); e->ignore(); } else { QMainWindow::closeEvent( e ); } } diff --git a/noncore/net/wellenreiter/gui/mainwindow.h b/noncore/net/wellenreiter/gui/mainwindow.h index 850a343..e06a60c 100644 --- a/noncore/net/wellenreiter/gui/mainwindow.h +++ b/noncore/net/wellenreiter/gui/mainwindow.h @@ -42,19 +42,20 @@ class WellenreiterMainWindow: public QMainWindow const QIconSet* cancelIconSet; QToolButton* startStopButton; protected: virtual void closeEvent( QCloseEvent* ); private: QString getFileName( bool save ); public slots: void showConfigure(); void demoAddStations(); void fileSaveLog(); void fileSaveSession(); void fileLoadSession(); + void fileNew(); }; #endif diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h index 3ec4021..ff73dd4 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.h +++ b/noncore/net/wellenreiter/gui/wellenreiter.h @@ -15,45 +15,49 @@ #ifndef WELLENREITER_H #define WELLENREITER_H #include "wellenreiterbase.h" #ifdef QWS #include <opie/odevice.h> using namespace Opie; #endif class QTimerEvent; class QPixmap; class OPacket; class OPacketCapturer; class OWirelessNetworkInterface; + class ManufacturerDB; class WellenreiterConfigWindow; +class MLogWindow; +class MHexWindow; class Wellenreiter : public WellenreiterBase { Q_OBJECT public: Wellenreiter( QWidget* parent = 0 ); ~Wellenreiter(); void setConfigWindow( WellenreiterConfigWindow* cw ); MScanListView* netView() const { return netview; }; MLogWindow* logWindow() const { return logwindow; }; + MHexWindow* hexWindow() const { return hexwindow; }; bool isDaemonRunning() const { return sniffing; }; public slots: void receivePacket(OPacket*); void startStopClicked(); private: #ifdef QWS OSystem _system; // Opie Operating System identifier #endif bool sniffing; OWirelessNetworkInterface* iface; OPacketCapturer* pcap; ManufacturerDB* manufacturerdb; WellenreiterConfigWindow* configwindow; |