summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/configwindow.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/wellenreiter/gui/configwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp
index ae149e2..1670f93 100644
--- a/noncore/net/wellenreiter/gui/configwindow.cpp
+++ b/noncore/net/wellenreiter/gui/configwindow.cpp
@@ -7,24 +7,25 @@
** 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.
**
**********************************************************************/
/* LOCAL */
#include "configwindow.h"
#include "mainwindow.h"
+#include "protolistview.h"
/* OPIE */
#include <opie2/onetwork.h>
#ifdef QWS
#include <opie2/oapplication.h>
#include <opie2/oconfig.h>
#include <opie2/odevice.h>
#include <opie2/odebug.h>
using namespace Opie::Core;
using namespace Opie::Net;
#endif
@@ -175,25 +176,28 @@ bool WellenreiterConfigWindow::isChannelChecked( int channel ) const
case 3: return channel3->isOn();
case 4: return channel4->isOn();
case 5: return channel5->isOn();
case 6: return channel6->isOn();
case 7: return channel7->isOn();
case 8: return channel8->isOn();
case 9: return channel9->isOn();
case 10: return channel10->isOn();
case 11: return channel11->isOn();
case 12: return channel12->isOn();
case 13: return channel13->isOn();
case 14: return channel14->isOn();
+ default: return false;
}
+
+
}
void WellenreiterConfigWindow::changedDeviceType(int t)
{
if ( t != DEVTYPE_FILE ) return;
QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(false);
if ( !name.isEmpty() && QFile::exists( name ) )
{
interfaceName->insertItem( name );
interfaceName->setCurrentItem( interfaceName->count()-1 );
}
@@ -208,37 +212,37 @@ void WellenreiterConfigWindow::changedDeviceType(int t)
void WellenreiterConfigWindow::synchronizeActionsAndScripts()
{
if ( newNetworkAction->currentItem() == 4 ) newNetworkScript->show(); else newNetworkScript->hide();
if ( newClientAction->currentItem() == 4 ) newClientScript->show(); else newClientScript->hide();
if ( newStationAction->currentItem() == 4 ) newStationScript->show(); else newStationScript->hide();
//newNetworkScript->setEnabled( newNetworkAction->currentItem() == 4 );
//newClientScript->setEnabled( newClientAction->currentItem() == 4 );
//newStationScript->setEnabled( newStationAction->currentItem() == 4 );
}
-void WellenreiterConfigWindow::changedNetworkAction(int t)
+void WellenreiterConfigWindow::changedNetworkAction(int )
{
synchronizeActionsAndScripts();
}
-void WellenreiterConfigWindow::changedClientAction(int t)
+void WellenreiterConfigWindow::changedClientAction(int )
{
synchronizeActionsAndScripts();
}
-void WellenreiterConfigWindow::changedStationAction(int t)
+void WellenreiterConfigWindow::changedStationAction(int )
{
synchronizeActionsAndScripts();
}
void WellenreiterConfigWindow::getCaptureFileNameClicked()
{
QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(true);
odebug << "name = " << name << "" << oendl;
if ( !name.isEmpty() )
{
captureFileName->setText( name );
@@ -271,35 +275,34 @@ bool WellenreiterConfigWindow::useGPS() const
return enableGPS->isChecked();
}
const QString WellenreiterConfigWindow::gpsHost() const
{
return useGPS() ? gpsdHost->currentText() : QString::null;
}
int WellenreiterConfigWindow::gpsPort() const
{
- bool ok;
return useGPS() ? gpsdPort->value() : -1;
}
void WellenreiterConfigWindow::performAction( const QString& type,
const QString& essid,
const QString& mac,
bool wep,
int channel,
- int signal
+ int /* signal */
/* , const GpsLocation& loc */ )
{
int action;
QString script;
if ( type == "network" )
{
action = newNetworkAction->currentItem();
script = newNetworkScript->text();
}
else if ( type == "managed" || type == "adhoc" )
{
@@ -308,25 +311,25 @@ void WellenreiterConfigWindow::performAction( const QString& type,
}
else if ( type == "station" )
{
action = newStationAction->currentItem();
script = newStationScript->text();
}
else
{
owarn << "WellenreiterConfigWindow::performAction(): unknown type '" << type << "'" << oendl;
return;
}
- odebug << "for event '" << (const char*) type << "' I'm going to perform action " << action << " (script='" << script << "')" << oendl;
+ odebug << "for event '" << type << "' I'm going to perform action " << action << " (script='" << script << "')" << oendl;
switch( action )
{
case 0: /* Ignore */ return;
case 1: /* Play Alarm */ ODevice::inst()->playAlarmSound(); return;
case 2: /* Play Click */ ODevice::inst()->playTouchSound(); return;
case 3: /* Blink LED */ break; //FIXME: Implement this
case 4: /* Run Script */
{
/**
*
* Script Substitution Information:
@@ -395,24 +398,25 @@ void WellenreiterConfigWindow::load()
performAutodetection();
}
prismHeader->setChecked( c->readBoolEntry( "prism", false ) );
hopChannels->setChecked( c->readBoolEntry( "hop", true ) );
hopInterval->setValue( c->readNumEntry( "interval", 250 ) );
adaptiveHopping->setChecked( c->readBoolEntry( "adaptive", true ) );
c->setGroup( "Capture" );
writeCaptureFile->setChecked( c->readBoolEntry( "writeCaptureFile", true ) );
captureFileName->setEnabled( writeCaptureFile->isChecked() );
getCaptureFileName->setEnabled( writeCaptureFile->isChecked() );
+ parsePackets->setEnabled( writeCaptureFile->isChecked() );
captureFileName->setText( c->readEntry( "filename", "/tmp/capture" ) );
hexViewBufferUnlimited->setChecked( c->readBoolEntry( "hexViewBufferUnlimited", true ) );
hexViewBufferLimited->setChecked( !c->readBoolEntry( "hexViewBufferUnlimited", true ) );
hexViewBufferSize->setValue( c->readNumEntry( "hexViewBufferSize", 2000 ) );
c->setGroup( "UI" );
lookupVendor->setChecked( c->readBoolEntry( "lookupVendor", true ) );
openTree->setChecked( c->readBoolEntry( "openTree", true ) );
disablePM->setChecked( c->readBoolEntry( "disablePM", true ) );
newNetworkAction->setCurrentItem( c->readNumEntry( "newNetworkAction", 1 ) ); // Default: Play Alarm
newNetworkScript->setText( c->readEntry( "newNetworkScript", "" ) );
newClientAction->setCurrentItem( c->readNumEntry( "newClientAction", 2 ) ); // Default: Play Click