summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/wellenreiter.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/wellenreiter/gui/wellenreiter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp70
1 files changed, 41 insertions, 29 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index e801ce7..df8e9c3 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -35,5 +35,2 @@
#include <qpe/qcopenvelope_qws.h>
-using namespace Opie::Core;
-using namespace Opie::Net;
-using namespace Opie::Ui;
@@ -62,2 +59,7 @@ using namespace Opie::Ui;
+
+using namespace Opie::Core;
+using namespace Opie::Net;
+using namespace Opie::Ui;
+
Wellenreiter* Wellenreiter::instance = 0;
@@ -76,4 +78,3 @@ Wellenreiter::Wellenreiter( QWidget* parent )
#ifdef QWS
- QString sys;
- sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() );
+ QString sys = QString( "(i) Running on '%1'.").arg( ODevice::inst()->systemString() );
_system = ODevice::inst()->system();
@@ -112,2 +113,3 @@ void Wellenreiter::signalHandler( int sig )
{
+ Q_UNUSED( sig )
oerr << "Aye! Received SIGSEGV or SIGBUS! Trying to exit gracefully..." << oendl;
@@ -178,3 +180,3 @@ void Wellenreiter::handleNotification( OPacket* p )
QString action = configwindow->parsePackets->protocolAction( name );
- odebug << "parsePacket-action for '" << (const char*) name << "' seems to be '" << action << "'" << oendl;
+ odebug << "parsePacket-action for '" << name << "' seems to be '" << action << "'" << oendl;
doAction( action, name, p );
@@ -199,3 +201,3 @@ void Wellenreiter::handleManagementFrame( OPacket* p, OWaveLanManagementPacket*
-void Wellenreiter::handleManagementFrameProbeRequest( OPacket* p, OWaveLanManagementPacket* request )
+void Wellenreiter::handleManagementFrameProbeRequest( OPacket* p, OWaveLanManagementPacket* /* request */ )
{
@@ -203,4 +205,4 @@ void Wellenreiter::handleManagementFrameProbeRequest( OPacket* p, OWaveLanManage
QString essid = ssid ? ssid->ID( true /* decloak */ ) : QString("<unknown>");
- OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) );
- int channel = ds ? ds->channel() : -1;
+// OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) );
+// int channel = ds ? ds->channel() : -1;
OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) );
@@ -222,3 +224,3 @@ void Wellenreiter::handleManagementFrameProbeRequest( OPacket* p, OWaveLanManage
-void Wellenreiter::handleManagementFrameProbeResponse( OPacket* p, OWaveLanManagementPacket* response )
+void Wellenreiter::handleManagementFrameProbeResponse( OPacket* /* p */, OWaveLanManagementPacket* /* response */ )
{
@@ -227,3 +229,3 @@ void Wellenreiter::handleManagementFrameProbeResponse( OPacket* p, OWaveLanManag
-void Wellenreiter::handleManagementFrameBeacon( OPacket* p, OWaveLanManagementPacket* beacon )
+void Wellenreiter::handleManagementFrameBeacon( OPacket* p, OWaveLanManagementPacket* beacon )
{
@@ -289,3 +291,3 @@ void Wellenreiter::handleControlFrame( OPacket* p, OWaveLanControlPacket* contro
-void Wellenreiter::handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to )
+void Wellenreiter::handleWlanData( OPacket* p, OWaveLanDataPacket* /* data */ , OMacAddress& from, OMacAddress& to )
{
@@ -319,3 +321,3 @@ void Wellenreiter::handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAdd
-void Wellenreiter::handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAddress& from, OMacAddress& to )
+void Wellenreiter::handleEthernetData( OPacket* /* p */, OEthernetPacket* data, OMacAddress& from, OMacAddress& to )
{
@@ -328,3 +330,3 @@ void Wellenreiter::handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAd
-void Wellenreiter::handleARPData( OPacket* p, OARPPacket*, OMacAddress& source, OMacAddress& dest )
+void Wellenreiter::handleARPData( OPacket* p, OARPPacket*, OMacAddress& /* source */, OMacAddress& /* dest */ )
{
@@ -347,3 +349,3 @@ void Wellenreiter::handleARPData( OPacket* p, OARPPacket*, OMacAddress& source,
-void Wellenreiter::handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& source, OMacAddress& dest )
+void Wellenreiter::handleIPData( OPacket* p, OIPPacket* /* ip */, OMacAddress& source, OMacAddress& /* dest */ )
{
@@ -357,3 +359,3 @@ void Wellenreiter::handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& source,
{
- odebug << "DHCP: '" << (const char*) source.toString() << "' ('" << dhcp->serverAddress().toString() << "') seems to be a DHCP server." << oendl;
+ odebug << "DHCP: '" << source.toString() << "' ('" << dhcp->serverAddress().toString() << "') seems to be a DHCP server." << oendl;
netView()->identify( source, dhcp->serverAddress().toString() );
@@ -363,3 +365,3 @@ void Wellenreiter::handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& source,
{
- odebug << "DHCP: '" << (const char*) dhcp->clientMacAddress().toString() << "' ('" << dhcp->yourAddress().toString() << "') accepted the offered DHCP address." << oendl;
+ odebug << "DHCP: '" << dhcp->clientMacAddress().toString() << "' ('" << dhcp->yourAddress().toString() << "') accepted the offered DHCP address." << oendl;
netView()->identify( dhcp->clientMacAddress(), dhcp->yourAddress().toString() );
@@ -397,6 +399,6 @@ bool Wellenreiter::checkDumpPacket( OPacket* p )
QString action = configwindow->capturePackets->protocolAction( name );
- odebug << "capturePackets-action for '" << (const char*) name << "' seems to be '" << action << "'" << oendl;
+ odebug << "capturePackets-action for '" << name << "' seems to be '" << action << "'" << oendl;
if ( action == "Discard" )
{
- logwindow->log( QString().sprintf( "(i) dump-discarding of '%s' packet requested.", (const char*) name ) );
+ logwindow->log( QString("(i) dump-discarding of '%1' packet requested." ).arg( name ) );
return false;
@@ -522,5 +524,3 @@ void Wellenreiter::stopClicked()
- // print out statistics
- for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it )
- statwindow->updateCounter( it.key(), it.data() );
+ updateStatistics();
}
@@ -534,3 +534,3 @@ void Wellenreiter::startClicked()
const int cardtype = configwindow->driverType();
- const int interval = configwindow->hoppingInterval();
+// const int interval = configwindow->hoppingInterval();
@@ -706,3 +706,3 @@ void Wellenreiter::timerEvent( QTimerEvent* )
-void Wellenreiter::doAction( const QString& action, const QString& protocol, OPacket* p )
+void Wellenreiter::doAction( const QString& action, const QString& protocol, OPacket* /* p */ )
{
@@ -720,6 +720,6 @@ void Wellenreiter::doAction( const QString& action, const QString& protocol, OPa
else if ( action == "LogMessage" )
- logwindow->log( QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) );
+ logwindow->log( QString(tr("Got packet with protocol '%1'","Protocol Name" ) ).arg( protocol ) );
else if ( action == "MessageBox" )
QMessageBox::information( this, "Notification!",
- QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) );
+ QString(tr( "Got packet with protocol '%1'", "Protocol Name" ) ).arg( protocol ) );
#else
@@ -744,5 +744,5 @@ void Wellenreiter::joinNetwork(const QString& type, const QString& essid, int ch
- odebug << "joinNetwork() with Interface " << (const char*) iface->name()
- << ": " << (const char*) type << ", " << (const char*) essid
- << ", " << channel << ", " << (const char*) macaddr << oendl;
+ odebug << "joinNetwork() with Interface " << iface->name()
+ << ": " << type << ", " << essid
+ << ", " << channel << ", " << macaddr << oendl;
@@ -766 +766,13 @@ void Wellenreiter::joinNetwork(const QString& type, const QString& essid, int ch
+void Wellenreiter::updateStatistics()
+{
+ // print out statistics
+ for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it )
+ statwindow->updateCounter( it.key(), it.data() );
+}
+
+void Wellenreiter::slotTabChanged( QWidget* wid )
+{
+ if ( wid == statwindow )
+ updateStatistics();
+}