author | wimpie <wimpie> | 2004-04-02 18:29:49 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2004-04-02 18:29:49 (UTC) |
commit | 5334b639c9f97793bcae4f50f7b47c7a2ada4e2f (patch) (unidiff) | |
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 @@ | |||
1 | config NS2VPN | ||
2 | boolean "opie-networksettings2plugin-vpn (set up VPN)" | ||
3 | default "n" if NS2 | ||
4 | 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 @@ | |||
1 | TEMPLATE = lib | ||
2 | CONFIG += qt warn_on release | ||
3 | DESTDIR = $(OPIEDIR)/plugins/networksettings2 | ||
4 | HEADERS = vpn_NN.h \ | ||
5 | vpn_NNI.h \ | ||
6 | vpnedit.h | ||
7 | SOURCES = vpn_NN.cpp \ | ||
8 | vpn_NNI.cpp \ | ||
9 | vpnedit.cpp \ | ||
10 | vpnrun.cpp | ||
11 | INCLUDEPATH+= $(OPIEDIR)/include ../ ../networksettings2 | ||
12 | DEPENDPATH+= $(OPIEDIR)/include ../ ../networksettings2 | ||
13 | LIBS += -lqpe | ||
14 | INTERFACES= vpnGUI.ui | ||
15 | TARGET = vpn | ||
16 | VERSION = 1.0.0 | ||
17 | |||
18 | 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 @@ | |||
1 | /**************************************************************************** | ||
2 | ** Form implementation generated from reading ui file 'vpnGUI.ui' | ||
3 | ** | ||
4 | ** Created: Tue Mar 30 02:42:53 2004 | ||
5 | ** by: The User Interface Compiler (uic) | ||
6 | ** | ||
7 | ** WARNING! All changes made in this file will be lost! | ||
8 | ****************************************************************************/ | ||
9 | #include "vpnGUI.h" | ||
10 | |||
11 | #include <qcheckbox.h> | ||
12 | #include <qlabel.h> | ||
13 | #include <qlineedit.h> | ||
14 | #include <qmultilineedit.h> | ||
15 | #include <qpushbutton.h> | ||
16 | #include <qlayout.h> | ||
17 | #include <qvariant.h> | ||
18 | #include <qtooltip.h> | ||
19 | #include <qwhatsthis.h> | ||
20 | |||
21 | /* | ||
22 | * Constructs a VPNGUI which is a child of 'parent', with the | ||
23 | * name 'name' and widget flags set to 'f' | ||
24 | */ | ||
25 | VPNGUI::VPNGUI( QWidget* parent, const char* name, WFlags fl ) | ||
26 | : QWidget( parent, name, fl ) | ||
27 | { | ||
28 | if ( !name ) | ||
29 | setName( "VPN_FRM" ); | ||
30 | resize( 283, 199 ); | ||
31 | setCaption( tr( "VPN" ) ); | ||
32 | VPN_FRMLayout = new QVBoxLayout( this ); | ||
33 | VPN_FRMLayout->setSpacing( 2 ); | ||
34 | VPN_FRMLayout->setMargin( 2 ); | ||
35 | |||
36 | Layout4 = new QHBoxLayout; | ||
37 | Layout4->setSpacing( 6 ); | ||
38 | Layout4->setMargin( 0 ); | ||
39 | |||
40 | TextLabel4 = new QLabel( this, "TextLabel4" ); | ||
41 | TextLabel4->setText( tr( "Name" ) ); | ||
42 | Layout4->addWidget( TextLabel4 ); | ||
43 | |||
44 | Name_LE = new QLineEdit( this, "Name_LE" ); | ||
45 | Layout4->addWidget( Name_LE ); | ||
46 | VPN_FRMLayout->addLayout( Layout4 ); | ||
47 | |||
48 | TextLabel3 = new QLabel( this, "TextLabel3" ); | ||
49 | TextLabel3->setText( tr( "Description" ) ); | ||
50 | VPN_FRMLayout->addWidget( TextLabel3 ); | ||
51 | |||
52 | Description_LE = new QMultiLineEdit( this, "Description_LE" ); | ||
53 | VPN_FRMLayout->addWidget( Description_LE ); | ||
54 | |||
55 | Layout5 = new QHBoxLayout; | ||
56 | Layout5->setSpacing( 6 ); | ||
57 | Layout5->setMargin( 0 ); | ||
58 | |||
59 | Automatic_CB = new QCheckBox( this, "Automatic_CB" ); | ||
60 | Automatic_CB->setText( tr( "Start automatically" ) ); | ||
61 | Layout5->addWidget( Automatic_CB ); | ||
62 | |||
63 | Confirm_CB = new QCheckBox( this, "Confirm_CB" ); | ||
64 | Confirm_CB->setText( tr( "Confirm before start" ) ); | ||
65 | Layout5->addWidget( Confirm_CB ); | ||
66 | VPN_FRMLayout->addLayout( Layout5 ); | ||
67 | } | ||
68 | |||
69 | /* | ||
70 | * Destroys the object and frees any allocated resources | ||
71 | */ | ||
72 | VPNGUI::~VPNGUI() | ||
73 | { | ||
74 | // no need to delete child widgets, Qt does it all for us | ||
75 | } | ||
76 | |||
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 @@ | |||
1 | /**************************************************************************** | ||
2 | ** Form interface generated from reading ui file 'vpnGUI.ui' | ||
3 | ** | ||
4 | ** Created: Tue Mar 30 02:42:50 2004 | ||
5 | ** by: The User Interface Compiler (uic) | ||
6 | ** | ||
7 | ** WARNING! All changes made in this file will be lost! | ||
8 | ****************************************************************************/ | ||
9 | #ifndef VPN_FRM_H | ||
10 | #define VPN_FRM_H | ||
11 | |||
12 | #include <qvariant.h> | ||
13 | #include <qwidget.h> | ||
14 | class QVBoxLayout; | ||
15 | class QHBoxLayout; | ||
16 | class QGridLayout; | ||
17 | class QCheckBox; | ||
18 | class QLabel; | ||
19 | class QLineEdit; | ||
20 | class QMultiLineEdit; | ||
21 | |||
22 | class VPNGUI : public QWidget | ||
23 | { | ||
24 | Q_OBJECT | ||
25 | |||
26 | public: | ||
27 | VPNGUI( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | ||
28 | ~VPNGUI(); | ||
29 | |||
30 | QLabel* TextLabel4; | ||
31 | QLineEdit* Name_LE; | ||
32 | QLabel* TextLabel3; | ||
33 | QMultiLineEdit* Description_LE; | ||
34 | QCheckBox* Automatic_CB; | ||
35 | QCheckBox* Confirm_CB; | ||
36 | |||
37 | protected: | ||
38 | QVBoxLayout* VPN_FRMLayout; | ||
39 | QHBoxLayout* Layout4; | ||
40 | QHBoxLayout* Layout5; | ||
41 | }; | ||
42 | |||
43 | #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 @@ | |||
1 | #include "vpn_NN.h" | ||
2 | #include "vpn_NNI.h" | ||
3 | |||
4 | static const char * VPNNeeds[] = | ||
5 | { "connection", | ||
6 | 0 | ||
7 | }; | ||
8 | |||
9 | /** | ||
10 | * Constructor, find all of the possible interfaces | ||
11 | */ | ||
12 | VPNNetNode::VPNNetNode() : ANetNode() { | ||
13 | } | ||
14 | |||
15 | /** | ||
16 | * Delete any interfaces that we own. | ||
17 | */ | ||
18 | VPNNetNode::~VPNNetNode(){ | ||
19 | } | ||
20 | |||
21 | const QString VPNNetNode::nodeDescription(){ | ||
22 | return tr("\ | ||
23 | <p>Configure private IP connection.</p>\ | ||
24 | <p>Defines Secure tunnels over non secure IP sessions</p>\ | ||
25 | " | ||
26 | ); | ||
27 | } | ||
28 | |||
29 | ANetNodeInstance * VPNNetNode::createInstance( void ) { | ||
30 | return new AVPN( this ); | ||
31 | } | ||
32 | |||
33 | const char ** VPNNetNode::needs( void ) { | ||
34 | return VPNNeeds; | ||
35 | } | ||
36 | |||
37 | const char * VPNNetNode::provides( void ) { | ||
38 | return "connection"; | ||
39 | } | ||
40 | |||
41 | bool VPNNetNode::generateProperFilesFor( | ||
42 | ANetNodeInstance * ) { | ||
43 | return 1; | ||
44 | } | ||
45 | |||
46 | bool VPNNetNode::hasDataFor( const QString & ) { | ||
47 | return 0; | ||
48 | } | ||
49 | |||
50 | bool VPNNetNode::generateDataForCommonFile( | ||
51 | SystemFile & , | ||
52 | long, | ||
53 | ANetNodeInstance * ) { | ||
54 | return 1; | ||
55 | } | ||
56 | |||
57 | extern "C" { | ||
58 | void create_plugin( QList<ANetNode> & PNN ) { | ||
59 | PNN.append( new VPNNetNode() ); | ||
60 | } | ||
61 | } | ||
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 @@ | |||
1 | #ifndef VPN_NETNODE_H | ||
2 | #define VPN_NETNODE_H | ||
3 | |||
4 | #include "netnode.h" | ||
5 | |||
6 | class AVPN; | ||
7 | |||
8 | class VPNNetNode : public ANetNode{ | ||
9 | |||
10 | Q_OBJECT | ||
11 | |||
12 | public: | ||
13 | |||
14 | VPNNetNode(); | ||
15 | virtual ~VPNNetNode(); | ||
16 | |||
17 | virtual const QString pixmapName() | ||
18 | { return "vpn"; } | ||
19 | |||
20 | virtual const QString nodeName() | ||
21 | { return tr("VPN Connection"); } | ||
22 | |||
23 | virtual const QString nodeDescription() ; | ||
24 | |||
25 | virtual ANetNodeInstance * createInstance( void ); | ||
26 | |||
27 | virtual const char ** needs( void ); | ||
28 | virtual const char * provides( void ); | ||
29 | |||
30 | virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); | ||
31 | virtual bool hasDataFor( const QString & S ); | ||
32 | virtual bool generateDataForCommonFile( | ||
33 | SystemFile & SF, long DevNr, ANetNodeInstance * NNI ); | ||
34 | |||
35 | private: | ||
36 | |||
37 | }; | ||
38 | |||
39 | extern "C" | ||
40 | { | ||
41 | void create_plugin( QList<ANetNode> & PNN ); | ||
42 | }; | ||
43 | |||
44 | #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 @@ | |||
1 | #include "vpnedit.h" | ||
2 | #include "vpn_NNI.h" | ||
3 | #include "vpn_NN.h" | ||
4 | |||
5 | AVPN::AVPN( VPNNetNode * PNN ) : ANetNodeInstance( PNN ) { | ||
6 | GUI = 0; | ||
7 | RT = 0; | ||
8 | } | ||
9 | |||
10 | void AVPN::setSpecificAttribute( QString & , QString & ) { | ||
11 | } | ||
12 | |||
13 | void AVPN::saveSpecificAttribute( QTextStream & ) { | ||
14 | } | ||
15 | |||
16 | QWidget * AVPN::edit( QWidget * parent ) { | ||
17 | GUI = new VPNEdit( parent ); | ||
18 | GUI->showData( Data ); | ||
19 | return GUI; | ||
20 | } | ||
21 | |||
22 | QString AVPN::acceptable( void ) { | ||
23 | return ( GUI ) ? GUI->acceptable( ) : QString(); | ||
24 | } | ||
25 | |||
26 | void AVPN::commit( void ) { | ||
27 | if( GUI && GUI->commit( Data ) ) | ||
28 | setModified( 1 ); | ||
29 | } | ||
30 | |||
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 @@ | |||
1 | #ifndef VPN_H | ||
2 | #define VPN_H | ||
3 | |||
4 | #include <netnode.h> | ||
5 | #include "vpndata.h" | ||
6 | #include "vpnrun.h" | ||
7 | |||
8 | class VPNNetNode; | ||
9 | class VPNEdit; | ||
10 | |||
11 | class AVPN : public ANetNodeInstance { | ||
12 | |||
13 | public : | ||
14 | |||
15 | AVPN( VPNNetNode * PNN ); | ||
16 | |||
17 | QWidget * edit( QWidget * parent ); | ||
18 | QString acceptable( void ); | ||
19 | void commit( void ); | ||
20 | |||
21 | RuntimeInfo * runtime( void ) | ||
22 | { if( RT == 0 ) | ||
23 | RT = new VPNRun( this, Data ); | ||
24 | return RT; | ||
25 | } | ||
26 | |||
27 | virtual void * data( void ) | ||
28 | { return (void *)&Data; } | ||
29 | |||
30 | protected : | ||
31 | |||
32 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); | ||
33 | virtual void saveSpecificAttribute( QTextStream & TS ); | ||
34 | |||
35 | private : | ||
36 | |||
37 | VPNEdit * GUI; | ||
38 | VPNData Data; | ||
39 | VPNRun * RT; | ||
40 | |||
41 | }; | ||
42 | |||
43 | #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 @@ | |||
1 | #ifndef VPN_DATA_H | ||
2 | #define VPN_DATA_H | ||
3 | |||
4 | #include <qstring.h> | ||
5 | typedef struct VPNData { | ||
6 | QString Device; | ||
7 | QString LockFile; | ||
8 | long Speed; | ||
9 | short Parity; | ||
10 | short DataBits; | ||
11 | short StopBits; | ||
12 | bool HardwareControl; | ||
13 | bool SoftwareControl; | ||
14 | } VPNData_t; | ||
15 | |||
16 | #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 @@ | |||
1 | #include <GUIUtils.h> | ||
2 | #include "vpnedit.h" | ||
3 | |||
4 | |||
5 | VPNEdit::VPNEdit( QWidget * Parent ) : VPNGUI( Parent ){ | ||
6 | |||
7 | } | ||
8 | |||
9 | QString VPNEdit::acceptable( void ) { | ||
10 | return QString(); | ||
11 | } | ||
12 | |||
13 | void VPNEdit::showData( VPNData_t & Data ) { | ||
14 | } | ||
15 | |||
16 | bool VPNEdit::commit( VPNData_t & Data ) { | ||
17 | return 0; | ||
18 | } | ||
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 @@ | |||
1 | #include "vpndata.h" | ||
2 | #include "vpnGUI.h" | ||
3 | |||
4 | class VPNEdit : public VPNGUI { | ||
5 | |||
6 | public : | ||
7 | |||
8 | VPNEdit( QWidget * parent ); | ||
9 | QString acceptable( void ); | ||
10 | bool commit( VPNData_t & Data ); | ||
11 | void showData( VPNData_t & Data ); | ||
12 | }; | ||
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 @@ | |||
1 | #include "vpnrun.h" | ||
2 | |||
3 | bool VPNRun::handlesInterface( const QString & ) { | ||
4 | // to be figured out | ||
5 | return 0; | ||
6 | } | ||
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 @@ | |||
1 | #ifndef VPNRUN_H | ||
2 | #define VPNRUN_H | ||
3 | |||
4 | #include <asconnection.h> | ||
5 | #include "vpndata.h" | ||
6 | |||
7 | class VPNRun : public AsConnection { | ||
8 | |||
9 | public : | ||
10 | |||
11 | VPNRun( ANetNodeInstance * NNI, VPNData & Data ) : | ||
12 | AsConnection( NNI ) | ||
13 | { } | ||
14 | |||
15 | protected : | ||
16 | |||
17 | void detectState( NodeCollection * ) | ||
18 | { } | ||
19 | |||
20 | bool setState( NodeCollection *, Action_t ) | ||
21 | { return 0; } | ||
22 | |||
23 | bool canSetState( State_t, Action_t ) | ||
24 | { return 0; } | ||
25 | |||
26 | bool handlesInterface( const QString & I ); | ||
27 | |||
28 | }; | ||
29 | |||
30 | #endif | ||