From 4ea2f227d3fb0d9591bb4f18555420ac47f3397d Mon Sep 17 00:00:00 2001 From: wimpie Date: Fri, 02 Apr 2004 18:30:55 +0000 Subject: first import of NS2 app --- (limited to 'noncore') diff --git a/noncore/settings/networksettings2/bluetooth/bluetooth.pro b/noncore/settings/networksettings2/bluetooth/bluetooth.pro new file mode 100644 index 0000000..180bda9 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetooth.pro @@ -0,0 +1,21 @@ +TEMPLATE = lib +CONFIG += qt warn_on release +DESTDIR = $(OPIEDIR)/plugins/networksettings2 +HEADERS = bluetooth_NN.h \ + bluetoothBNEP_NNI.h \ + bluetoothRFCOMM_NNI.h \ + bluetoothBNEPedit.h \ + bluetoothRFCOMMedit.h +SOURCES = bluetooth_NN.cpp \ + bluetoothBNEP_NNI.cpp \ + bluetoothRFCOMM_NNI.cpp \ + bluetoothBNEPedit.cpp \ + bluetoothRFCOMMedit.cpp +INCLUDEPATH += $(OPIEDIR)/include ../ ../networksettings2 +DEPENDPATH += $(OPIEDIR)/include ../ ../networksettings2 +LIBS += -lqpe +INTERFACES = bluetoothBNEPGUI.ui bluetoothRFCOMMGUI.ui +TARGET = bluetooth +VERSION = 1.0.0 + +include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPGUI.ui b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPGUI.ui new file mode 100644 index 0000000..ddb5ddd --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPGUI.ui @@ -0,0 +1,131 @@ + +BluetoothBNEPGUI + + QWidget + + name + BluetoothBNEP_FRM + + + geometry + + 0 + 0 + 283 + 199 + + + + caption + Bluetooth-bnep + + + layoutMargin + + + layoutSpacing + + + + margin + 2 + + + spacing + 2 + + + QLayoutWidget + + name + Layout4 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + TextLabel4 + + + text + Name + + + + QLineEdit + + name + Name_LE + + + + + + QLabel + + name + TextLabel3 + + + text + Description + + + + QMultiLineEdit + + name + Description_LE + + + + QLayoutWidget + + name + Layout5 + + + + margin + 0 + + + spacing + 6 + + + QCheckBox + + name + Automatic_CB + + + text + Start automatically + + + + QCheckBox + + name + Confirm_CB + + + text + Confirm before start + + + + + + + diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.cpp new file mode 100644 index 0000000..1743c1d --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.cpp @@ -0,0 +1,29 @@ +#include "bluetoothBNEPedit.h" +#include "bluetoothBNEP_NNI.h" +#include "bluetooth_NN.h" + +ABluetoothBNEP::ABluetoothBNEP( BluetoothBNEPNetNode * PNN ) : ANetNodeInstance( PNN ) { + GUI = 0; + RT = 0; +} + +void ABluetoothBNEP::setSpecificAttribute( QString & , QString & ) { +} + +void ABluetoothBNEP::saveSpecificAttribute( QTextStream & ) { +} + +QWidget * ABluetoothBNEP::edit( QWidget * parent ) { + GUI = new BluetoothBNEPEdit( parent ); + GUI->showData( Data ); + return GUI; +} + +QString ABluetoothBNEP::acceptable( void ) { + return ( GUI ) ? GUI->acceptable( ) : QString(); +} + +void ABluetoothBNEP::commit( void ) { + if( GUI && GUI->commit( Data ) ) + setModified( 1 ); +} diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h new file mode 100644 index 0000000..a21f574 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h @@ -0,0 +1,43 @@ +#ifndef BLUETOOTHBNEP_H +#define BLUETOOTHBNEP_H + +#include +#include "bluetoothBNEPdata.h" +#include "bluetoothBNEPrun.h" + +class BluetoothBNEPNetNode; +class BluetoothBNEPEdit; + +class ABluetoothBNEP : public ANetNodeInstance { + +public : + + ABluetoothBNEP( BluetoothBNEPNetNode * PNN ); + + QWidget * edit( QWidget * parent ); + QString acceptable( void ); + void commit( void ); + + RuntimeInfo * runtime( void ) + { if( RT == 0 ) + RT = new BluetoothBNEPRun( 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 : + + BluetoothBNEPEdit * GUI; + BluetoothBNEPData Data; + BluetoothBNEPRun * RT; + +}; + +#endif diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPdata.h b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPdata.h new file mode 100644 index 0000000..037b7b1 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPdata.h @@ -0,0 +1,8 @@ +#ifndef BLUETOOTHBNEP_DATA_H +#define BLUETOOTHBNEP_DATA_H + +typedef struct BluetoothBNEPData { + long x; +} BluetoothBNEPData_t; + +#endif diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPedit.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPedit.cpp new file mode 100644 index 0000000..a27f1a7 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPedit.cpp @@ -0,0 +1,18 @@ +#include +#include "bluetoothBNEPedit.h" + + +BluetoothBNEPEdit::BluetoothBNEPEdit( QWidget * Parent ) : BluetoothBNEPGUI( Parent ){ + +} + +QString BluetoothBNEPEdit::acceptable( void ) { + return QString(); +} + +bool BluetoothBNEPEdit::commit( BluetoothBNEPData & Data ) { + return 0; +} + +void BluetoothBNEPEdit::showData( BluetoothBNEPData & Data ) { +} diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPedit.h b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPedit.h new file mode 100644 index 0000000..d546f1e --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPedit.h @@ -0,0 +1,13 @@ +#include "bluetoothBNEPdata.h" +#include "bluetoothBNEPGUI.h" + +class BluetoothBNEPEdit : public BluetoothBNEPGUI { + +public : + + BluetoothBNEPEdit( QWidget * parent ); + + QString acceptable( void ); + bool commit( BluetoothBNEPData & Data ); + void showData( BluetoothBNEPData & Data ); +}; diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h new file mode 100644 index 0000000..e65b378 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h @@ -0,0 +1,32 @@ +#include +#include "bluetoothBNEPdata.h" + +class BluetoothBNEPRun : public AsDevice { + +public : + + BluetoothBNEPRun( ANetNodeInstance * NNI, + BluetoothBNEPData & Data ) : AsDevice( NNI ) + { } + + virtual long count( void ) + { return 3; } + virtual QString genNic( long nr ) + { QString S; return S.sprintf( "bnep%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 & ) + { return 0; } +}; diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMGUI.ui b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMGUI.ui new file mode 100644 index 0000000..2754a70 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMGUI.ui @@ -0,0 +1,131 @@ + +BluetoothRFCOMMGUI + + QWidget + + name + BluetoothRFCOMM_FRM + + + geometry + + 0 + 0 + 283 + 199 + + + + caption + Bluetooth-rfcomm + + + layoutMargin + + + layoutSpacing + + + + margin + 2 + + + spacing + 2 + + + QLayoutWidget + + name + Layout4 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + TextLabel4 + + + text + Name + + + + QLineEdit + + name + Name_LE + + + + + + QLabel + + name + TextLabel3 + + + text + Description + + + + QMultiLineEdit + + name + Description_LE + + + + QLayoutWidget + + name + Layout5 + + + + margin + 0 + + + spacing + 6 + + + QCheckBox + + name + Automatic_CB + + + text + Start automatically + + + + QCheckBox + + name + Confirm_CB + + + text + Confirm before start + + + + + + + diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.cpp new file mode 100644 index 0000000..7ec8288 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.cpp @@ -0,0 +1,30 @@ +#include "bluetoothRFCOMMedit.h" +#include "bluetoothRFCOMM_NNI.h" +#include "bluetooth_NN.h" + +ABluetoothRFCOMM::ABluetoothRFCOMM( BluetoothRFCOMMNetNode * PNN ) : ANetNodeInstance( PNN ) { + GUI = 0; + RT = 0; +} + +void ABluetoothRFCOMM::setSpecificAttribute( QString & , QString & ) { +} + +void ABluetoothRFCOMM::saveSpecificAttribute( QTextStream & ) { +} + + +QWidget * ABluetoothRFCOMM::edit( QWidget * parent ) { + GUI = new BluetoothRFCOMMEdit( parent ); + GUI->showData( Data ); + return GUI; +} + +QString ABluetoothRFCOMM::acceptable( void ) { + return ( GUI ) ? GUI->acceptable( ) : QString(); +} + +void ABluetoothRFCOMM::commit( void ) { + if( GUI->commit( Data ) ) + setModified( 1 ); +} diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h new file mode 100644 index 0000000..4dd508d --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h @@ -0,0 +1,42 @@ +#ifndef BLUETOOTHRFCOMM_H +#define BLUETOOTHRFCOMM_H + +#include +#include "bluetoothRFCOMMdata.h" +#include "bluetoothRFCOMMrun.h" + +class BluetoothRFCOMMNetNode; +class BluetoothRFCOMMEdit; + +class ABluetoothRFCOMM : public ANetNodeInstance { + +public : + + ABluetoothRFCOMM( BluetoothRFCOMMNetNode * PNN ); + + QWidget * edit( QWidget * parent ); + QString acceptable( void ); + void commit( void ); + + RuntimeInfo * runtime( void ) + { if( RT ) + RT = new BluetoothRFCOMMRun( 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 : + + BluetoothRFCOMMEdit * GUI; + BluetoothRFCOMMData Data; + BluetoothRFCOMMRun * RT; +}; + +#endif diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMdata.h b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMdata.h new file mode 100644 index 0000000..18f0d38 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMdata.h @@ -0,0 +1,18 @@ +#ifndef BLUETOOTHRFCOMM_DATA_H +#define BLUETOOTHRFCOMM_DATA_H + +#include + +typedef struct BluetoothRFCOMMData { + QString Device; + QString LockFile; + long Speed; + short Parity; + short DataBits; + short StopBits; + bool HardwareControl; + bool SoftwareControl; + +} BluetoothRFCOMMData_t; + +#endif diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMedit.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMedit.cpp new file mode 100644 index 0000000..d3ddab4 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMedit.cpp @@ -0,0 +1,18 @@ +#include +#include "bluetoothRFCOMMedit.h" + +BluetoothRFCOMMEdit::BluetoothRFCOMMEdit( QWidget * Parent ) : + BluetoothRFCOMMGUI( Parent ){ + +} + +QString BluetoothRFCOMMEdit::acceptable( void ) { + return QString(); +} + +void BluetoothRFCOMMEdit::showData( BluetoothRFCOMMData & Data ) { +} + +bool BluetoothRFCOMMEdit::commit( BluetoothRFCOMMData & Data ) { + return 0; +} diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMedit.h b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMedit.h new file mode 100644 index 0000000..14a6d64 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMedit.h @@ -0,0 +1,13 @@ +#include "bluetoothRFCOMMdata.h" +#include "bluetoothRFCOMMGUI.h" + +class BluetoothRFCOMMEdit : public BluetoothRFCOMMGUI { + +public : + + BluetoothRFCOMMEdit( QWidget * parent ); + + QString acceptable( void ); + void showData( BluetoothRFCOMMData & Data ); + bool commit( BluetoothRFCOMMData & Data ); +}; diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h new file mode 100644 index 0000000..87116e2 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h @@ -0,0 +1,22 @@ +#include +#include "bluetoothRFCOMMdata.h" + +class BluetoothRFCOMMRun : public AsLine { + +public : + + BluetoothRFCOMMRun( ANetNodeInstance * NNI, + BluetoothRFCOMMData & Data ) : AsLine( NNI ) + { } + +protected : + + void detectState( NodeCollection * ) + { } + + bool setState( NodeCollection * , Action_t ) + { return 0; } + + bool canSetState( State_t , Action_t ) + { return 0; } +}; diff --git a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp new file mode 100644 index 0000000..91be153 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp @@ -0,0 +1,120 @@ +#include "bluetooth_NN.h" +#include "bluetoothBNEP_NNI.h" +#include "bluetoothRFCOMM_NNI.h" + +// +// +// BLUETOOTH PAN/NAP node +// +// + +static const char * BluetoothBNEPNeeds[] = + { 0 + }; + +/** + * Constructor, find all of the possible interfaces + */ +BluetoothBNEPNetNode::BluetoothBNEPNetNode() : ANetNode() { +} + +/** + * Delete any interfaces that we own. + */ +BluetoothBNEPNetNode::~BluetoothBNEPNetNode(){ +} + +const QString BluetoothBNEPNetNode::nodeDescription(){ + return tr("\ +

