summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/wellenreiter.cpp
Unidiff
Diffstat (limited to 'noncore/net/wellenreiter/gui/wellenreiter.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp68
1 files changed, 40 insertions, 28 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 @@
35#include <qpe/qcopenvelope_qws.h> 35#include <qpe/qcopenvelope_qws.h>
36using namespace Opie::Core;
37using namespace Opie::Net;
38using namespace Opie::Ui;
39 36
@@ -62,2 +59,7 @@ using namespace Opie::Ui;
62 59
60
61using namespace Opie::Core;
62using namespace Opie::Net;
63using namespace Opie::Ui;
64
63Wellenreiter* Wellenreiter::instance = 0; 65Wellenreiter* Wellenreiter::instance = 0;
@@ -76,4 +78,3 @@ Wellenreiter::Wellenreiter( QWidget* parent )
76 #ifdef QWS 78 #ifdef QWS
77 QString sys; 79 QString sys = QString( "(i) Running on '%1'.").arg( ODevice::inst()->systemString() );
78 sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() );
79 _system = ODevice::inst()->system(); 80 _system = ODevice::inst()->system();
@@ -112,2 +113,3 @@ void Wellenreiter::signalHandler( int sig )
112{ 113{
114 Q_UNUSED( sig )
113 oerr << "Aye! Received SIGSEGV or SIGBUS! Trying to exit gracefully..." << oendl; 115 oerr << "Aye! Received SIGSEGV or SIGBUS! Trying to exit gracefully..." << oendl;
@@ -178,3 +180,3 @@ void Wellenreiter::handleNotification( OPacket* p )
178 QString action = configwindow->parsePackets->protocolAction( name ); 180 QString action = configwindow->parsePackets->protocolAction( name );
179 odebug << "parsePacket-action for '" << (const char*) name << "' seems to be '" << action << "'" << oendl; 181 odebug << "parsePacket-action for '" << name << "' seems to be '" << action << "'" << oendl;
180 doAction( action, name, p ); 182 doAction( action, name, p );
@@ -199,3 +201,3 @@ void Wellenreiter::handleManagementFrame( OPacket* p, OWaveLanManagementPacket*
199 201
200void Wellenreiter::handleManagementFrameProbeRequest( OPacket* p, OWaveLanManagementPacket* request ) 202void Wellenreiter::handleManagementFrameProbeRequest( OPacket* p, OWaveLanManagementPacket* /* request */ )
201{ 203{
@@ -203,4 +205,4 @@ void Wellenreiter::handleManagementFrameProbeRequest( OPacket* p, OWaveLanManage
203 QString essid = ssid ? ssid->ID( true /* decloak */ ) : QString("<unknown>"); 205 QString essid = ssid ? ssid->ID( true /* decloak */ ) : QString("<unknown>");
204 OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) ); 206// OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) );
205 int channel = ds ? ds->channel() : -1; 207// int channel = ds ? ds->channel() : -1;
206 OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); 208 OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) );
@@ -222,3 +224,3 @@ void Wellenreiter::handleManagementFrameProbeRequest( OPacket* p, OWaveLanManage
222 224
223void Wellenreiter::handleManagementFrameProbeResponse( OPacket* p, OWaveLanManagementPacket* response ) 225void Wellenreiter::handleManagementFrameProbeResponse( OPacket* /* p */, OWaveLanManagementPacket* /* response */ )
224{ 226{
@@ -289,3 +291,3 @@ void Wellenreiter::handleControlFrame( OPacket* p, OWaveLanControlPacket* contro
289 291
290void Wellenreiter::handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to ) 292void Wellenreiter::handleWlanData( OPacket* p, OWaveLanDataPacket* /* data */ , OMacAddress& from, OMacAddress& to )
291{ 293{
@@ -319,3 +321,3 @@ void Wellenreiter::handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAdd
319 321
320void Wellenreiter::handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAddress& from, OMacAddress& to ) 322void Wellenreiter::handleEthernetData( OPacket* /* p */, OEthernetPacket* data, OMacAddress& from, OMacAddress& to )
321{ 323{
@@ -328,3 +330,3 @@ void Wellenreiter::handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAd
328 330
329void Wellenreiter::handleARPData( OPacket* p, OARPPacket*, OMacAddress& source, OMacAddress& dest ) 331void Wellenreiter::handleARPData( OPacket* p, OARPPacket*, OMacAddress& /* source */, OMacAddress& /* dest */ )
330{ 332{
@@ -347,3 +349,3 @@ void Wellenreiter::handleARPData( OPacket* p, OARPPacket*, OMacAddress& source,
347 349
348void Wellenreiter::handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& source, OMacAddress& dest ) 350void Wellenreiter::handleIPData( OPacket* p, OIPPacket* /* ip */, OMacAddress& source, OMacAddress& /* dest */ )
349{ 351{
@@ -357,3 +359,3 @@ void Wellenreiter::handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& source,
357 { 359 {
358 odebug << "DHCP: '" << (const char*) source.toString() << "' ('" << dhcp->serverAddress().toString() << "') seems to be a DHCP server." << oendl; 360 odebug << "DHCP: '" << source.toString() << "' ('" << dhcp->serverAddress().toString() << "') seems to be a DHCP server." << oendl;
359 netView()->identify( source, dhcp->serverAddress().toString() ); 361 netView()->identify( source, dhcp->serverAddress().toString() );
@@ -363,3 +365,3 @@ void Wellenreiter::handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& source,
363 { 365 {
364 odebug << "DHCP: '" << (const char*) dhcp->clientMacAddress().toString() << "' ('" << dhcp->yourAddress().toString() << "') accepted the offered DHCP address." << oendl; 366 odebug << "DHCP: '" << dhcp->clientMacAddress().toString() << "' ('" << dhcp->yourAddress().toString() << "') accepted the offered DHCP address." << oendl;
365 netView()->identify( dhcp->clientMacAddress(), dhcp->yourAddress().toString() ); 367 netView()->identify( dhcp->clientMacAddress(), dhcp->yourAddress().toString() );
@@ -397,6 +399,6 @@ bool Wellenreiter::checkDumpPacket( OPacket* p )
397 QString action = configwindow->capturePackets->protocolAction( name ); 399 QString action = configwindow->capturePackets->protocolAction( name );
398 odebug << "capturePackets-action for '" << (const char*) name << "' seems to be '" << action << "'" << oendl; 400 odebug << "capturePackets-action for '" << name << "' seems to be '" << action << "'" << oendl;
399 if ( action == "Discard" ) 401 if ( action == "Discard" )
400 { 402 {
401 logwindow->log( QString().sprintf( "(i) dump-discarding of '%s' packet requested.", (const char*) name ) ); 403 logwindow->log( QString("(i) dump-discarding of '%1' packet requested." ).arg( name ) );
402 return false; 404 return false;
@@ -522,5 +524,3 @@ void Wellenreiter::stopClicked()
522 524
523 // print out statistics 525 updateStatistics();
524 for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it )
525 statwindow->updateCounter( it.key(), it.data() );
526} 526}
@@ -534,3 +534,3 @@ void Wellenreiter::startClicked()
534 const int cardtype = configwindow->driverType(); 534 const int cardtype = configwindow->driverType();
535 const int interval = configwindow->hoppingInterval(); 535// const int interval = configwindow->hoppingInterval();
536 536
@@ -706,3 +706,3 @@ void Wellenreiter::timerEvent( QTimerEvent* )
706 706
707void Wellenreiter::doAction( const QString& action, const QString& protocol, OPacket* p ) 707void Wellenreiter::doAction( const QString& action, const QString& protocol, OPacket* /* p */ )
708{ 708{
@@ -720,6 +720,6 @@ void Wellenreiter::doAction( const QString& action, const QString& protocol, OPa
720 else if ( action == "LogMessage" ) 720 else if ( action == "LogMessage" )
721 logwindow->log( QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) ); 721 logwindow->log( QString(tr("Got packet with protocol '%1'","Protocol Name" ) ).arg( protocol ) );
722 else if ( action == "MessageBox" ) 722 else if ( action == "MessageBox" )
723 QMessageBox::information( this, "Notification!", 723 QMessageBox::information( this, "Notification!",
724 QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) ); 724 QString(tr( "Got packet with protocol '%1'", "Protocol Name" ) ).arg( protocol ) );
725 #else 725 #else
@@ -744,5 +744,5 @@ void Wellenreiter::joinNetwork(const QString& type, const QString& essid, int ch
744 744
745 odebug << "joinNetwork() with Interface " << (const char*) iface->name() 745 odebug << "joinNetwork() with Interface " << iface->name()
746 << ": " << (const char*) type << ", " << (const char*) essid 746 << ": " << type << ", " << essid
747 << ", " << channel << ", " << (const char*) macaddr << oendl; 747 << ", " << channel << ", " << macaddr << oendl;
748 748
@@ -766 +766,13 @@ void Wellenreiter::joinNetwork(const QString& type, const QString& essid, int ch
766 766
767void Wellenreiter::updateStatistics()
768{
769 // print out statistics
770 for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it )
771 statwindow->updateCounter( it.key(), it.data() );
772}
773
774void Wellenreiter::slotTabChanged( QWidget* wid )
775{
776 if ( wid == statwindow )
777 updateStatistics();
778}