author | mickeyl <mickeyl> | 2005-04-18 21:51:57 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-04-18 21:51:57 (UTC) |
commit | 0421a65ca6c21715b7268ef52679bdc14ab25c89 (patch) (side-by-side diff) | |
tree | 243a5a4d9c390a349ebe5bd8ad69ac987c9a75a8 | |
parent | 9e685cedc4425dd5ae60170e3f59a899c9e2bf36 (diff) | |
download | opie-0421a65ca6c21715b7268ef52679bdc14ab25c89.zip opie-0421a65ca6c21715b7268ef52679bdc14ab25c89.tar.gz opie-0421a65ca6c21715b7268ef52679bdc14ab25c89.tar.bz2 |
relax WE matching test
set VERSION in .pro
define WELLENREITER_VERSION through .pro
-rw-r--r-- | noncore/net/wellenreiter/gui/gui.pro | 3 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 3 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiterbase.cpp | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/noncore/net/wellenreiter/gui/gui.pro b/noncore/net/wellenreiter/gui/gui.pro index 4ebac84..faedd1b 100644 --- a/noncore/net/wellenreiter/gui/gui.pro +++ b/noncore/net/wellenreiter/gui/gui.pro @@ -1,55 +1,58 @@ DESTDIR = $(OPIEDIR)/bin TEMPLATE = app CONFIG = qt warn_on HEADERS = wellenreiterbase.h \ mainwindow.h \ wellenreiter.h \ scanlist.h \ logwindow.h \ hexwindow.h \ statwindow.h \ configwindow.h \ graphwindow.h \ packetview.h \ protolistview.h \ gps.h SOURCES = main.cpp \ mainwindow.cpp \ wellenreiterbase.cpp \ wellenreiter.cpp \ scanlist.cpp \ logwindow.cpp \ hexwindow.cpp \ statwindow.cpp \ configwindow.cpp \ graphwindow.cpp \ packetview.cpp \ protolistview.cpp \ gps.cpp INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include INTERFACES = configbase.ui TARGET = wellenreiter +VERSION = 1.0.5 + +DEFINES += WELLENREITER_VERSION='"$$VERSION (GPL) Opie"' !contains( platform, x11 ) { message( qws ) include( $(OPIEDIR)/include.pro ) LIBS += -lqpe -lopiecore2 -lopieui2 -lopienet2 } contains( platform, x11 ) { LIBS += -L$(OPIEDIR)/output/lib -Wl,-rpath,$(OPIEDIR)/output/lib -Wl,-rpath,/usr/local/lib -lwellenreiter SOURCES += resource.cpp HEADERS += resource.h DESTDIR = $(OPIEDIR)/output/bin } !isEmpty( LIBPCAP_INC_DIR ) { INCLUDEPATH = $$LIBPCAP_INC_DIR $$INCLUDEPATH } !isEmpty( LIBPCAP_LIB_DIR ) { LIBS = -L$$LIBPCAP_LIB_DIR $$LIBS } diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 9fe463a..8cabf0d 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -508,129 +508,130 @@ void Wellenreiter::stopClicked() // message the user QMessageBox::information( this, "Wellenreiter II", tr( "Your wireless card\nshould now be usable again." ) ); sniffing = false; emit( stoppedSniffing() ); #ifdef QWS if ( WellenreiterConfigWindow::instance()->disablePM->isChecked() ) { QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; } #else #warning FIXME: setScreenSaverMode is not operational on the X11 build #endif updateStatistics(); } void Wellenreiter::startClicked() { // get configuration from config window const QString& interface = configwindow->interfaceName->currentText(); const int cardtype = configwindow->driverType(); // const int interval = configwindow->hoppingInterval(); if ( ( interface == "" ) || ( cardtype == 0 ) ) { QMessageBox::information( this, "Wellenreiter II", tr( "No device configured.\nPlease reconfigure!" ) ); return; } // configure device ONetwork* net = ONetwork::instance(); // TODO: check if interface is wireless and support sniffing for non-wireless interfaces if ( cardtype != DEVTYPE_FILE ) { if ( !net->isPresent( interface ) ) { QMessageBox::information( this, "Wellenreiter II", tr( "The configured device (%1)\nis not available on this system\n. Please reconfigure!" ).arg( interface ) ); return; } iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface )); // fails if network is not wireless! assert( iface ); // bring device UP iface->setUp( true ); if ( !iface->isUp() ) { QMessageBox::warning( this, "Wellenreiter II", tr( "Can't bring interface '%1' up:\n" ).arg( iface->name() ) + strerror( errno ) ); return; } // check if wireless extension version matches - if ( ONetwork::wirelessExtensionCompileVersion() != iface->wirelessExtensionDriverVersion() ) + if ( ONetwork::wirelessExtensionCompileVersion() != iface->wirelessExtensionDriverVersion() + && ( ONetwork::wirelessExtensionCompileVersion() <= 15 || iface->wirelessExtensionDriverVersion() <= 15 ) ) { QMessageBox::critical( this, "Wellenreiter II", tr( "<p>The Wireless Extension Versions<br>do not match!<p>" " Wellenreiter II : WE V%1<br>Interface driver: WE V%2" ) .arg( QString::number( ONetwork::wirelessExtensionCompileVersion() ) ) .arg( QString::number( iface->wirelessExtensionDriverVersion() ) ) ); return; } } // set monitor mode bool usePrism = configwindow->usePrismHeader(); switch ( cardtype ) { case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface, usePrism ) ); break; case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface, usePrism ) ); break; case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface, usePrism ) ); break; case DEVTYPE_ORINOCO: iface->setMonitoring( new OOrinocoMonitoringInterface( iface, usePrism ) ); break; case DEVTYPE_MANUAL: QMessageBox::information( this, "Wellenreiter II", tr( "Bring your device into\nmonitor mode now." ) ); break; case DEVTYPE_FILE: odebug << "Wellenreiter: Capturing from file '" << interface << "'" << oendl; break; default: assert( 0 ); // shouldn't reach this } // switch device into monitor mode if ( cardtype < DEVTYPE_FILE ) { if ( cardtype != DEVTYPE_MANUAL ) iface->setMode( "monitor" ); if ( iface->mode() != "monitor" ) { if ( QMessageBox::warning( this, "Wellenreiter II", tr( "Can't set interface '%1'\ninto monitor mode:\n" ).arg( iface->name() ) + strerror( errno ) + tr( "\nContinue with limited functionality?" ), QMessageBox::Yes, QMessageBox::No ) == QMessageBox::No ) return; } } // open GPS device if ( configwindow->enableGPS->isChecked() ) { odebug << "Wellenreiter:GPS enabled @ " << configwindow->gpsdHost->currentText() << ":" << configwindow->gpsdPort->value() << "" << oendl; gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() ); } // open pcap and start sniffing if ( configwindow->writeCaptureFile->isChecked() ) // write to a user specified capture file? { dumpname = configwindow->captureFileName->text(); if ( dumpname.isEmpty() ) dumpname = "captureFile"; dumpname.append( '-' ); dumpname.append( QTime::currentTime().toString().replace( QRegExp( ":" ), "-" ) ); dumpname.append( ".wellenreiter" ); } if ( cardtype != DEVTYPE_FILE ) pcap->open( interface ); else pcap->openCaptureFile( interface ); if ( configwindow->writeCaptureFile->isChecked() ) { odebug << "Wellenreiter:: dumping to " << dumpname << oendl; pcap->openDumpFile( dumpname ); } diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp index 0ca0bd7..1d5bd1b 100644 --- a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp @@ -1,178 +1,176 @@ /********************************************************************** ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. ** ** This file is part of Wellenreiter II. ** ** 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 "wellenreiterbase.h" #include <qlabel.h> #include <qlayout.h> #include "logwindow.h" #include "packetview.h" #include "scanlist.h" #include "statwindow.h" #include "graphwindow.h" #ifdef QWS #include <qpe/resource.h> #include <opie2/otabwidget.h> using namespace Opie; #else #include "resource.h" #include <qtabwidget.h> #endif -#define WELLENREITER_VERSION "V1.0.3 (unofficial)" - /* * Constructs a WellenreiterBase which is a child of 'parent', with the * name 'name' and widget flags set to 'f' */ using namespace Opie::Ui; using namespace Opie::Ui; using namespace Opie::Ui; WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ) { //ani1 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot0" ) ); //ani2 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot90" ) ); //ani3 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot180" ) ); //ani4 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot270" ) ); if ( !name ) setName( "WellenreiterBase" ); resize( 191, 294 ); #ifdef QWS setCaption( tr( "Wellenreiter/Opie" ) ); #else setCaption( tr( "Wellenreiter/X11" ) ); #endif WellenreiterBaseLayout = new QVBoxLayout( this ); WellenreiterBaseLayout->setSpacing( 2 ); WellenreiterBaseLayout->setMargin( 0 ); #ifdef QWS TabWidget = new OTabWidget( this, "TabWidget", OTabWidget::Global ); #else TabWidget = new QTabWidget( this, "TabWidget" ); #endif ap = new QWidget( TabWidget, "ap" ); apLayout = new QVBoxLayout( ap ); apLayout->setSpacing( 2 ); apLayout->setMargin( 2 ); //--------- NETVIEW TAB -------------- netview = new MScanListView( ap ); apLayout->addWidget( netview ); //--------- GRAPH TAB -------------- graphwindow = new MGraphWindow( TabWidget, "Graph" ); //--------- LOG TAB -------------- logwindow = new MLogWindow( TabWidget, "Log" ); //--------- HEX TAB -------------- hexwindow = new PacketView( TabWidget, "Hex" ); //--------- STAT TAB -------------- statwindow = new MStatWindow( TabWidget, "Stat" ); //--------- ABOUT TAB -------------- about = new QWidget( TabWidget, "about" ); aboutLayout = new QGridLayout( about ); aboutLayout->setSpacing( 6 ); aboutLayout->setMargin( 11 ); PixmapLabel1_3_2 = new QLabel( about, "PixmapLabel1_3_2" ); PixmapLabel1_3_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, PixmapLabel1_3_2->sizePolicy().hasHeightForWidth() ) ); PixmapLabel1_3_2->setFrameShape( QLabel::Panel ); PixmapLabel1_3_2->setFrameShadow( QLabel::Sunken ); PixmapLabel1_3_2->setLineWidth( 2 ); PixmapLabel1_3_2->setMargin( 0 ); PixmapLabel1_3_2->setMidLineWidth( 0 ); QPixmap logo = Resource::loadPixmap( "wellenreiter/logo" ); QPainter draw( &logo ); draw.setPen( Qt::black ); draw.setFont( QFont( "Fixed", 8 ) ); - draw.drawText( 30, 10, WELLENREITER_VERSION ); + draw.drawText( 5, 10, WELLENREITER_VERSION ); PixmapLabel1_3_2->setPixmap( logo ); PixmapLabel1_3_2->setScaledContents( TRUE ); PixmapLabel1_3_2->setAlignment( int( QLabel::AlignCenter ) ); aboutLayout->addWidget( PixmapLabel1_3_2, 0, 0 ); TextLabel1_4_2 = new QLabel( about, "TextLabel1_4_2" ); QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); TextLabel1_4_2_font.setPointSize( 10 ); TextLabel1_4_2->setFont( TextLabel1_4_2_font ); TextLabel1_4_2->setText( "<p align=center>" "<hr>" "<b>(C) Michael 'Mickey' Lauer</b><br>" "<hr>" "mickey@Vanille.de<br>" "www.Vanille.de/projects/wellenreiter.html<br>" "www.wellenreiter.net" "</p>" ); TextLabel1_4_2->setAlignment( int( QLabel::AlignCenter ) ); aboutLayout->addWidget( TextLabel1_4_2, 1, 0 ); #ifdef QWS TabWidget->addTab( ap, "wellenreiter/networks", tr( "Nets" ) ); TabWidget->addTab( graphwindow, "wellenreiter/graph", tr( "Graph" ) ); TabWidget->addTab( logwindow, "wellenreiter/log", tr( "Log" ) ); TabWidget->addTab( hexwindow, "wellenreiter/hex", tr( "Hex" ) ); TabWidget->addTab( statwindow, "wellenreiter/stat", tr( "Stat" ) ); TabWidget->addTab( about, "wellenreiter/about", tr( "About" ) ); #else TabWidget->addTab( ap, /* "wellenreiter/networks", */ tr( "Networks" ) ); TabWidget->addTab( graphwindow, /* "wellenreiter/graph", */ tr( "Graph" ) ); TabWidget->addTab( logwindow, /* "wellenreiter/log", */ tr( "Log" ) ); TabWidget->addTab( hexwindow, /* "wellenreiter/hex", */ tr( "Hex" ) ); TabWidget->addTab( statwindow, /* "wellenreiter/hex", */ tr( "Stat" ) ); TabWidget->addTab( about, /* "wellenreiter/about", */ tr( "About" ) ); #endif WellenreiterBaseLayout->addWidget( TabWidget ); #ifdef QWS TabWidget->setCurrentTab( tr( "Nets" ) ); #endif connect(TabWidget, SIGNAL(currentChanged(QWidget*)), this, SLOT(slotTabChanged(QWidget*))); } /* * Destroys the object and frees any allocated resources */ WellenreiterBase::~WellenreiterBase() { // no need to delete child widgets, Qt does it all for us } /* * Main event handler. Reimplemented to handle application * font changes */ bool WellenreiterBase::event( QEvent* ev ) { |