Sets up a bluetooth link using the bluetooth Network profile.

\ +

Use this to connect two computing devices.

\ +" +); +} + +ANetNodeInstance * BluetoothBNEPNetNode::createInstance( void ) { + return new ABluetoothBNEP( this ); +} + +const char ** BluetoothBNEPNetNode::needs( void ) { + return BluetoothBNEPNeeds; +} + +const char * BluetoothBNEPNetNode::provides( void ) { + return "device"; +} + +bool BluetoothBNEPNetNode::generateProperFilesFor( + ANetNodeInstance * ) { + return 1; +} + +bool BluetoothBNEPNetNode::hasDataFor( const QString & ) { + return 0; +} + +bool BluetoothBNEPNetNode::generateDataForCommonFile( + SystemFile & , + long , + ANetNodeInstance * ) { + return 1; +} + +// +// +// BLUETOOTH PAN/NAP node +// +// + +static const char * BluetoothRFCOMMNeeds[] = + { 0 + }; + +BluetoothRFCOMMNetNode::BluetoothRFCOMMNetNode() : ANetNode() { +} + +BluetoothRFCOMMNetNode::~BluetoothRFCOMMNetNode(){ +} + +const QString BluetoothRFCOMMNetNode::nodeDescription(){ + return tr("\ +

Sets up a bluetooth link using the bluetooth serial profile.

\ +

Use this to connect to a GSM.

