summaryrefslogtreecommitdiff
path: root/noncore
authormickeyl <mickeyl>2003-06-26 10:34:59 (UTC)
committer mickeyl <mickeyl>2003-06-26 10:34:59 (UTC)
commit8168239a5b1ff80abc02f93ed831c088ca5f2f3d (patch) (side-by-side diff)
treed19069b730eeb82f02754955366569d52d088248 /noncore
parent3c5746daa26d8353fde9ba84c6183517e26a625a (diff)
downloadopie-8168239a5b1ff80abc02f93ed831c088ca5f2f3d.zip
opie-8168239a5b1ff80abc02f93ed831c088ca5f2f3d.tar.gz
opie-8168239a5b1ff80abc02f93ed831c088ca5f2f3d.tar.bz2
first bunch of fixes for Qt 3.x compilation
Diffstat (limited to 'noncore') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.cpp2
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp1
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp9
3 files changed, 10 insertions, 2 deletions
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp
index 5bec7ed..11394d7 100644
--- a/noncore/net/wellenreiter/gui/configwindow.cpp
+++ b/noncore/net/wellenreiter/gui/configwindow.cpp
@@ -36,97 +36,97 @@
WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0;
WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f )
:WellenreiterConfigBase( parent, name, true, f )
{
_devicetype[ "cisco" ] = DEVTYPE_CISCO;
_devicetype[ "wlan-ng" ] = DEVTYPE_WLAN_NG;
_devicetype[ "hostap" ] = DEVTYPE_HOSTAP;
_devicetype[ "orinoco" ] = DEVTYPE_ORINOCO;
_devicetype[ "<manual>" ] = DEVTYPE_MANUAL;
_devicetype[ "<file>" ] = DEVTYPE_FILE;
// gather possible interface names from ONetwork
ONetwork* net = ONetwork::instance();
ONetwork::InterfaceIterator it = net->iterator();
while ( it.current() )
{
if ( it.current()->isWireless() )
interfaceName->insertItem( it.current()->name() );
++it;
}
// try to guess device type
QFile m( "/proc/modules" );
if ( m.open( IO_ReadOnly ) )
{
int devicetype(0);
QString line;
QTextStream modules( &m );
while( !modules.atEnd() && !devicetype )
{
modules >> line;
if ( line.contains( "cisco" ) ) devicetype = DEVTYPE_CISCO;
else if ( line.contains( "hostap" ) ) devicetype = DEVTYPE_HOSTAP;
else if ( line.contains( "prism" ) ) devicetype = DEVTYPE_WLAN_NG;
else if ( line.contains( "orinoco" ) ) devicetype = DEVTYPE_ORINOCO;
}
if ( devicetype )
{
deviceType->setCurrentItem( devicetype );
_guess = devicetype;
qDebug( "Wellenreiter: guessed device type to be #%d", devicetype );
}
}
#ifdef Q_WS_X11 // We're on X11: adding an Ok-Button for the Dialog here
QPushButton* okButton = new QPushButton( "ok", this );
okButton->show();
- Layout5_2->addWidget( okButton, 0, 3 ); //FIXME: rename this in configbase.ui
+ WellenreiterConfigBaseLayout->addWidget( okButton, 0, 3 ); //FIXME: rename this in configbase.ui
connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
#endif
WellenreiterConfigWindow::_instance = this;
connect( deviceType, SIGNAL( activated(int) ), this, SLOT( changedDeviceType(int) ) );
connect( getCaptureFileName, SIGNAL( clicked() ), this, SLOT( getCaptureFileNameClicked() ) );
// make the checkbox 'channelAll' control all other channels
connect( channelAll, SIGNAL( stateChanged(int) ), this, SLOT( channelAllClicked(int) ) );
};
int WellenreiterConfigWindow::driverType() const
{
QString name = deviceType->currentText();
if ( _devicetype.contains( name ) )
{
return _devicetype[name];
}
else
{
return 0;
}
};
int WellenreiterConfigWindow::hoppingInterval() const
{
return hopInterval->cleanText().toInt();
}
bool WellenreiterConfigWindow::usePrismHeader() const
{
return prismHeader->isOn();
}
bool WellenreiterConfigWindow::isChannelChecked( int channel ) const
{
switch ( channel )
{
case 1: return channel1->isOn();
case 2: return channel2->isOn();
case 3: return channel3->isOn();
case 4: return channel4->isOn();
case 5: return channel5->isOn();
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index 085eec4..f4cfe52 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -1,68 +1,69 @@
/**********************************************************************
** 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 "scanlist.h"
#include "configwindow.h"
#include "logwindow.h"
#include <assert.h>
+#include <qcursor.h>
#include <qdatetime.h>
#include <qtextstream.h>
#include <qpopupmenu.h>
#ifdef QWS
#include <qpe/qpeapplication.h>
#include <opie/odevice.h>
using namespace Opie;
#endif
#ifdef QWS
#include <qpe/resource.h>
#else
#include "resource.h"
#endif
const int col_type = 0;
const int col_essid = 0;
const int col_sig = 1;
const int col_ap = 2;
const int col_channel = 3;
const int col_wep = 4;
const int col_traffic = 5;
const int col_ip = 6;
const int col_manuf = 7;
const int col_firstseen = 8;
const int col_lastseen = 9;
MScanListView::MScanListView( QWidget* parent, const char* name )
:OListView( parent, name )
{
setFrameShape( QListView::StyledPanel );
setFrameShadow( QListView::Sunken );
addColumn( tr( "Net/Station" ) );
setColumnAlignment( col_essid, AlignLeft || AlignVCenter );
addColumn( tr( "#" ) );
setColumnAlignment( col_sig, AlignCenter );
addColumn( tr( "MAC" ) );
setColumnAlignment( col_ap, AlignCenter );
addColumn( tr( "Chn" ) );
setColumnAlignment( col_channel, AlignCenter );
addColumn( tr( "W" ) );
setColumnAlignment( col_wep, AlignCenter );
addColumn( tr( "T" ) );
setColumnAlignment( col_traffic, AlignCenter );
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index dcf796f..96733ff 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -429,102 +429,109 @@ void Wellenreiter::startClicked()
pcap->setBlocking( false );
// start channel hopper
if ( cardtype != DEVTYPE_FILE )
iface->setChannelHopping( 1000 ); //use interval from config window
if ( cardtype != DEVTYPE_FILE )
{
// connect socket notifier and start channel hopper
connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) );
connect( iface->channelHopper(), SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) );
}
else
{
// start timer for reading packets
startTimer( 100 );
}
logwindow->log( "(i) Started Scanning." );
sniffing = true;
emit( startedSniffing() );
if ( cardtype != DEVTYPE_FILE ) channelHopped( 6 ); // set title
else
{
assert( parent() );
( (QMainWindow*) parent() )->setCaption( tr( "Wellenreiter II - replaying capture file..." ) );
}
}
void Wellenreiter::timerEvent( QTimerEvent* )
{
qDebug( "Wellenreiter::timerEvent()" );
OPacket* p = pcap->next();
if ( !p ) // no more packets available
{
stopClicked();
}
else
{
receivePacket( p );
delete p;
}
}
void Wellenreiter::doAction( const QString& action, const QString& protocol, OPacket* p )
{
+ #ifdef QWS
if ( action == "TouchSound" )
ODevice::inst()->touchSound();
else if ( action == "AlarmSound" )
ODevice::inst()->alarmSound();
else if ( action == "KeySound" )
ODevice::inst()->keySound();
else if ( action == "LedOn" )
ODevice::inst()->setLedState( Led_Mail, Led_On );
else if ( action == "LedOff" )
ODevice::inst()->setLedState( Led_Mail, Led_Off );
else if ( action == "LogMessage" )
logwindow->log( QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) );
else if ( action == "MessageBox" )
QMessageBox::information( this, "Notification!",
QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) );
+ #else
+ #warning Actions do not work with Qt/X11 yet
+ #endif
}
void Wellenreiter::joinNetwork(const QString& type, const QString& essid, int channel, const QString& macaddr)
{
+ #ifdef QWS
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 );
QCopEnvelope msg( "QPE/Application/networksettings", "wlan(QString,QString,QString)" );
int count = 3;
qDebug("sending %d messages",count);
msg << QString("count") << QString::number(count);
qDebug("msg >%s< Mode >%s<", iface->name(),type.latin1() );
msg << QString(iface->name()) << QString("Mode") << type;
qDebug("msg >%s< essid >%s<", iface->name(),essid.latin1());
msg << QString(iface->name()) << QString("ESSID") << essid;
qDebug("msg >%s< channel >%d<", iface->name(),channel);
msg << QString(iface->name()) << QString("Channel") << channel;
// qDebug("msg >%s< mac >%s<", iface->name(),macaddr);
// msg << QString(iface->name()) << QString("MacAddr") << macaddr;
-
+ #else
+ QMessageBox::warning( this, tr( "Can't do that!" ), tr( "Function only available on Embedded build" ) );
+ #endif
}