author | wimpie <wimpie> | 2004-04-02 18:29:49 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2004-04-02 18:29:49 (UTC) |
commit | 5334b639c9f97793bcae4f50f7b47c7a2ada4e2f (patch) (side-by-side diff) | |
tree | f55aebd4314ab878bc39b6b08b8323a8ef78d803 /noncore/settings/networksettings2/vpn | |
parent | 7c8922b37b5bb7696c0ff2cbc999e2936b9b509f (diff) | |
download | opie-5334b639c9f97793bcae4f50f7b47c7a2ada4e2f.zip opie-5334b639c9f97793bcae4f50f7b47c7a2ada4e2f.tar.gz opie-5334b639c9f97793bcae4f50f7b47c7a2ada4e2f.tar.bz2 |
First import of NS2 app
Diffstat (limited to 'noncore/settings/networksettings2/vpn') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/vpn/config.in | 4 | ||||
-rw-r--r-- | noncore/settings/networksettings2/vpn/vpn.pro | 18 | ||||
-rw-r--r-- | noncore/settings/networksettings2/vpn/vpnGUI.cpp | 76 | ||||
-rw-r--r-- | noncore/settings/networksettings2/vpn/vpnGUI.h | 43 | ||||
-rw-r--r-- | noncore/settings/networksettings2/vpn/vpn_NN.cpp | 61 | ||||
-rw-r--r-- | noncore/settings/networksettings2/vpn/vpn_NN.h | 44 | ||||
-rw-r--r-- | noncore/settings/networksettings2/vpn/vpn_NNI.cpp | 30 | ||||
-rw-r--r-- | noncore/settings/networksettings2/vpn/vpn_NNI.h | 43 | ||||
-rw-r--r-- | noncore/settings/networksettings2/vpn/vpndata.h | 16 | ||||
-rw-r--r-- | noncore/settings/networksettings2/vpn/vpnedit.cpp | 18 | ||||
-rw-r--r-- | noncore/settings/networksettings2/vpn/vpnedit.h | 12 | ||||
-rw-r--r-- | noncore/settings/networksettings2/vpn/vpnrun.cpp | 6 | ||||
-rw-r--r-- | noncore/settings/networksettings2/vpn/vpnrun.h | 30 |
13 files changed, 401 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/vpn/config.in b/noncore/settings/networksettings2/vpn/config.in new file mode 100644 index 0000000..796f996 --- a/dev/null +++ b/noncore/settings/networksettings2/vpn/config.in @@ -0,0 +1,4 @@ + config NS2VPN + boolean "opie-networksettings2plugin-vpn (set up VPN)" + default "n" if NS2 + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && NS2 && NS2CORE diff --git a/noncore/settings/networksettings2/vpn/vpn.pro b/noncore/settings/networksettings2/vpn/vpn.pro new file mode 100644 index 0000000..81b4d08 --- a/dev/null +++ b/noncore/settings/networksettings2/vpn/vpn.pro @@ -0,0 +1,18 @@ +TEMPLATE = lib +CONFIG += qt warn_on release +DESTDIR = $(OPIEDIR)/plugins/networksettings2 +HEADERS = vpn_NN.h \ + vpn_NNI.h \ + vpnedit.h +SOURCES = vpn_NN.cpp \ + vpn_NNI.cpp \ + vpnedit.cpp \ + vpnrun.cpp +INCLUDEPATH += $(OPIEDIR)/include ../ ../networksettings2 +DEPENDPATH += $(OPIEDIR)/include ../ ../networksettings2 +LIBS += -lqpe +INTERFACES = vpnGUI.ui +TARGET = vpn +VERSION = 1.0.0 + +include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/settings/networksettings2/vpn/vpnGUI.cpp b/noncore/settings/networksettings2/vpn/vpnGUI.cpp new file mode 100644 index 0000000..708c92b --- a/dev/null +++ b/noncore/settings/networksettings2/vpn/vpnGUI.cpp @@ -0,0 +1,76 @@ +/**************************************************************************** +** Form implementation generated from reading ui file 'vpnGUI.ui' +** +** Created: Tue Mar 30 02:42:53 2004 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#include "vpnGUI.h" + +#include <qcheckbox.h> +#include <qlabel.h> +#include <qlineedit.h> +#include <qmultilineedit.h> +#include <qpushbutton.h> +#include <qlayout.h> +#include <qvariant.h> +#include <qtooltip.h> +#include <qwhatsthis.h> + +/* + * Constructs a VPNGUI which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' + */ +VPNGUI::VPNGUI( QWidget* parent, const char* name, WFlags fl ) + : QWidget( parent, name, fl ) +{ + if ( !name ) + setName( "VPN_FRM" ); + resize( 283, 199 ); + setCaption( tr( "VPN" ) ); + VPN_FRMLayout = new QVBoxLayout( this ); + VPN_FRMLayout->setSpacing( 2 ); + VPN_FRMLayout->setMargin( 2 ); + + Layout4 = new QHBoxLayout; + Layout4->setSpacing( 6 ); + Layout4->setMargin( 0 ); + + TextLabel4 = new QLabel( this, "TextLabel4" ); + TextLabel4->setText( tr( "Name" ) ); + Layout4->addWidget( TextLabel4 ); + + Name_LE = new QLineEdit( this, "Name_LE" ); + Layout4->addWidget( Name_LE ); + VPN_FRMLayout->addLayout( Layout4 ); + + TextLabel3 = new QLabel( this, "TextLabel3" ); + TextLabel3->setText( tr( "Description" ) ); + VPN_FRMLayout->addWidget( TextLabel3 ); + + Description_LE = new QMultiLineEdit( this, "Description_LE" ); + VPN_FRMLayout->addWidget( Description_LE ); + + Layout5 = new QHBoxLayout; + Layout5->setSpacing( 6 ); + Layout5->setMargin( 0 ); + + Automatic_CB = new QCheckBox( this, "Automatic_CB" ); + Automatic_CB->setText( tr( "Start automatically" ) ); + Layout5->addWidget( Automatic_CB ); + + Confirm_CB = new QCheckBox( this, "Confirm_CB" ); + Confirm_CB->setText( tr( "Confirm before start" ) ); + Layout5->addWidget( Confirm_CB ); + VPN_FRMLayout->addLayout( Layout5 ); +} + +/* + * Destroys the object and frees any allocated resources + */ +VPNGUI::~VPNGUI() +{ + // no need to delete child widgets, Qt does it all for us +} + diff --git a/noncore/settings/networksettings2/vpn/vpnGUI.h b/noncore/settings/networksettings2/vpn/vpnGUI.h new file mode 100644 index 0000000..fcc3e54 --- a/dev/null +++ b/noncore/settings/networksettings2/vpn/vpnGUI.h @@ -0,0 +1,43 @@ +/**************************************************************************** +** Form interface generated from reading ui file 'vpnGUI.ui' +** +** Created: Tue Mar 30 02:42:50 2004 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#ifndef VPN_FRM_H +#define VPN_FRM_H + +#include <qvariant.h> +#include <qwidget.h> +class QVBoxLayout; +class QHBoxLayout; +class QGridLayout; +class QCheckBox; +class QLabel; +class QLineEdit; +class QMultiLineEdit; + +class VPNGUI : public QWidget +{ + Q_OBJECT + +public: + VPNGUI( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~VPNGUI(); + + QLabel* TextLabel4; + QLineEdit* Name_LE; + QLabel* TextLabel3; + QMultiLineEdit* Description_LE; + QCheckBox* Automatic_CB; + QCheckBox* Confirm_CB; + +protected: + QVBoxLayout* VPN_FRMLayout; + QHBoxLayout* Layout4; + QHBoxLayout* Layout5; +}; + +#endif // VPN_FRM_H diff --git a/noncore/settings/networksettings2/vpn/vpn_NN.cpp b/noncore/settings/networksettings2/vpn/vpn_NN.cpp new file mode 100644 index 0000000..c800929 --- a/dev/null +++ b/noncore/settings/networksettings2/vpn/vpn_NN.cpp @@ -0,0 +1,61 @@ +#include "vpn_NN.h" +#include "vpn_NNI.h" + +static const char * VPNNeeds[] = + { "connection", + 0 + }; + +/** + * Constructor, find all of the possible interfaces + */ +VPNNetNode::VPNNetNode() : ANetNode() { +} + +/** + * Delete any interfaces that we own. + */ +VPNNetNode::~VPNNetNode(){ +} + +const QString VPNNetNode::nodeDescription(){ + return tr("\ +<p>Configure private IP connection.</p>\ +<p>Defines Secure tunnels over non secure IP sessions</p>\ +" +); +} + +ANetNodeInstance * VPNNetNode::createInstance( void ) { + return new AVPN( this ); +} + +const char ** VPNNetNode::needs( void ) { + return VPNNeeds; +} + +const char * VPNNetNode::provides( void ) { + return "connection"; +} + +bool VPNNetNode::generateProperFilesFor( + ANetNodeInstance * ) { + return 1; +} + +bool VPNNetNode::hasDataFor( const QString & ) { + return 0; +} + +bool VPNNetNode::generateDataForCommonFile( + SystemFile & , + long, + ANetNodeInstance * ) { + return 1; +} + +extern "C" { +void create_plugin( QList<ANetNode> & PNN ) { + PNN.append( new VPNNetNode() ); +} +} diff --git a/noncore/settings/networksettings2/vpn/vpn_NN.h b/noncore/settings/networksettings2/vpn/vpn_NN.h new file mode 100644 index 0000000..5718961 --- a/dev/null +++ b/noncore/settings/networksettings2/vpn/vpn_NN.h @@ -0,0 +1,44 @@ +#ifndef VPN_NETNODE_H +#define VPN_NETNODE_H + +#include "netnode.h" + +class AVPN; + +class VPNNetNode : public ANetNode{ + + Q_OBJECT + +public: + + VPNNetNode(); + virtual ~VPNNetNode(); + + virtual const QString pixmapName() + { return "vpn"; } + + virtual const QString nodeName() + { return tr("VPN 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<ANetNode> & PNN ); +}; + +#endif diff --git a/noncore/settings/networksettings2/vpn/vpn_NNI.cpp b/noncore/settings/networksettings2/vpn/vpn_NNI.cpp new file mode 100644 index 0000000..6c20aeb --- a/dev/null +++ b/noncore/settings/networksettings2/vpn/vpn_NNI.cpp @@ -0,0 +1,30 @@ +#include "vpnedit.h" +#include "vpn_NNI.h" +#include "vpn_NN.h" + +AVPN::AVPN( VPNNetNode * PNN ) : ANetNodeInstance( PNN ) { + GUI = 0; + RT = 0; +} + +void AVPN::setSpecificAttribute( QString & , QString & ) { +} + +void AVPN::saveSpecificAttribute( QTextStream & ) { +} + +QWidget * AVPN::edit( QWidget * parent ) { + GUI = new VPNEdit( parent ); + GUI->showData( Data ); + return GUI; +} + +QString AVPN::acceptable( void ) { + return ( GUI ) ? GUI->acceptable( ) : QString(); +} + +void AVPN::commit( void ) { + if( GUI && GUI->commit( Data ) ) + setModified( 1 ); +} + diff --git a/noncore/settings/networksettings2/vpn/vpn_NNI.h b/noncore/settings/networksettings2/vpn/vpn_NNI.h new file mode 100644 index 0000000..31ce0d6 --- a/dev/null +++ b/noncore/settings/networksettings2/vpn/vpn_NNI.h @@ -0,0 +1,43 @@ +#ifndef VPN_H +#define VPN_H + +#include <netnode.h> +#include "vpndata.h" +#include "vpnrun.h" + +class VPNNetNode; +class VPNEdit; + +class AVPN : public ANetNodeInstance { + +public : + + AVPN( VPNNetNode * PNN ); + + QWidget * edit( QWidget * parent ); + QString acceptable( void ); + void commit( void ); + + RuntimeInfo * runtime( void ) + { if( RT == 0 ) + RT = new VPNRun( 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 : + + VPNEdit * GUI; + VPNData Data; + VPNRun * RT; + +}; + +#endif diff --git a/noncore/settings/networksettings2/vpn/vpndata.h b/noncore/settings/networksettings2/vpn/vpndata.h new file mode 100644 index 0000000..5c986aa --- a/dev/null +++ b/noncore/settings/networksettings2/vpn/vpndata.h @@ -0,0 +1,16 @@ +#ifndef VPN_DATA_H +#define VPN_DATA_H + +#include <qstring.h> +typedef struct VPNData { + QString Device; + QString LockFile; + long Speed; + short Parity; + short DataBits; + short StopBits; + bool HardwareControl; + bool SoftwareControl; +} VPNData_t; + +#endif diff --git a/noncore/settings/networksettings2/vpn/vpnedit.cpp b/noncore/settings/networksettings2/vpn/vpnedit.cpp new file mode 100644 index 0000000..f336394 --- a/dev/null +++ b/noncore/settings/networksettings2/vpn/vpnedit.cpp @@ -0,0 +1,18 @@ +#include <GUIUtils.h> +#include "vpnedit.h" + + +VPNEdit::VPNEdit( QWidget * Parent ) : VPNGUI( Parent ){ + +} + +QString VPNEdit::acceptable( void ) { + return QString(); +} + +void VPNEdit::showData( VPNData_t & Data ) { +} + +bool VPNEdit::commit( VPNData_t & Data ) { + return 0; +} diff --git a/noncore/settings/networksettings2/vpn/vpnedit.h b/noncore/settings/networksettings2/vpn/vpnedit.h new file mode 100644 index 0000000..76480cd --- a/dev/null +++ b/noncore/settings/networksettings2/vpn/vpnedit.h @@ -0,0 +1,12 @@ +#include "vpndata.h" +#include "vpnGUI.h" + +class VPNEdit : public VPNGUI { + +public : + + VPNEdit( QWidget * parent ); + QString acceptable( void ); + bool commit( VPNData_t & Data ); + void showData( VPNData_t & Data ); +}; diff --git a/noncore/settings/networksettings2/vpn/vpnrun.cpp b/noncore/settings/networksettings2/vpn/vpnrun.cpp new file mode 100644 index 0000000..ab2966c --- a/dev/null +++ b/noncore/settings/networksettings2/vpn/vpnrun.cpp @@ -0,0 +1,6 @@ +#include "vpnrun.h" + +bool VPNRun::handlesInterface( const QString & ) { + // to be figured out + return 0; +} diff --git a/noncore/settings/networksettings2/vpn/vpnrun.h b/noncore/settings/networksettings2/vpn/vpnrun.h new file mode 100644 index 0000000..c221fd0 --- a/dev/null +++ b/noncore/settings/networksettings2/vpn/vpnrun.h @@ -0,0 +1,30 @@ +#ifndef VPNRUN_H +#define VPNRUN_H + +#include <asconnection.h> +#include "vpndata.h" + +class VPNRun : public AsConnection { + +public : + + VPNRun( ANetNodeInstance * NNI, VPNData & Data ) : + AsConnection( NNI ) + { } + +protected : + + void detectState( NodeCollection * ) + { } + + bool setState( NodeCollection *, Action_t ) + { return 0; } + + bool canSetState( State_t, Action_t ) + { return 0; } + + bool handlesInterface( const QString & I ); + +}; + +#endif |