\ +" +); +} + +ANetNodeInstance * BluetoothRFCOMMNetNode::createInstance( void ) { + return new ABluetoothRFCOMM( this ); +} + +const char ** BluetoothRFCOMMNetNode::needs( void ) { + return BluetoothRFCOMMNeeds; +} + +const char * BluetoothRFCOMMNetNode::provides( void ) { + return "line"; +} + +bool BluetoothRFCOMMNetNode::generateProperFilesFor( + ANetNodeInstance * ) { + return 0; +} + +bool BluetoothRFCOMMNetNode::hasDataFor( const QString & ) { + return 0; +} + +bool BluetoothRFCOMMNetNode::generateDataForCommonFile( + SystemFile & , + long, + ANetNodeInstance * ) { + return 0; +} + +extern "C" { +void create_plugin( QList & PNN ) { + PNN.append( new BluetoothBNEPNetNode() ); + PNN.append( new BluetoothRFCOMMNetNode() ); +} +} diff --git a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h new file mode 100644 index 0000000..ee346f0 --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h @@ -0,0 +1,75 @@ +#ifndef BLUETOOTH_NETNODE_H +#define BLUETOOTH_NETNODE_H + +#include "netnode.h" + +class ABluetoothBNEP; + +class BluetoothBNEPNetNode : public ANetNode { + + Q_OBJECT + +public: + + BluetoothBNEPNetNode(); + virtual ~BluetoothBNEPNetNode(); + + virtual const QString pixmapName() + { return "bluetooth"; } + + virtual const QString nodeName() + { return tr("Bluetooth PAN/NAP"); } + + 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: + +}; + +class BluetoothRFCOMMNetNode : public ANetNode { + + Q_OBJECT + +public: + + BluetoothRFCOMMNetNode(); + virtual ~BluetoothRFCOMMNetNode(); + + virtual const QString pixmapName() + { return "bluetooth"; } + + virtual const QString nodeName() + { return tr("Bluetooth serial link"); } + + 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, ANetNodeInstance * NNI ); + +private: + +}; + +extern "C" +{ + void create_plugin( QList & PNN ); +}; + +#endif diff --git a/noncore/settings/networksettings2/bluetooth/config.in b/noncore/settings/networksettings2/bluetooth/config.in new file mode 100644 index 0000000..2b527cc --- a/dev/null +++ b/noncore/settings/networksettings2/bluetooth/config.in @@ -0,0 +1,4 @@ + config NS2BT + boolean "opie-networksettings2plugin-bluetooth (set up BLUETOOTH)" + default "n" if NS2 + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && NS2 && NS2CORE diff --git a/noncore/settings/networksettings2/cable/cable.pro b/noncore/settings/networksettings2/cable/cable.pro new file mode 100644 index 0000000..d902360 --- a/dev/null +++ b/noncore/settings/networksettings2/cable/cable.pro @@ -0,0 +1,18 @@ +TEMPLATE = lib +CONFIG += qt warn_on release +DESTDIR = $(OPIEDIR)/plugins/networksettings2 +HEADERS = cable_NN.h \ + cable_NNI.h \ + cableedit.h +SOURCES = cable_NN.cpp \ + cable_NNI.cpp \ + cableedit.cpp \ + cablerun.cpp +INCLUDEPATH += $(OPIEDIR)/include ../ ../networksettings2 +DEPENDPATH += $(OPIEDIR)/include ../ ../networksettings2 +LIBS += -lqpe +INTERFACES = cableGUI.ui +TARGET = cable +VERSION = 1.0.0 + +include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/settings/networksettings2/cable/cableGUI.ui b/noncore/settings/networksettings2/cable/cableGUI.ui new file mode 100644 index 0000000..2431861 --- a/dev/null +++ b/noncore/settings/networksettings2/cable/cableGUI.ui @@ -0,0 +1,545 @@ + +CableGUI + + QWidget + + name + Cable_FRM + + + geometry + + 0 + 0 + 235 + 194 + + + + caption + Cable + + + layoutMargin + + + layoutSpacing + + + + margin + 2 + + + spacing + 2 + + + QLayoutWidget + + name + Layout3 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + TextLabel1_2 + + + text + Lock file + + + + QLabel + + name + TextLabel1 + + + text + Device + + + + QLineEdit + + name + LockFile_LE + + + + QLineEdit + + name + DeviceFile_LE + + + + + + QGroupBox + + name + GroupBox1 + + + title + Serial settings + + + layoutMargin + + + layoutSpacing + + + + margin + 2 + + + spacing + 2 + + + QLayoutWidget + + name + Layout13 + + + layoutSpacing + + + + margin + 0 + + + spacing + 2 + + + QComboBox + + + text + 2400 + + + + + text + 9600 + + + + + text + 19200 + + + + + text + 38400 + + + + + text + 57600 + + + + + text + 115200 + + + + + text + 230400 + + + + + text + 460800 + + + + + text + 500000 + + + + + text + 921600 + + + + + text + 1000000 + + + + + text + 1152000 + + + + + text + 1500000 + + + + + text + 2000000 + + + + + text + 2500000 + + + + + text + 3000000 + + + + + text + 3500000 + + + + + text + 4000000 + + + + name + Speed_CB + + + currentItem + 5 + + + + QLabel + + name + TextLabel2_2 + + + sizePolicy + + 0 + 1 + + + + text + Parity + + + + QLabel + + name + TextLabel2_2_3 + + + sizePolicy + + 0 + 1 + + + + text + Data bits + + + + QLabel + + name + TextLabel2 + + + text + Speed + + + + QLabel + + name + TextLabel2_2_3_2 + + + sizePolicy + + 0 + 1 + + + + text + Stop bits + + + + QComboBox + + + text + No + + + + + text + Even + + + + + text + Odd + + + + + text + Mark + + + + + text + Space + + + + name + Parity_CB + + + sizePolicy + + 7 + 0 + + + + currentItem + 0 + + + + QSpinBox + + name + DataBits_SB + + + sizePolicy + + 7 + 0 + + + + maxValue + 8 + + + minValue + 5 + + + value + 8 + + + + QComboBox + + + text + 1 + + + + + text + 2 + + + + name + StopBits_CB + + + sizePolicy + + 7 + 0 + + + + + + + QLayoutWidget + + name + Layout17 + + + layoutSpacing + + + + margin + 0 + + + spacing + 2 + + + QLabel + + name + TextLabel3 + + + sizePolicy + + 0 + 1 + + + + text + Flow control : + + + alignment + AlignTop|AlignLeft + + + vAlign + + + + QLayoutWidget + + name + Layout16 + + + layoutSpacing + + + + margin + 0 + + + spacing + 2 + + + QCheckBox + + name + HardwareFC_CB + + + sizePolicy + + 7 + 0 + + + + text + Hardware + + + + QCheckBox + + name + SoftwareFC_CB + + + sizePolicy + + 7 + 0 + + + + text + Software + + + + + + + + + + + name + Spacer6 + + + orientation + Vertical + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + + diff --git a/noncore/settings/networksettings2/cable/cable_NN.cpp b/noncore/settings/networksettings2/cable/cable_NN.cpp new file mode 100644 index 0000000..756903e --- a/dev/null +++ b/noncore/settings/networksettings2/cable/cable_NN.cpp @@ -0,0 +1,59 @@ +#include "cable_NN.h" +#include "cable_NNI.h" + +static const char * CableNeeds[] = + { 0 + }; + +/** + * Constructor, find all of the possible interfaces + */ +CableNetNode::CableNetNode() : ANetNode() { +} + +/** + * Delete any interfaces that we own. + */ +CableNetNode::~CableNetNode(){ +} + +const QString CableNetNode::nodeDescription(){ + return tr("\ +

Sets up a wired serial or parallel.

