From 5334b639c9f97793bcae4f50f7b47c7a2ada4e2f Mon Sep 17 00:00:00 2001 From: wimpie Date: Fri, 02 Apr 2004 18:29:49 +0000 Subject: First import of NS2 app --- (limited to 'noncore/settings/networksettings2/wlan') diff --git a/noncore/settings/networksettings2/wlan/wlan.pro b/noncore/settings/networksettings2/wlan/wlan.pro new file mode 100644 index 0000000..4cc47ee --- a/dev/null +++ b/noncore/settings/networksettings2/wlan/wlan.pro @@ -0,0 +1,18 @@ +TEMPLATE = lib +CONFIG += qt warn_on release +DESTDIR = $(OPIEDIR)/plugins/networksettings2 +HEADERS = wlan_NN.h \ + wlan_NNI.h \ + wlanedit.h +SOURCES = wlan_NN.cpp \ + wlan_NNI.cpp \ + wlanedit.cpp \ + wlanrun.cpp +INCLUDEPATH += $(OPIEDIR)/include ../ ../networksettings2 +DEPENDPATH += $(OPIEDIR)/include ../ ../networksettings2 +LIBS += -lqpe +INTERFACES = wlanGUI.ui +TARGET = wlan +VERSION = 1.0.0 + +include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/settings/networksettings2/wlan/wlanGUI.cpp b/noncore/settings/networksettings2/wlan/wlanGUI.cpp new file mode 100644 index 0000000..902bd27 --- a/dev/null +++ b/noncore/settings/networksettings2/wlan/wlanGUI.cpp @@ -0,0 +1,360 @@ +/**************************************************************************** +** Form implementation generated from reading ui file 'wlanGUI.ui' +** +** Created: Tue Mar 30 02:42:58 2004 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#include "wlanGUI.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Constructs a WLanGUI which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' + */ +WLanGUI::WLanGUI( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "WLanGUI" ); + resize( 196, 329 ); + setCaption( tr( "Form1" ) ); + WLanGUILayout = new QVBoxLayout( this ); + WLanGUILayout->setSpacing( 0 ); + WLanGUILayout->setMargin( 0 ); + + tabWidget = new QTabWidget( this, "tabWidget" ); + tabWidget->setEnabled( TRUE ); + + ConfigPage = new QWidget( tabWidget, "ConfigPage" ); + ConfigPageLayout = new QVBoxLayout( ConfigPage ); + ConfigPageLayout->setSpacing( 2 ); + ConfigPageLayout->setMargin( 0 ); + + Layout6 = new QGridLayout; + Layout6->setSpacing( 6 ); + Layout6->setMargin( 1 ); + + essidLabel = new QLabel( ConfigPage, "essidLabel" ); + essidLabel->setEnabled( TRUE ); + essidLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, essidLabel->sizePolicy().hasHeightForWidth() ) ); + essidLabel->setText( tr( "ESS-ID" ) ); + + Layout6->addWidget( essidLabel, 1, 0 ); + + essid = new QComboBox( FALSE, ConfigPage, "essid" ); + essid->insertItem( tr( "any" ) ); + essid->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, essid->sizePolicy().hasHeightForWidth() ) ); + essid->setEditable( TRUE ); + essid->setCurrentItem( 0 ); + essid->setSizeLimit( 5 ); + essid->setAutoCompletion( TRUE ); + essid->setDuplicatesEnabled( FALSE ); + + Layout6->addWidget( essid, 1, 1 ); + + modeLabel = new QLabel( ConfigPage, "modeLabel" ); + modeLabel->setEnabled( TRUE ); + modeLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, modeLabel->sizePolicy().hasHeightForWidth() ) ); + modeLabel->setText( tr( "Mode" ) ); + + Layout6->addWidget( modeLabel, 0, 0 ); + + mode = new QComboBox( FALSE, ConfigPage, "mode" ); + mode->insertItem( tr( "Infrastructure" ) ); + mode->insertItem( tr( "Auto" ) ); + mode->insertItem( tr( "Managed" ) ); + mode->insertItem( tr( "Ad-Hoc" ) ); + mode->setEnabled( TRUE ); + mode->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, mode->sizePolicy().hasHeightForWidth() ) ); + + Layout6->addWidget( mode, 0, 1 ); + ConfigPageLayout->addLayout( Layout6 ); + + Layout8 = new QGridLayout; + Layout8->setSpacing( 2 ); + Layout8->setMargin( 1 ); + + specifyAp = new QCheckBox( ConfigPage, "specifyAp" ); + specifyAp->setText( tr( "Specify &Access Point" ) ); + + Layout8->addMultiCellWidget( specifyAp, 0, 0, 0, 2 ); + + macLabel = new QLabel( ConfigPage, "macLabel" ); + macLabel->setEnabled( FALSE ); + macLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)1, macLabel->sizePolicy().hasHeightForWidth() ) ); + macLabel->setText( tr( "MAC" ) ); + + Layout8->addWidget( macLabel, 1, 1 ); + + macEdit = new QLineEdit( ConfigPage, "macEdit" ); + macEdit->setEnabled( FALSE ); + macEdit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)1, macEdit->sizePolicy().hasHeightForWidth() ) ); + + Layout8->addWidget( macEdit, 1, 2 ); + QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Fixed, QSizePolicy::Minimum ); + Layout8->addItem( spacer, 1, 0 ); + ConfigPageLayout->addLayout( Layout8 ); + + Layout7 = new QHBoxLayout; + Layout7->setSpacing( 6 ); + Layout7->setMargin( 1 ); + + specifyChan = new QCheckBox( ConfigPage, "specifyChan" ); + specifyChan->setText( tr( "Specific &Channel" ) ); + Layout7->addWidget( specifyChan ); + + networkChannel = new QSpinBox( ConfigPage, "networkChannel" ); + networkChannel->setEnabled( FALSE ); + networkChannel->setMaxValue( 15 ); + networkChannel->setMinValue( 1 ); + networkChannel->setValue( 1 ); + Layout7->addWidget( networkChannel ); + ConfigPageLayout->addLayout( Layout7 ); + QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + ConfigPageLayout->addItem( spacer_2 ); + tabWidget->insertTab( ConfigPage, tr( "General" ) ); + + WepPage = new QWidget( tabWidget, "WepPage" ); + WepPageLayout = new QVBoxLayout( WepPage ); + WepPageLayout->setSpacing( 2 ); + WepPageLayout->setMargin( 0 ); + + wepEnabled = new QCheckBox( WepPage, "wepEnabled" ); + wepEnabled->setText( tr( "&Enable Encryption" ) ); + WepPageLayout->addWidget( wepEnabled ); + + KeyButtonGroup = new QButtonGroup( WepPage, "KeyButtonGroup" ); + KeyButtonGroup->setEnabled( FALSE ); + KeyButtonGroup->setTitle( tr( "&Key Setting" ) ); + KeyButtonGroup->setColumnLayout(0, Qt::Vertical ); + KeyButtonGroup->layout()->setSpacing( 0 ); + KeyButtonGroup->layout()->setMargin( 0 ); + KeyButtonGroupLayout = new QGridLayout( KeyButtonGroup->layout() ); + KeyButtonGroupLayout->setAlignment( Qt::AlignTop ); + KeyButtonGroupLayout->setSpacing( 2 ); + KeyButtonGroupLayout->setMargin( 2 ); + + keyRadio0 = new QRadioButton( KeyButtonGroup, "keyRadio0" ); + keyRadio0->setText( tr( "Key &1" ) ); + keyRadio0->setChecked( TRUE ); + + KeyButtonGroupLayout->addWidget( keyRadio0, 0, 0 ); + + keyRadio3 = new QRadioButton( KeyButtonGroup, "keyRadio3" ); + keyRadio3->setText( tr( "Key &4" ) ); + + KeyButtonGroupLayout->addWidget( keyRadio3, 3, 0 ); + + LineEdit6 = new QLineEdit( KeyButtonGroup, "LineEdit6" ); + + KeyButtonGroupLayout->addWidget( LineEdit6, 0, 1 ); + + keyRadio1 = new QRadioButton( KeyButtonGroup, "keyRadio1" ); + keyRadio1->setText( tr( "Key &2" ) ); + + KeyButtonGroupLayout->addWidget( keyRadio1, 1, 0 ); + + keyRadio2 = new QRadioButton( KeyButtonGroup, "keyRadio2" ); + keyRadio2->setText( tr( "Key &3" ) ); + + KeyButtonGroupLayout->addWidget( keyRadio2, 2, 0 ); + + LineEdit6_2 = new QLineEdit( KeyButtonGroup, "LineEdit6_2" ); + + KeyButtonGroupLayout->addWidget( LineEdit6_2, 1, 1 ); + + LineEdit6_4 = new QLineEdit( KeyButtonGroup, "LineEdit6_4" ); + + KeyButtonGroupLayout->addWidget( LineEdit6_4, 3, 1 ); + + LineEdit6_3 = new QLineEdit( KeyButtonGroup, "LineEdit6_3" ); + + KeyButtonGroupLayout->addWidget( LineEdit6_3, 2, 1 ); + WepPageLayout->addWidget( KeyButtonGroup ); + + NonEncButtonGroup = new QButtonGroup( WepPage, "NonEncButtonGroup" ); + NonEncButtonGroup->setEnabled( FALSE ); + NonEncButtonGroup->setTitle( tr( "Non-encrypted Packets" ) ); + NonEncButtonGroup->setRadioButtonExclusive( TRUE ); + NonEncButtonGroup->setColumnLayout(0, Qt::Vertical ); + NonEncButtonGroup->layout()->setSpacing( 0 ); + NonEncButtonGroup->layout()->setMargin( 0 ); + NonEncButtonGroupLayout = new QGridLayout( NonEncButtonGroup->layout() ); + NonEncButtonGroupLayout->setAlignment( Qt::AlignTop ); + NonEncButtonGroupLayout->setSpacing( 6 ); + NonEncButtonGroupLayout->setMargin( 2 ); + + acceptNonEnc = new QRadioButton( NonEncButtonGroup, "acceptNonEnc" ); + acceptNonEnc->setText( tr( "&Accept" ) ); + acceptNonEnc->setChecked( TRUE ); + NonEncButtonGroup->insert( acceptNonEnc, 0 ); + + NonEncButtonGroupLayout->addWidget( acceptNonEnc, 0, 0 ); + + rejectNonEnc = new QRadioButton( NonEncButtonGroup, "rejectNonEnc" ); + rejectNonEnc->setText( tr( "&Reject" ) ); + NonEncButtonGroup->insert( rejectNonEnc, 1 ); + + NonEncButtonGroupLayout->addWidget( rejectNonEnc, 0, 1 ); + WepPageLayout->addWidget( NonEncButtonGroup ); + QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + WepPageLayout->addItem( spacer_3 ); + tabWidget->insertTab( WepPage, tr( "Encryption" ) ); + + tab = new QWidget( tabWidget, "tab" ); + tabLayout = new QVBoxLayout( tab ); + tabLayout->setSpacing( 2 ); + tabLayout->setMargin( 0 ); + + Layout12 = new QGridLayout; + Layout12->setSpacing( 2 ); + Layout12->setMargin( 0 ); + + TextLabel1_3 = new QLabel( tab, "TextLabel1_3" ); + TextLabel1_3->setText( tr( "Station" ) ); + + Layout12->addWidget( TextLabel1_3, 0, 0 ); + + Channel_LBL = new QLabel( tab, "Channel_LBL" ); + Channel_LBL->setFrameShape( QLabel::Panel ); + Channel_LBL->setFrameShadow( QLabel::Sunken ); + + Layout12->addWidget( Channel_LBL, 3, 1 ); + + TextLabel4_3 = new QLabel( tab, "TextLabel4_3" ); + TextLabel4_3->setText( tr( "Channel" ) ); + + Layout12->addWidget( TextLabel4_3, 3, 0 ); + + TextLabel3_3 = new QLabel( tab, "TextLabel3_3" ); + TextLabel3_3->setText( tr( "Mode" ) ); + + Layout12->addWidget( TextLabel3_3, 2, 0 ); + + TextLabel2_3 = new QLabel( tab, "TextLabel2_3" ); + TextLabel2_3->setText( tr( "ESSID" ) ); + + Layout12->addWidget( TextLabel2_3, 1, 0 ); + + TextLabel9_2 = new QLabel( tab, "TextLabel9_2" ); + TextLabel9_2->setText( tr( "AP" ) ); + + Layout12->addWidget( TextLabel9_2, 4, 0 ); + + Station_LBL = new QLabel( tab, "Station_LBL" ); + Station_LBL->setFrameShape( QLabel::Panel ); + Station_LBL->setFrameShadow( QLabel::Sunken ); + + Layout12->addWidget( Station_LBL, 0, 1 ); + + Rate_LBL = new QLabel( tab, "Rate_LBL" ); + Rate_LBL->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)1, Rate_LBL->sizePolicy().hasHeightForWidth() ) ); + Rate_LBL->setFrameShape( QLabel::Panel ); + Rate_LBL->setFrameShadow( QLabel::Sunken ); + + Layout12->addWidget( Rate_LBL, 5, 1 ); + + TextLabel4_2_2 = new QLabel( tab, "TextLabel4_2_2" ); + TextLabel4_2_2->setText( tr( "Rate" ) ); + + Layout12->addWidget( TextLabel4_2_2, 5, 0 ); + + AP_LBL = new QLabel( tab, "AP_LBL" ); + AP_LBL->setFrameShape( QLabel::Panel ); + AP_LBL->setFrameShadow( QLabel::Sunken ); + + Layout12->addWidget( AP_LBL, 4, 1 ); + + essidLabel_3 = new QLabel( tab, "essidLabel_3" ); + essidLabel_3->setFrameShape( QLabel::Panel ); + essidLabel_3->setFrameShadow( QLabel::Sunken ); + + Layout12->addWidget( essidLabel_3, 1, 1 ); + + modeLabel_3 = new QLabel( tab, "modeLabel_3" ); + modeLabel_3->setFrameShape( QLabel::Panel ); + modeLabel_3->setFrameShadow( QLabel::Sunken ); + + Layout12->addWidget( modeLabel_3, 2, 1 ); + tabLayout->addLayout( Layout12 ); + + GroupBox1 = new QGroupBox( tab, "GroupBox1" ); + GroupBox1->setTitle( tr( "Link Quality" ) ); + GroupBox1->setColumnLayout(0, Qt::Vertical ); + GroupBox1->layout()->setSpacing( 0 ); + GroupBox1->layout()->setMargin( 0 ); + GroupBox1Layout = new QGridLayout( GroupBox1->layout() ); + GroupBox1Layout->setAlignment( Qt::AlignTop ); + GroupBox1Layout->setSpacing( 2 ); + GroupBox1Layout->setMargin( 2 ); + + TextLabel2_2_2 = new QLabel( GroupBox1, "TextLabel2_2_2" ); + TextLabel2_2_2->setText( tr( "Noise" ) ); + + GroupBox1Layout->addWidget( TextLabel2_2_2, 1, 0 ); + + TextLabel3_2_2 = new QLabel( GroupBox1, "TextLabel3_2_2" ); + TextLabel3_2_2->setText( tr( "Quality" ) ); + + GroupBox1Layout->addWidget( TextLabel3_2_2, 2, 0 ); + + Noise_PB = new QProgressBar( GroupBox1, "Noise_PB" ); + Noise_PB->setProgress( 0 ); + + GroupBox1Layout->addWidget( Noise_PB, 1, 2 ); + + Quality_PB = new QProgressBar( GroupBox1, "Quality_PB" ); + Quality_PB->setProgress( 0 ); + + GroupBox1Layout->addWidget( Quality_PB, 2, 2 ); + + TextLabel1_2_2 = new QLabel( GroupBox1, "TextLabel1_2_2" ); + TextLabel1_2_2->setText( tr( "Signal" ) ); + + GroupBox1Layout->addWidget( TextLabel1_2_2, 0, 0 ); + QSpacerItem* spacer_4 = new QSpacerItem( 16, 20, QSizePolicy::Fixed, QSizePolicy::Minimum ); + GroupBox1Layout->addItem( spacer_4, 0, 1 ); + + Signal_PB = new QProgressBar( GroupBox1, "Signal_PB" ); + Signal_PB->setProgress( 0 ); + + GroupBox1Layout->addWidget( Signal_PB, 0, 2 ); + tabLayout->addWidget( GroupBox1 ); + QSpacerItem* spacer_5 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + tabLayout->addItem( spacer_5 ); + tabWidget->insertTab( tab, tr( "State" ) ); + WLanGUILayout->addWidget( tabWidget ); + + // signals and slots connections + connect( wepEnabled, SIGNAL( toggled(bool) ), KeyButtonGroup, SLOT( setEnabled(bool) ) ); + connect( wepEnabled, SIGNAL( toggled(bool) ), NonEncButtonGroup, SLOT( setEnabled(bool) ) ); + connect( specifyAp, SIGNAL( toggled(bool) ), macEdit, SLOT( setEnabled(bool) ) ); + connect( specifyAp, SIGNAL( toggled(bool) ), macLabel, SLOT( setEnabled(bool) ) ); + connect( specifyChan, SIGNAL( toggled(bool) ), networkChannel, SLOT( setEnabled(bool) ) ); +} + +/* + * Destroys the object and frees any allocated resources + */ +WLanGUI::~WLanGUI() +{ + // no need to delete child widgets, Qt does it all for us +} + diff --git a/noncore/settings/networksettings2/wlan/wlanGUI.h b/noncore/settings/networksettings2/wlan/wlanGUI.h new file mode 100644 index 0000000..42e8705 --- a/dev/null +++ b/noncore/settings/networksettings2/wlan/wlanGUI.h @@ -0,0 +1,96 @@ +/**************************************************************************** +** Form interface generated from reading ui file 'wlanGUI.ui' +** +** Created: Tue Mar 30 02:42:55 2004 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#ifndef WLANGUI_H +#define WLANGUI_H + +#include +#include +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +class QButtonGroup; +class QCheckBox; +class QComboBox; +class QGroupBox; +class QLabel; +class QLineEdit; +class QProgressBar; +class QRadioButton; +class QSpinBox; +class QTabWidget; + +class WLanGUI : public QWidget +{ + Q_OBJECT + +public: + WLanGUI( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~WLanGUI(); + + QTabWidget* tabWidget; + QWidget* ConfigPage; + QLabel* essidLabel; + QComboBox* essid; + QLabel* modeLabel; + QComboBox* mode; + QCheckBox* specifyAp; + QLabel* macLabel; + QLineEdit* macEdit; + QCheckBox* specifyChan; + QSpinBox* networkChannel; + QWidget* WepPage; + QCheckBox* wepEnabled; + QButtonGroup* KeyButtonGroup; + QRadioButton* keyRadio0; + QRadioButton* keyRadio3; + QLineEdit* LineEdit6; + QRadioButton* keyRadio1; + QRadioButton* keyRadio2; + QLineEdit* LineEdit6_2; + QLineEdit* LineEdit6_4; + QLineEdit* LineEdit6_3; + QButtonGroup* NonEncButtonGroup; + QRadioButton* acceptNonEnc; + QRadioButton* rejectNonEnc; + QWidget* tab; + QLabel* TextLabel1_3; + QLabel* Channel_LBL; + QLabel* TextLabel4_3; + QLabel* TextLabel3_3; + QLabel* TextLabel2_3; + QLabel* TextLabel9_2; + QLabel* Station_LBL; + QLabel* Rate_LBL; + QLabel* TextLabel4_2_2; + QLabel* AP_LBL; + QLabel* essidLabel_3; + QLabel* modeLabel_3; + QGroupBox* GroupBox1; + QLabel* TextLabel2_2_2; + QLabel* TextLabel3_2_2; + QProgressBar* Noise_PB; + QProgressBar* Quality_PB; + QLabel* TextLabel1_2_2; + QProgressBar* Signal_PB; + +protected: + QVBoxLayout* WLanGUILayout; + QVBoxLayout* ConfigPageLayout; + QGridLayout* Layout6; + QGridLayout* Layout8; + QHBoxLayout* Layout7; + QVBoxLayout* WepPageLayout; + QGridLayout* KeyButtonGroupLayout; + QGridLayout* NonEncButtonGroupLayout; + QVBoxLayout* tabLayout; + QGridLayout* Layout12; + QGridLayout* GroupBox1Layout; +}; + +#endif // WLANGUI_H diff --git a/noncore/settings/networksettings2/wlan/wlan_NN.cpp b/noncore/settings/networksettings2/wlan/wlan_NN.cpp new file mode 100644 index 0000000..5a26e41 --- a/dev/null +++ b/noncore/settings/networksettings2/wlan/wlan_NN.cpp @@ -0,0 +1,60 @@ +#include "wlan_NN.h" +#include "wlan_NNI.h" + +static const char * WLanNeeds[] = + { 0 + }; + +/** + * Constructor, find all of the possible interfaces + */ +WLanNetNode::WLanNetNode() : ANetNode() { +} + +/** + * Delete any interfaces that we own. + */ +WLanNetNode::~WLanNetNode(){ +} + +const QString WLanNetNode::nodeDescription(){ + return tr("\ +

