From 9574bc74f6240a060f941ef65028a51e8969fe06 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Mon, 16 Jun 2003 17:23:39 +0000 Subject: sanity check and providing the interface for the qcop call tille: we no longer match the qcop-signature - is this a problem? --- (limited to 'noncore/net') diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 448b52b..79734a2 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -487,27 +487,36 @@ 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 ) ); else if ( action == "MessageBox" ) - QMessageBox::information ( this, "Notification!", + QMessageBox::information( this, "Notification!", QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) ); } void Wellenreiter::joinNetwork(const QString& type, const QString& essid, int channel, const QString& macaddr) { - // we need the interface too: - const QString iface = "wlan0"; - qDebug( "joinNetwork() - %s, %s, %d, %s", + if ( !iface ) + { + QMessageBox::warning( this, tr( "Can't do that!" ), tr( "No wireless\ninterface available." ) ); + return; + } + + if ( sniffing ) + { + QMessageBox::warning( this, tr( "Can't do that!" ), tr( "Stop sniffing before\njoining a net." ) ); + return; + } + + qDebug( "joinNetwork() with Interface %s: %s, %s, %d, %s", + (const char*) iface->name(), (const char*) type, (const char*) essid, channel, (const char*) macaddr ); - // TODO: Stop scanning here - QCopEnvelope msg( "QPE/Application/networksettings", "wlan(QString,QString,QString)" ); - msg << iface << QString("Mode") << type; - msg << iface << QString("ESSID") << essid; - msg << iface << QString("Channel") << channel; - msg << iface << QString("MacAddr") << macaddr; + msg << iface->name() << QString("Mode") << type; + msg << iface->name() << QString("ESSID") << essid; + msg << iface->name() << QString("Channel") << channel; + msg << iface->name() << QString("MacAddr") << macaddr; } -- cgit v0.9.0.2