\ +" +); +} + +ANetNodeInstance * CableNetNode::createInstance( void ) { + return new ACable( this ); +} + +const char ** CableNetNode::needs( void ) { + return CableNeeds; +} + +const char * CableNetNode::provides( void ) { + return "line"; +} + +bool CableNetNode::generateProperFilesFor( + ANetNodeInstance * ) { + return 1; +} + +bool CableNetNode::hasDataFor( const QString & ) { + return 0; +} + +bool CableNetNode::generateDataForCommonFile( + SystemFile & , + long , + ANetNodeInstance * ) { + return 1; +} + +extern "C" { +void create_plugin( QList & PNN ) { + PNN.append( new CableNetNode() ); +} +} diff --git a/noncore/settings/networksettings2/cable/cable_NN.h b/noncore/settings/networksettings2/cable/cable_NN.h new file mode 100644 index 0000000..401317b --- a/dev/null +++ b/noncore/settings/networksettings2/cable/cable_NN.h @@ -0,0 +1,44 @@ +#ifndef CABLE_NETNODE_H +#define CABLE_NETNODE_H + +#include "netnode.h" + +class ACable; + +class CableNetNode : public ANetNode { + + Q_OBJECT + +public: + + CableNetNode(); + virtual ~CableNetNode(); + + virtual const QString pixmapName() + { return "cable"; } + + virtual const QString nodeName() + { return tr("Cable Connection"); } + + 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/cable/cable_NNI.cpp b/noncore/settings/networksettings2/cable/cable_NNI.cpp new file mode 100644 index 0000000..d26afd1 --- a/dev/null +++ b/noncore/settings/networksettings2/cable/cable_NNI.cpp @@ -0,0 +1,66 @@ +#include "cableedit.h" +#include "cable_NNI.h" +#include "cable_NN.h" + +ACable::ACable( CableNetNode * PNN ) : ANetNodeInstance( PNN ) { + // default values + Data.Device = "/dev/ttyS0"; + Data.LockFile = "/var/Lock"; + Data.Speed = 115200; + Data.DataBits = 8; + Data.Parity = 0; + Data.StopBits = 1; + Data.HardwareControl = 0; + Data.SoftwareControl = 0; + GUI = 0; + RT = 0; +} + +void ACable::setSpecificAttribute( QString & A, QString & V) { + if( A == "device" ) { + Data.Device = V; + } else if ( A == "lockfile" ) { + Data.LockFile = V; + } else if ( A == "speed" ) { + Data.Speed = V.toLong(); + } else if ( A == "parity" ) { + Data.Parity = V.toShort(); + } else if ( A == "databits" ) { + Data.DataBits = V.toShort(); + } else if ( A == "stopbits" ) { + Data.StopBits = V.toShort(); + } else if ( A == "hardwarecontrol" ) { + Data.HardwareControl = ( V == "yes" ); + } else if ( A == "softwarecontrol" ) { + Data.SoftwareControl = ( V == "yes" ); + } +} + +void ACable::saveSpecificAttribute( QTextStream & TS ) { + TS << "device=" << quote( Data.Device ) << endl; + TS << "lockfile=" << quote( Data.LockFile ) << endl; + TS << "speed=" << Data.Speed << endl; + TS << "parity=" << Data.Parity << endl; + TS << "databits=" << Data.DataBits << endl; + TS << "stopbits=" << Data.StopBits << endl; + TS << "hardwarecontrol=" << + ((Data.HardwareControl) ? "yes" : "no") << endl; + TS << "softwarecontrol=" << + ((Data.SoftwareControl) ? "yes" : "no") << endl; +} + +QWidget * ACable::edit( QWidget * parent ) { + GUI = new CableEdit( parent ); + GUI->showData( Data ); + return GUI; +} + +QString ACable::acceptable( void ) { + return ( GUI ) ? GUI->acceptable( ) : QString(); +} + +void ACable::commit( void ) { + if( GUI && GUI->commit( Data ) ) { + setModified( 1 ); + } +} diff --git a/noncore/settings/networksettings2/cable/cable_NNI.h b/noncore/settings/networksettings2/cable/cable_NNI.h new file mode 100644 index 0000000..0654a5d --- a/dev/null +++ b/noncore/settings/networksettings2/cable/cable_NNI.h @@ -0,0 +1,43 @@ +#ifndef CABLE_H +#define CABLE_H + +#include +#include "cabledata.h" +#include "cablerun.h" + +class CableNetNode; +class CableEdit; + +class ACable : public ANetNodeInstance { + +public : + + ACable( CableNetNode * PNN ); + + QWidget * edit( QWidget * parent ); + QString acceptable( void ); + void commit( void ); + + RuntimeInfo * runtime( void ) + { if( RT == 0 ) + RT = new CableRun( 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 : + + CableEdit * GUI; + CableData_t Data; + CableRun * RT; + +}; + +#endif diff --git a/noncore/settings/networksettings2/cable/cabledata.h b/noncore/settings/networksettings2/cable/cabledata.h new file mode 100644 index 0000000..c449d96 --- a/dev/null +++ b/noncore/settings/networksettings2/cable/cabledata.h @@ -0,0 +1,18 @@ +#ifndef CABLE_DATA_H +#define CABLE_DATA_H + +#include + +typedef struct CableData { + QString Device; + QString LockFile; + long Speed; + short Parity; + short DataBits; + short StopBits; + bool HardwareControl; + bool SoftwareControl; + +} CableData_t; + +#endif diff --git a/noncore/settings/networksettings2/cable/cableedit.cpp b/noncore/settings/networksettings2/cable/cableedit.cpp new file mode 100644 index 0000000..6e1a13b --- a/dev/null +++ b/noncore/settings/networksettings2/cable/cableedit.cpp @@ -0,0 +1,68 @@ +#include +#include +#include +#include +#include +#include +#include "cabledata.h" +#include "cableedit.h" + +static long SpeedTable[] = { + 2400, 9600, 19200, 38400, 57600, 115200, + 230400, 460800, 500000, 921600, 1000000, + 1152000, 1500000, 2000000, 2500000, 3000000, + 3500000, 4000000, -1 +}; + +CableEdit::CableEdit( QWidget * Parent ) : CableGUI( Parent ) { +} + +void CableEdit::showData( CableData_t & D ) { + DeviceFile_LE->setText( D.Device ); + LockFile_LE->setText( D.LockFile ); + for( long * Run = SpeedTable; *Run != -1; *Run ++ ) { + if( *Run == D.Speed ) { + Speed_CB->setCurrentItem( + ((long)(Run)-(long)(SpeedTable))/sizeof(long) ); + break; + } + } + Parity_CB->setCurrentItem( D.Parity ); + DataBits_SB->setValue( D.DataBits ); + StopBits_CB->setCurrentItem( D.StopBits ); + HardwareFC_CB->setChecked( D.HardwareControl ); + SoftwareFC_CB->setChecked( D.SoftwareControl ); +} + +QString CableEdit::acceptable( void ) { + if( DeviceFile_LE->text().isEmpty() ) + return tr("Device filename needed"); + return QString(); +} + +bool CableEdit::commit( CableData_t & D ) { + bool SM = 0; + + TXTM( D.Device, DeviceFile_LE, SM ); + TXTM( D.LockFile, LockFile_LE, SM ); + + for( long * Run = SpeedTable; *Run != -1; *Run ++ ) { + if( *Run == D.Speed ) { + if( D.Speed != Speed_CB->currentText().toLong() ) { + SM = 1; + D.Speed = Speed_CB->currentText().toLong(); + } + break; + } + } + + CIM(D.Parity, Parity_CB, SM ); + + SBM(D.DataBits, DataBits_SB, SM ); + CIM(D.StopBits, StopBits_CB, SM ); + + CBM( D.HardwareControl, HardwareFC_CB, SM ); + CBM( D.SoftwareControl, SoftwareFC_CB, SM ); + + return SM; +} diff --git a/noncore/settings/networksettings2/cable/cableedit.h b/noncore/settings/networksettings2/cable/cableedit.h new file mode 100644 index 0000000..ffacc61 --- a/dev/null +++ b/noncore/settings/networksettings2/cable/cableedit.h @@ -0,0 +1,12 @@ +#include "cabledata.h" +#include "cableGUI.h" + +class CableEdit : public CableGUI { + +public : + + CableEdit( QWidget * parent ); + QString acceptable( void ); + bool commit( CableData_t & D ); + void showData( CableData_t & D ); +}; diff --git a/noncore/settings/networksettings2/cable/cablerun.cpp b/noncore/settings/networksettings2/cable/cablerun.cpp new file mode 100644 index 0000000..edb4b01 --- a/dev/null +++ b/noncore/settings/networksettings2/cable/cablerun.cpp @@ -0,0 +1,26 @@ +#include +#include +#include "cablerun.h" + +void CableRun::detectState( NodeCollection * NC ) { + + int fd = open( D->Device.latin1(), O_RDWR ); + + if( fd < 0 ) { + NC->setCurrentState( Unavailable ); + } + close( fd ); + NC->setCurrentState( Available ); +} + +bool CableRun::setState( NodeCollection * NC, Action_t A ) { + if( A == Activate ) { + detectState(NC); + return (NC->currentState() == Available); + } + return 1; +} + +bool CableRun::canSetState( State_t , Action_t ) { + return 1; +} diff --git a/noncore/settings/networksettings2/cable/cablerun.h b/noncore/settings/networksettings2/cable/cablerun.h new file mode 100644 index 0000000..36ee640 --- a/dev/null +++ b/noncore/settings/networksettings2/cable/cablerun.h @@ -0,0 +1,21 @@ +#include +#include "cabledata.h" + +class CableRun : public AsLine { + +public : + + CableRun( ANetNodeInstance * NNI, + CableData & Data ) : AsLine( NNI ) + { D = &Data; } + +protected : + + void detectState( NodeCollection * NC ); + bool setState( NodeCollection * NC, Action_t A ); + bool canSetState( State_t Curr, Action_t A ); + +private : + + CableData_t * D; +}; diff --git a/noncore/settings/networksettings2/cable/config.in b/noncore/settings/networksettings2/cable/config.in new file mode 100644 index 0000000..4453107 --- a/dev/null +++ b/noncore/settings/networksettings2/cable/config.in @@ -0,0 +1,4 @@ + config NS2CABLE + boolean "opie-networksettings2plugin-cable (set up Cable)" + default "n" if NS2 + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && NS2 && NS2CORE diff --git a/noncore/settings/networksettings2/irda/config.in b/noncore/settings/networksettings2/irda/config.in new file mode 100644 index 0000000..997cf55 --- a/dev/null +++ b/noncore/settings/networksettings2/irda/config.in @@ -0,0 +1,4 @@ + config NS2IRDA + boolean "opie-networksettings2plugin-irda (set up IRDA)" + default "n" if NS2 + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && NS2 && NS2CORE diff --git a/noncore/settings/networksettings2/irda/irda.pro b/noncore/settings/networksettings2/irda/irda.pro new file mode 100644 index 0000000..a7573b8 --- a/dev/null +++ b/noncore/settings/networksettings2/irda/irda.pro @@ -0,0 +1,17 @@ +TEMPLATE = lib +CONFIG += qt warn_on release +DESTDIR = $(OPIEDIR)/plugins/networksettings2 +HEADERS = irda_NN.h \ + irda_NNI.h \ + irdaedit.h +SOURCES = irda_NN.cpp \ + irda_NNI.cpp \ + irdaedit.cpp +INCLUDEPATH += $(OPIEDIR)/include ../ ../networksettings2 +DEPENDPATH += $(OPIEDIR)/include ../ ../networksettings2 +LIBS += -lqpe +INTERFACES = irdaGUI.ui +TARGET = irda +VERSION = 1.0.0 + +include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/settings/networksettings2/irda/irdaGUI.ui b/noncore/settings/networksettings2/irda/irdaGUI.ui new file mode 100644 index 0000000..f8a7020 --- a/dev/null +++ b/noncore/settings/networksettings2/irda/irdaGUI.ui @@ -0,0 +1,131 @@ + +IRDAGUI + + QWidget + + name + IRDA_FRM + + + geometry + + 0 + 0 + 283 + 199 + + + + caption + IRDA + + + layoutMargin + + + layoutSpacing + + + + margin + 2 + + + spacing + 2 + + + QLayoutWidget + + name + Layout4 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + TextLabel4 + + + text + Name + + + + QLineEdit + + name + Name_LE + + + + + + QLabel + + name + TextLabel3 + + + text + Description + + + + QMultiLineEdit + + name + Description_LE + + + + QLayoutWidget + + name + Layout5 + + + + margin + 0 + + + spacing + 6 + + + QCheckBox + + name + Automatic_CB + + + text + Start automatically + + + + QCheckBox + + name + Confirm_CB + + + text + Confirm before start + + + + + + + diff --git a/noncore/settings/networksettings2/irda/irda_NN.cpp b/noncore/settings/networksettings2/irda/irda_NN.cpp new file mode 100644 index 0000000..3b9c938 --- a/dev/null +++ b/noncore/settings/networksettings2/irda/irda_NN.cpp @@ -0,0 +1,59 @@ +#include "irda_NN.h" +#include "irda_NNI.h" + +static const char * IRDANeeds[] = + { 0 + }; + +/** + * Constructor, find all of the possible interfaces + */ +IRDANetNode::IRDANetNode() : ANetNode() { +} + +/** + * Delete any interfaces that we own. + */ +IRDANetNode::~IRDANetNode(){ +} + +const QString IRDANetNode::nodeDescription(){ + return tr("\ +