Configure Wi/Fi or WLan network cards.

\ +

Defines Wireless options for those cards

\ +" +); +} + +ANetNodeInstance * WLanNetNode::createInstance( void ) { + return new AWLan( this ); +} + +const char ** WLanNetNode::needs( void ) { + return WLanNeeds; +} + +const char * WLanNetNode::provides( void ) { + return "device"; +} + +bool WLanNetNode::generateProperFilesFor( + ANetNodeInstance * ) { + return 1; +} + +bool WLanNetNode::hasDataFor( const QString & ) { + return 0; +} + +bool WLanNetNode::generateDataForCommonFile( + SystemFile & , + long, + ANetNodeInstance * ) { + return 1; +} + +extern "C" { +void create_plugin( QList & PNN ) { + PNN.append( new WLanNetNode() ); +} +} diff --git a/noncore/settings/networksettings2/wlan/wlan_NN.h b/noncore/settings/networksettings2/wlan/wlan_NN.h new file mode 100644 index 0000000..d1d6ded --- a/dev/null +++ b/noncore/settings/networksettings2/wlan/wlan_NN.h @@ -0,0 +1,44 @@ +#ifndef WLAN_NETNODE_H +#define WLAN_NETNODE_H + +#include "netnode.h" + +class AWLan; + +class WLanNetNode : public ANetNode{ + + Q_OBJECT + +public: + + WLanNetNode(); + virtual ~WLanNetNode(); + + virtual const QString pixmapName() + { return "wlan"; } + + virtual const QString nodeName() + { return tr("WLan Device"); } + + virtual const QString nodeDescription() ; + + virtual ANetNodeInstance * createInstance( void ); + + virtual const char ** needs( void ); + virtual const char * provides( void ); + + virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); + virtual bool hasDataFor( const QString & S ); + virtual bool generateDataForCommonFile( + SystemFile & SF, long DevNr, ANetNodeInstance * NNI ); + +private: + +}; + +extern "C" +{ + void create_plugin( QList & PNN ); +}; + +#endif diff --git a/noncore/settings/networksettings2/wlan/wlan_NNI.cpp b/noncore/settings/networksettings2/wlan/wlan_NNI.cpp new file mode 100644 index 0000000..92f3457 --- a/dev/null +++ b/noncore/settings/networksettings2/wlan/wlan_NNI.cpp @@ -0,0 +1,30 @@ +#include "wlanedit.h" +#include "wlan_NNI.h" +#include "wlan_NN.h" + +AWLan::AWLan( WLanNetNode * PNN ) : ANetNodeInstance( PNN ) { + GUI = 0; + RT = 0; +} + +void AWLan::setSpecificAttribute( QString & , QString & ) { +} + +void AWLan::saveSpecificAttribute( QTextStream & ) { +} + +QWidget * AWLan::edit( QWidget * parent ) { + GUI = new WLanEdit( parent ); + GUI->showData( Data ); + return GUI; +} + +QString AWLan::acceptable( void ) { + return ( GUI ) ? GUI->acceptable( ) : QString(); +} + +void AWLan::commit( void ) { + if( GUI && GUI->commit( Data ) ) + setModified( 1 ); +} + diff --git a/noncore/settings/networksettings2/wlan/wlan_NNI.h b/noncore/settings/networksettings2/wlan/wlan_NNI.h new file mode 100644 index 0000000..8b695b5 --- a/dev/null +++ b/noncore/settings/networksettings2/wlan/wlan_NNI.h @@ -0,0 +1,43 @@ +#ifndef WLAN_H +#define WLAN_H + +#include +#include "wlandata.h" +#include "wlanrun.h" + +class WLanNetNode; +class WLanEdit; + +class AWLan : public ANetNodeInstance { + +public : + + AWLan( WLanNetNode * PNN ); + + QWidget * edit( QWidget * parent ); + QString acceptable( void ); + void commit( void ); + + RuntimeInfo * runtime( void ) + { if( RT == 0 ) + RT = new WLanRun( this, Data ); + return RT; + } + + virtual void * data( void ) + { return (void *)&Data; } + +protected : + + virtual void setSpecificAttribute( QString & Attr, QString & Value ); + virtual void saveSpecificAttribute( QTextStream & TS ); + +private : + + WLanEdit * GUI; + WLanData Data; + WLanRun * RT; + +}; + +#endif diff --git a/noncore/settings/networksettings2/wlan/wlandata.h b/noncore/settings/networksettings2/wlan/wlandata.h new file mode 100644 index 0000000..ba1f2c2 --- a/dev/null +++ b/noncore/settings/networksettings2/wlan/wlandata.h @@ -0,0 +1,17 @@ +#ifndef WLAN_DATA_H +#define WLAN_DATA_H + +#include +typedef struct WLanData { + QString Device; + QString LockFile; + long Speed; + short Parity; + short DataBits; + short StopBits; + bool HardwareControl; + bool SoftwareControl; + +} WLanData_t; + +#endif diff --git a/noncore/settings/networksettings2/wlan/wlanedit.cpp b/noncore/settings/networksettings2/wlan/wlanedit.cpp new file mode 100644 index 0000000..c884886 --- a/dev/null +++ b/noncore/settings/networksettings2/wlan/wlanedit.cpp @@ -0,0 +1,16 @@ +#include +#include "wlanedit.h" + +WLanEdit::WLanEdit( QWidget * Parent ) : WLanGUI( Parent ){ +} + +QString WLanEdit::acceptable( void ) { + return QString(); +} + +void WLanEdit::showData( WLanData_t & Data ) { +} + +bool WLanEdit::commit( WLanData_t & Data ) { + return 0; +} diff --git a/noncore/settings/networksettings2/wlan/wlanedit.h b/noncore/settings/networksettings2/wlan/wlanedit.h new file mode 100644 index 0000000..b7442d5 --- a/dev/null +++ b/noncore/settings/networksettings2/wlan/wlanedit.h @@ -0,0 +1,12 @@ +#include "wlandata.h" +#include "wlanGUI.h" + +class WLanEdit : public WLanGUI { + +public : + + WLanEdit( QWidget * parent ); + QString acceptable( void ); + void showData( WLanData_t & Data ); + bool commit( WLanData_t & Data ); +}; diff --git a/noncore/settings/networksettings2/wlan/wlanrun.cpp b/noncore/settings/networksettings2/wlan/wlanrun.cpp new file mode 100644 index 0000000..79f11f7 --- a/dev/null +++ b/noncore/settings/networksettings2/wlan/wlanrun.cpp @@ -0,0 +1,5 @@ +#include "wlanrun.h" + +bool WLanRun::handlesInterface( const QString & S ) { + return Pat.match( S ) >= 0; +} diff --git a/noncore/settings/networksettings2/wlan/wlanrun.h b/noncore/settings/networksettings2/wlan/wlanrun.h new file mode 100644 index 0000000..4cbb059 --- a/dev/null +++ b/noncore/settings/networksettings2/wlan/wlanrun.h @@ -0,0 +1,42 @@ +#ifndef WLANRUN_H +#define WLANRUN_H + +#include +#include +#include "wlandata.h" + +class WLanRun : public AsDevice { + +public : + + WLanRun( ANetNodeInstance * NNI, WLanData & Data ) : + AsDevice( NNI ), + Pat( "wlan[0-9]" ) + { } + + virtual long count( void ) + { return 2; } + virtual QString genNic( long nr ) + { QString S; return S.sprintf( "wlan%ld", nr ); } + virtual AsDevice * device( void ) + { return asDevice(); } + +protected : + + void detectState( NodeCollection * ) + { } + + bool setState( NodeCollection *, Action_t ) + { return 0; } + + bool canSetState( State_t, Action_t ) + { return 0; } + + bool handlesInterface( const QString & I ); + +private : + + QRegExp Pat; +}; + +#endif -- cgit v0.9.0.2