Sets up a infra red serial link.

\ +" +); +} + +ANetNodeInstance * IRDANetNode::createInstance( void ) { + return new AIRDA( this ); +} + +const char ** IRDANetNode::needs( void ) { + return IRDANeeds; +} + +const char * IRDANetNode::provides( void ) { + return "line"; +} + +bool IRDANetNode::generateProperFilesFor( + ANetNodeInstance * ) { + return 1; +} + +bool IRDANetNode::hasDataFor( const QString & ) { + return 0; +} + +bool IRDANetNode::generateDataForCommonFile( + SystemFile & , + long , + ANetNodeInstance * ) { + return 1; +} + +extern "C" { +void create_plugin( QList & PNN ) { + PNN.append( new IRDANetNode() ); +} +} diff --git a/noncore/settings/networksettings2/irda/irda_NN.h b/noncore/settings/networksettings2/irda/irda_NN.h new file mode 100644 index 0000000..82811a4 --- a/dev/null +++ b/noncore/settings/networksettings2/irda/irda_NN.h @@ -0,0 +1,44 @@ +#ifndef IRDA_NETNODE_H +#define IRDA_NETNODE_H + +#include "netnode.h" + +class AIRDA; + +class IRDANetNode : public ANetNode { + + Q_OBJECT + +public: + + IRDANetNode(); + virtual ~IRDANetNode(); + + virtual const QString pixmapName() + { return "irda"; } + + virtual const QString nodeName() + { return tr("Infrared link"); } + + 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/irda/irda_NNI.cpp b/noncore/settings/networksettings2/irda/irda_NNI.cpp new file mode 100644 index 0000000..78d6ff9 --- a/dev/null +++ b/noncore/settings/networksettings2/irda/irda_NNI.cpp @@ -0,0 +1,30 @@ +#include "irdaedit.h" +#include "irda_NNI.h" +#include "irda_NN.h" + +AIRDA::AIRDA( IRDANetNode * PNN ) : ANetNodeInstance( PNN ) { + + GUI = 0; + RT = 0; +} + +void AIRDA::setSpecificAttribute( QString & , QString & ) { +} + +void AIRDA::saveSpecificAttribute( QTextStream & ) { +} + +QWidget * AIRDA::edit( QWidget * parent ) { + GUI = new IRDAEdit( parent ); + GUI->showData( Data ); + return GUI; +} + +QString AIRDA::acceptable( void ) { + return ( GUI ) ? GUI->acceptable( ) : QString(); +} + +void AIRDA::commit( void ) { + if( GUI && GUI->commit( Data ) ) + setModified( 1 ); +} diff --git a/noncore/settings/networksettings2/irda/irda_NNI.h b/noncore/settings/networksettings2/irda/irda_NNI.h new file mode 100644 index 0000000..c2d6875 --- a/dev/null +++ b/noncore/settings/networksettings2/irda/irda_NNI.h @@ -0,0 +1,43 @@ +#ifndef IRDA_H +#define IRDA_H + +#include +#include "irdadata.h" +#include "irdarun.h" + +class IRDANetNode; +class IRDAEdit; + +class AIRDA : public ANetNodeInstance { + +public : + + AIRDA( IRDANetNode * PNN ); + + QWidget * edit( QWidget * parent ); + QString acceptable( void ); + void commit( void ); + + RuntimeInfo * runtime( void ) + { if( RT == 0 ) + RT = new IRDARun( 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 : + + IRDAEdit * GUI; + IRDAData Data; + IRDARun * RT; + +}; + +#endif diff --git a/noncore/settings/networksettings2/irda/irdadata.h b/noncore/settings/networksettings2/irda/irdadata.h new file mode 100644 index 0000000..c3c683e --- a/dev/null +++ b/noncore/settings/networksettings2/irda/irdadata.h @@ -0,0 +1,18 @@ +#ifndef IRDA_DATA_H +#define IRDA_DATA_H + +#include + +typedef struct IRDAData { + QString Device; + QString LockFile; + long Speed; + short Parity; + short DataBits; + short StopBits; + bool HardwareControl; + bool SoftwareControl; + +} IRDAData_t; + +#endif diff --git a/noncore/settings/networksettings2/irda/irdaedit.cpp b/noncore/settings/networksettings2/irda/irdaedit.cpp new file mode 100644 index 0000000..2dfdce5 --- a/dev/null +++ b/noncore/settings/networksettings2/irda/irdaedit.cpp @@ -0,0 +1,17 @@ +#include +#include "irdaedit.h" + +IRDAEdit::IRDAEdit( QWidget * Parent ) : IRDAGUI( Parent ){ + +} + +QString IRDAEdit::acceptable( void ) { + return QString(); +} + +bool IRDAEdit::commit( IRDAData & Data ) { + return 0; +} + +void IRDAEdit::showData( IRDAData & Data ) { +} diff --git a/noncore/settings/networksettings2/irda/irdaedit.h b/noncore/settings/networksettings2/irda/irdaedit.h new file mode 100644 index 0000000..5131126 --- a/dev/null +++ b/noncore/settings/networksettings2/irda/irdaedit.h @@ -0,0 +1,12 @@ +#include "irdadata.h" +#include "irdaGUI.h" + +class IRDAEdit : public IRDAGUI { + +public : + + IRDAEdit( QWidget * parent ); + QString acceptable( void ); + bool commit( IRDAData & Data ); + void showData( IRDAData & Data ); +}; diff --git a/noncore/settings/networksettings2/irda/irdarun.h b/noncore/settings/networksettings2/irda/irdarun.h new file mode 100644 index 0000000..adc9c24 --- a/dev/null +++ b/noncore/settings/networksettings2/irda/irdarun.h @@ -0,0 +1,22 @@ +#include +#include "irdadata.h" + +class IRDARun : public AsLine { + +public : + + IRDARun( ANetNodeInstance * NNI, + IRDAData & Data ) : AsLine( NNI ) + { } + +protected : + + void detectState( NodeCollection * ) + { } + + bool setState( NodeCollection * , Action_t ) + { return 0; } + + bool canSetState( State_t , Action_t ) + { return 0; } +}; diff --git a/noncore/settings/networksettings2/lancard/config.in b/noncore/settings/networksettings2/lancard/config.in new file mode 100644 index 0000000..d190f6e --- a/dev/null +++ b/noncore/settings/networksettings2/lancard/config.in @@ -0,0 +1,4 @@ + config NS2LANCARD + boolean "opie-networksettings2plugin-lancard (regular wired lan card)" + default "n" if NS2 + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && NS2 && NS2CORE diff --git a/noncore/settings/networksettings2/lancard/lancard.pro b/noncore/settings/networksettings2/lancard/lancard.pro new file mode 100644 index 0000000..f188d2b --- a/dev/null +++ b/noncore/settings/networksettings2/lancard/lancard.pro @@ -0,0 +1,18 @@ +TEMPLATE = lib +CONFIG += qt warn_on release +DESTDIR = $(OPIEDIR)/plugins/networksettings2 +HEADERS = lancard_NN.h \ + lancard_NNI.h \ + lancardedit.h +SOURCES = lancard_NN.cpp \ + lancard_NNI.cpp \ + lancardedit.cpp \ + lancardrun.cpp +INCLUDEPATH += $(OPIEDIR)/include ../ ../networksettings2 +DEPENDPATH += $(OPIEDIR)/include ../ ../networksettings2 +LIBS += -lqpe +INTERFACES = lancardGUI.ui +TARGET = lancard +VERSION = 1.0.0 + +include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/settings/networksettings2/lancard/lancardGUI.ui b/noncore/settings/networksettings2/lancard/lancardGUI.ui new file mode 100644 index 0000000..8d94816 --- a/dev/null +++ b/noncore/settings/networksettings2/lancard/lancardGUI.ui @@ -0,0 +1,129 @@ + +LanCardGUI + + QWidget + + name + Lancard_FRM + + + geometry + + 0 + 0 + 362 + 359 + + + + caption + LAN card + + + layoutMargin + + + layoutSpacing + + + + margin + 2 + + + spacing + 2 + + + QCheckBox + + name + AnyCard_CB + + + text + Any available LAN card + + + checked + true + + + + QGroupBox + + name + GroupBox1 + + + enabled + false + + + title + Select Card + + + layoutMargin + + + + margin + 11 + + + spacing + 6 + + + QListView + + + text + Name + + + clickable + true + + + resizeable + true + + + + + text + MACAddress + + + clickable + true + + + resizeable + true + + + + name + LanCards_LV + + + allColumnsShowFocus + true + + + + + + + + + AnyCard_CB + toggled(bool) + GroupBox1 + setDisabled(bool) + + + diff --git a/noncore/settings/networksettings2/lancard/lancard_NN.cpp b/noncore/settings/networksettings2/lancard/lancard_NN.cpp new file mode 100644 index 0000000..a45496d --- a/dev/null +++ b/noncore/settings/networksettings2/lancard/lancard_NN.cpp @@ -0,0 +1,60 @@ +#include "lancard_NN.h" +#include "lancard_NNI.h" + +static const char * LanCardNeeds[] = + { 0 }; + +/** + * Constructor, find all of the possible interfaces + */ +LanCardNetNode::LanCardNetNode() : ANetNode() { +} + +/** + * Delete any interfaces that we own. + */ +LanCardNetNode::~LanCardNetNode(){ +} + +const QString LanCardNetNode::nodeDescription(){ + return tr("\ +

Sets up a wired regular LAN card.

\ +

Use this to set up 10/100/1000 MBit LAN cards.

\ +" +); +} + +ANetNodeInstance * LanCardNetNode::createInstance( void ) { + return new ALanCard( this ); +} + + +const char ** LanCardNetNode::needs( void ) { + return LanCardNeeds; +} + +const char * LanCardNetNode::provides( void ) { + return "device"; +} + +bool LanCardNetNode::generateProperFilesFor( + ANetNodeInstance * ) { + return 1; +} + +bool LanCardNetNode::hasDataFor( const QString & ) { + return 0; +} + +bool LanCardNetNode::generateDataForCommonFile( + SystemFile & , + long , + ANetNodeInstance * ) { + return 1; +} + +extern "C" { +void create_plugin( QList & PNN ) { + PNN.append( new LanCardNetNode() ); +} +} diff --git a/noncore/settings/networksettings2/lancard/lancard_NN.h b/noncore/settings/networksettings2/lancard/lancard_NN.h new file mode 100644 index 0000000..576a6e0 --- a/dev/null +++ b/noncore/settings/networksettings2/lancard/lancard_NN.h @@ -0,0 +1,44 @@ +#ifndef LANCARD_NETNODE_H +#define LANCARD_NETNODE_H + +#include "netnode.h" + +class ALanCard; + +class LanCardNetNode : public ANetNode{ + + Q_OBJECT + +public: + + LanCardNetNode(); + virtual ~LanCardNetNode(); + + virtual const QString pixmapName() + { return "card"; } + + virtual const QString nodeName() + { return tr("LAN card"); } + + 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/lancard/lancard_NNI.cpp b/noncore/settings/networksettings2/lancard/lancard_NNI.cpp new file mode 100644 index 0000000..9595e2e --- a/dev/null +++ b/noncore/settings/networksettings2/lancard/lancard_NNI.cpp @@ -0,0 +1,44 @@ +#include "lancardedit.h" +#include "lancard_NNI.h" +#include "lancard_NN.h" + +ALanCard::ALanCard( LanCardNetNode * PNN ) : ANetNodeInstance( PNN ) { + + Data.AnyLanCard = 1; + Data.HWAddresses.clear(); + + GUI = 0; + RT = 0; +} + +void ALanCard::setSpecificAttribute( QString & A, QString & V ) { + if( A == "matchanycard" ) { + Data.AnyLanCard = (V == "yes" ); + } else if( A == "match" ) { + Data.HWAddresses.append( V ); + } +} + +void ALanCard::saveSpecificAttribute( QTextStream & TS) { + TS << "matchanycard=" << + ((Data.AnyLanCard) ? "yes" : "no") << endl; + for( QStringList::Iterator it = Data.HWAddresses.begin(); + it != Data.HWAddresses.end(); ++it ) { + TS << "match=" << quote( *it ) << endl; + } +} + +QWidget * ALanCard::edit( QWidget * parent ) { + GUI = new LanCardEdit( parent ); + GUI->showData( Data ); + return GUI; +} + +QString ALanCard::acceptable( void ) { + return ( GUI ) ? GUI->acceptable( ) : QString(); +} + +void ALanCard::commit( void ) { + if( GUI && GUI->commit( Data ) ) + setModified( 1 ); +} diff --git a/noncore/settings/networksettings2/lancard/lancard_NNI.h b/noncore/settings/networksettings2/lancard/lancard_NNI.h new file mode 100644 index 0000000..8fc8868 --- a/dev/null +++ b/noncore/settings/networksettings2/lancard/lancard_NNI.h @@ -0,0 +1,43 @@ +#ifndef LANCARD_H +#define LANCARD_H + +#include +#include "lancarddata.h" +#include "lancardrun.h" + +class LanCardNetNode; +class LanCardEdit; + +class ALanCard : public ANetNodeInstance { + +public : + + ALanCard( LanCardNetNode * PNN ); + + QWidget * edit( QWidget * parent ); + QString acceptable( void ); + void commit( void ); + + RuntimeInfo * runtime( void ) + { if( RT == 0 ) + RT = new LanCardRun( 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 : + + LanCardEdit * GUI; + LanCardData Data; + LanCardRun * RT; + +}; + +#endif diff --git a/noncore/settings/networksettings2/lancard/lancarddata.h b/noncore/settings/networksettings2/lancard/lancarddata.h new file mode 100644 index 0000000..c76767f --- a/dev/null +++ b/noncore/settings/networksettings2/lancard/lancarddata.h @@ -0,0 +1,13 @@ +#ifndef LANCARD_DATA_H +#define LANCARD_DATA_H + +#include +#include + +typedef struct LanCardData { + bool AnyLanCard; + QStringList HWAddresses; + +} LanCardData_t; + +#endif diff --git a/noncore/settings/networksettings2/lancard/lancardedit.cpp b/noncore/settings/networksettings2/lancard/lancardedit.cpp new file mode 100644 index 0000000..fa7f6dc --- a/dev/null +++ b/noncore/settings/networksettings2/lancard/lancardedit.cpp @@ -0,0 +1,95 @@ +#include +#include +#include +#include +#include +#include +#include "lancardedit.h" + +LanCardEdit::LanCardEdit( QWidget * Parent ) : LanCardGUI( Parent ){ + System & S = NSResources->system(); + QRegExp R( "eth[0-9]" ); + QCheckListItem * CLI; + + LanCards_LV->header()->hide(); + + // populate with all lancards in system + for( QDictIterator It(S.interfaces()); + It.current(); + ++It ) { + if( R.match( It.current()->Name ) >= 0 && + It.current()->CardType == ARPHRD_ETHER + ) { + CLI = new QCheckListItem( LanCards_LV, It.current()->Name, + QCheckListItem::CheckBox ); + CLI->setText( 1, It.current()->MACAddress ); + } + } +} + +QString LanCardEdit::acceptable( void ) { + return QString(); +} + + +bool LanCardEdit::commit( LanCardData & Data ) { + bool SM = 0; + CBM( Data.AnyLanCard, AnyCard_CB, SM ); + + if( ! Data.AnyLanCard ) { + // collect set of lancards that match + int idx; + QCheckListItem * CLI = (QCheckListItem *)LanCards_LV->firstChild(); + while( CLI ) { + idx = Data.HWAddresses.findIndex(CLI->text(1)); + if( CLI->isOn() ) { + if( idx < 0 ) { + // should be in list + Data.HWAddresses.append( CLI->text(1) ); + SM = 1; + } + } else { + // should not be in list + if( idx >= 0 ) { + Data.HWAddresses.remove( Data.HWAddresses.at(idx) ); + SM = 1; + } + } + CLI = (QCheckListItem *)CLI->nextSibling(); + } + } + return SM || ContainedObsoleteMAC ; +} + +void LanCardEdit::showData( LanCardData & Data ) { + AnyCard_CB->setChecked( Data.AnyLanCard ); + + QCheckListItem * CLI = (QCheckListItem *)LanCards_LV->firstChild(); + + ContainedObsoleteMAC = 0; + // remove obsolete address + for( QStringList::Iterator it=Data.HWAddresses.begin(); + it != Data.HWAddresses.end(); + ) { + CLI = (QCheckListItem *)LanCards_LV->firstChild(); + while( CLI ) { + if( CLI->text(1) == (*it) ) + // still valid + break; + CLI = (QCheckListItem *)CLI->nextSibling(); + } + if( CLI == 0 ) { + // address not found -> remove + ContainedObsoleteMAC = 1; + Data.HWAddresses.remove( it ); + } else { + ++ it; + } + } + + // set checks + while( CLI ) { + CLI->setOn( Data.HWAddresses.findIndex(CLI->text(1)) >= 0 ); + CLI = (QCheckListItem *)CLI->nextSibling(); + } +} diff --git a/noncore/settings/networksettings2/lancard/lancardedit.h b/noncore/settings/networksettings2/lancard/lancardedit.h new file mode 100644 index 0000000..8def789 --- a/dev/null +++ b/noncore/settings/networksettings2/lancard/lancardedit.h @@ -0,0 +1,16 @@ +#include "lancarddata.h" +#include "lancardGUI.h" + +class LanCardEdit : public LanCardGUI { + +public : + + LanCardEdit( QWidget * parent ); + QString acceptable( void ); + bool commit( LanCardData & Data ); + void showData( LanCardData & Data ); + +private : + + bool ContainedObsoleteMAC; +}; diff --git a/noncore/settings/networksettings2/lancard/lancardrun.cpp b/noncore/settings/networksettings2/lancard/lancardrun.cpp new file mode 100644 index 0000000..b3b592b --- a/dev/null +++ b/noncore/settings/networksettings2/lancard/lancardrun.cpp @@ -0,0 +1,158 @@ +#include +#include +#include +#include "lancardrun.h" + +void LanCardRun::detectState( NodeCollection * NC ) { + + // unavailable : no card found + // available : card found and assigned to us or free + // up : card found and assigned to us and up + + QString S = QString( "/tmp/profile-%1.up" ).arg(NC->number()); + System & Sys = NSResources->system(); + InterfaceInfo * Run; + + QFile F( S ); + + if( F.open( IO_ReadOnly ) ) { + // could open file -> read interface and assign + QString X; + QTextStream TS(&F); + X = TS.readLine(); + // find interface + if( handlesInterface( X ) ) { + for( QDictIterator It(Sys.interfaces()); + It.current(); + ++It ) { + Run = It.current(); + if( X == Run->Name ) { + Run->assignNode( netNode() ); + assignInterface( Run ); + NC->setCurrentState( IsUp ); + return; + } + } + } + } + + // we are certainly not UP + assignInterface( 0 ); + + // find possible interface + for( QDictIterator It(Sys.interfaces()); + It.current(); + ++It ) { + Run = It.current(); + if( handlesInterface( Run->Name ) && + Run->CardType == ARPHRD_ETHER && + ! Run->IsUp + ) { + // proper type, and Not UP -> free + NC->setCurrentState( Off ); + return; + } + } + // no free found + + NC->setCurrentState( Unavailable ); + +} + +bool LanCardRun::setState( NodeCollection * NC, Action_t A ) { + + // we only handle activate and deactivate + switch( A ) { + case Activate : + { + if( NC->currentState() != Off ) { + return 0; + } + InterfaceInfo * N = getInterface(); + if( ! N ) { + // no interface available + NC->setCurrentState( Unavailable ); + return 0; + } + // because we were OFF the interface + // we get back is NOT assigned + N->assignNode( netNode() ); + assignInterface( N ); + NC->setCurrentState( Available ); + return 1; + } + case Deactivate : + if( NC->currentState() == IsUp ) { + // bring down first + if( ! connection()->setState( Down ) ) + // could not ... + return 0; + } + if( NC->currentState() != Available ) { + return 1; + } + assignedInterface()->assignNode( 0 ); // release + assignInterface( 0 ); + NC->setCurrentState( Off ); + return 1; + default : + // FT + break; + } + return 0; +} + +bool LanCardRun::canSetState( State_t Curr, Action_t A ) { + // we only handle up down activate and deactivate + switch( A ) { + case Activate : + { // at least available + if( Curr == Available ) { + return 1; + } + // or we can make one available + InterfaceInfo * N = getInterface(); + if( ! N || N->assignedNode() != 0 ) { + // non available or assigned + return 0; + } + return 1; + } + case Deactivate : + return ( Curr >= Available ); + default : + // FT + break; + } + return 0; +} + +// get interface that is free or assigned to us +InterfaceInfo * LanCardRun::getInterface( void ) { + + System & S = NSResources->system(); + InterfaceInfo * best = 0, * Run; + + for( QDictIterator It(S.interfaces()); + It.current(); + ++It ) { + Run = It.current(); + if( handlesInterface( Run->Name ) && + Run->CardType == ARPHRD_ETHER + ) { + // this is a LAN card + if( Run->assignedNode() == netNode() ) { + // assigned to us + return Run; + } else if( Run->assignedNode() == 0 ) { + // free + best = Run; + } + } + } + return best; // can be 0 +} + +bool LanCardRun::handlesInterface( const QString & S ) { + return Pat.match( S ) >= 0; +} diff --git a/noncore/settings/networksettings2/lancard/lancardrun.h b/noncore/settings/networksettings2/lancard/lancardrun.h new file mode 100644 index 0000000..5f004e0 --- a/dev/null +++ b/noncore/settings/networksettings2/lancard/lancardrun.h @@ -0,0 +1,38 @@ +#ifndef LANCARDRUN_H +#define LANCARDRUN_H + +#include +#include +#include "lancarddata.h" + +class LanCardRun : public AsDevice { + +public : + + LanCardRun( ANetNodeInstance * NNI, + LanCardData & Data ) : AsDevice( NNI ), + Pat( "eth[0-9]" ) + { } + + virtual long count( void ) + { return 2; } + virtual QString genNic( long nr ) + { QString S; return S.sprintf( "eth%ld", nr ); } + virtual AsDevice * device( void ) + { return asDevice(); } + +protected : + + void detectState( NodeCollection * NC ); + bool setState( NodeCollection * NC, Action_t A ); + bool canSetState( State_t Curr, Action_t A ); + + bool handlesInterface( const QString & I ); + +private : + + InterfaceInfo * getInterface( void ); + QRegExp Pat; + +}; +#endif diff --git a/noncore/settings/networksettings2/modem/config.in b/noncore/settings/networksettings2/modem/config.in new file mode 100644 index 0000000..77a1c77 --- a/dev/null +++ b/noncore/settings/networksettings2/modem/config.in @@ -0,0 +1,4 @@ + config NS2MODEM + boolean "opie-networksettings2plugin-modem (set up DIALUP)" + default "n" if NS2 + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && NS2 && NS2CORE diff --git a/noncore/settings/networksettings2/modem/modem.pro b/noncore/settings/networksettings2/modem/modem.pro new file mode 100644 index 0000000..945486b --- a/dev/null +++ b/noncore/settings/networksettings2/modem/modem.pro @@ -0,0 +1,17 @@ +TEMPLATE = lib +CONFIG += qt warn_on release +DESTDIR = $(OPIEDIR)/plugins/networksettings2 +HEADERS = modem_NN.h \ + modem_NNI.h \ + modemedit.h +SOURCES = modem_NN.cpp \ + modem_NNI.cpp \ + modemedit.cpp +INCLUDEPATH += $(OPIEDIR)/include ../ ../networksettings2 +DEPENDPATH += $(OPIEDIR)/include ../ ../networksettings2 +LIBS += -lqpe +INTERFACES = modemGUI.ui +TARGET = modem +VERSION = 1.0.0 + +include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/settings/networksettings2/modem/modemGUI.ui b/noncore/settings/networksettings2/modem/modemGUI.ui new file mode 100644 index 0000000..328f95c --- a/dev/null +++ b/noncore/settings/networksettings2/modem/modemGUI.ui @@ -0,0 +1,131 @@ + +ModemGUI + + QWidget + + name + Modem_FRM + + + geometry + + 0 + 0 + 283 + 199 + + + + caption + Modem + + + layoutMargin + + + layoutSpacing + + + + margin + 2 + + + spacing + 2 + + + QLayoutWidget + + name + Layout4 + + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + TextLabel4 + + + text + Name + + + + QLineEdit + + name + Name_LE + + + + + + QLabel + + name + TextLabel3 + + + text + Description + + + + QMultiLineEdit + + name + Description_LE + + + + QLayoutWidget + + name + Layout5 + + + + margin + 0 + + + spacing + 6 + + + QCheckBox + + name + Automatic_CB + + + text + Start automatically + + + + QCheckBox + + name + Confirm_CB + + + text + Confirm before start + + + + + + + diff --git a/noncore/settings/networksettings2/modem/modem_NN.cpp b/noncore/settings/networksettings2/modem/modem_NN.cpp new file mode 100644 index 0000000..48e1ad8 --- a/dev/null +++ b/noncore/settings/networksettings2/modem/modem_NN.cpp @@ -0,0 +1,60 @@ +#include "modem_NN.h" +#include "modem_NNI.h" + +static const char * ModemNeeds[] = + { "line" + }; + +/** + * Constructor, find all of the possible interfaces + */ +ModemNetNode::ModemNetNode() : ANetNode() { +} + +/** + * Delete any interfaces that we own. + */ +ModemNetNode::~ModemNetNode(){ +} + +const QString ModemNetNode::nodeDescription(){ + return tr("\ +

Sets up a dialing procedures.

\ +

Use this to dial up over modems, ISDN, GSM, ...

\ +" +); +} + +ANetNodeInstance * ModemNetNode::createInstance( void ) { + return new AModem( this ); +} + +const char ** ModemNetNode::needs( void ) { + return ModemNeeds; +} + +const char * ModemNetNode::provides( void ) { + return "line"; +} + +bool ModemNetNode::generateProperFilesFor( + ANetNodeInstance * ) { + return 1; +} + +bool ModemNetNode::hasDataFor( const QString & ) { + return 0; +} + +bool ModemNetNode::generateDataForCommonFile( + SystemFile & , + long , + ANetNodeInstance * ) { + return 1; +} + +extern "C" { +void create_plugin( QList & PNN ) { + PNN.append( new ModemNetNode() ); +} +} diff --git a/noncore/settings/networksettings2/modem/modem_NN.h b/noncore/settings/networksettings2/modem/modem_NN.h new file mode 100644 index 0000000..0f4c124 --- a/dev/null +++ b/noncore/settings/networksettings2/modem/modem_NN.h @@ -0,0 +1,44 @@ +#ifndef MODEM_NETNODE_H +#define MODEM_NETNODE_H + +#include "netnode.h" + +class AModem; + +class ModemNetNode : public ANetNode{ + + Q_OBJECT + +public: + + ModemNetNode(); + virtual ~ModemNetNode(); + + virtual const QString pixmapName() + { return "modem"; } + + virtual const QString nodeName() + { return tr("Dialup modem"); } + + 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/modem/modem_NNI.cpp b/noncore/settings/networksettings2/modem/modem_NNI.cpp new file mode 100644 index 0000000..91df22b --- a/dev/null +++ b/noncore/settings/networksettings2/modem/modem_NNI.cpp @@ -0,0 +1,31 @@ +#include "modemedit.h" +#include "modem_NNI.h" +#include "modem_NN.h" + +AModem::AModem( ModemNetNode * PNN ) : ANetNodeInstance( PNN ) { + + GUI = 0; + RT = 0; +} + +void AModem::setSpecificAttribute( QString & , QString & ) { +} + +void AModem::saveSpecificAttribute( QTextStream & ) { +} + +QWidget * AModem::edit( QWidget * parent ) { + GUI = new ModemEdit( parent ); + GUI->showData( Data ); + return GUI; +} + +QString AModem::acceptable( void ) { + return ( GUI ) ? GUI->acceptable( ) : QString(); +} + +void AModem::commit( void ) { + if( GUI && GUI->commit( Data ) ) + setModified( 1 ); +} + diff --git a/noncore/settings/networksettings2/modem/modem_NNI.h b/noncore/settings/networksettings2/modem/modem_NNI.h new file mode 100644 index 0000000..7543e7d --- a/dev/null +++ b/noncore/settings/networksettings2/modem/modem_NNI.h @@ -0,0 +1,43 @@ +#ifndef Modem_H +#define Modem_H + +#include +#include "modemdata.h" +#include "modemrun.h" + +class ModemNetNode; +class ModemEdit; + +class AModem : public ANetNodeInstance { + +public : + + AModem( ModemNetNode * PNN ); + + QWidget * edit( QWidget * parent ); + QString acceptable( void ); + void commit( void ); + + RuntimeInfo * runtime( void ) + { if( RT == 0 ) + RT = new ModemRun( 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 : + + ModemEdit * GUI; + ModemData Data; + ModemRun * RT; + +}; + +#endif diff --git a/noncore/settings/networksettings2/modem/modemdata.h b/noncore/settings/networksettings2/modem/modemdata.h new file mode 100644 index 0000000..773cb77 --- a/dev/null +++ b/noncore/settings/networksettings2/modem/modemdata.h @@ -0,0 +1,17 @@ +#ifndef MODEM_DATA_H +#define MODEM_DATA_H + +#include +typedef struct ModemData { + QString Device; + QString LockFile; + long Speed; + short Parity; + short DataBits; + short StopBits; + bool HardwareControl; + bool SoftwareControl; + +} ModemData_t; + +#endif diff --git a/noncore/settings/networksettings2/modem/modemedit.cpp b/noncore/settings/networksettings2/modem/modemedit.cpp new file mode 100644 index 0000000..fd3d694 --- a/dev/null +++ b/noncore/settings/networksettings2/modem/modemedit.cpp @@ -0,0 +1,18 @@ +#include +#include "modemedit.h" + +ModemEdit::ModemEdit( QWidget * Parent ) : ModemGUI( Parent ){ + +} + +QString ModemEdit::acceptable( void ) { + return QString(); +} + +bool ModemEdit::commit( ModemData_t & Data ) { + return 0; +} + +void ModemEdit::showData( ModemData_t & Data ) { +} + diff --git a/noncore/settings/networksettings2/modem/modemedit.h b/noncore/settings/networksettings2/modem/modemedit.h new file mode 100644 index 0000000..56e2a82 --- a/dev/null +++ b/noncore/settings/networksettings2/modem/modemedit.h @@ -0,0 +1,12 @@ +#include "modemdata.h" +#include "modemGUI.h" + +class ModemEdit : public ModemGUI { + +public : + + ModemEdit( QWidget * parent ); + QString acceptable( void ); + bool commit( ModemData_t & Data ); + void showData( ModemData_t & Data ); +}; diff --git a/noncore/settings/networksettings2/modem/modemrun.h b/noncore/settings/networksettings2/modem/modemrun.h new file mode 100644 index 0000000..719ab2f --- a/dev/null +++ b/noncore/settings/networksettings2/modem/modemrun.h @@ -0,0 +1,22 @@ +#include +#include "modemdata.h" + +class ModemRun : public AsLine { + +public : + + ModemRun( ANetNodeInstance * NNI, + ModemData & Data ) : AsLine ( NNI ) + { } + +protected : + + void detectState( NodeCollection * ) + { } + + bool setState( NodeCollection *, Action_t ) + { return 0; } + + bool canSetState( State_t, Action_t ) + { return 0; } +}; -- cgit v0.9.0.2