summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/vpn
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/vpn') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/vpn/vpn_NN.cpp14
-rw-r--r--noncore/settings/networksettings2/vpn/vpn_NN.h8
-rw-r--r--noncore/settings/networksettings2/vpn/vpn_NNI.cpp6
-rw-r--r--noncore/settings/networksettings2/vpn/vpn_NNI.h16
4 files changed, 7 insertions, 37 deletions
diff --git a/noncore/settings/networksettings2/vpn/vpn_NN.cpp b/noncore/settings/networksettings2/vpn/vpn_NN.cpp
index 6c7b308..9d3b6e7 100644
--- a/noncore/settings/networksettings2/vpn/vpn_NN.cpp
+++ b/noncore/settings/networksettings2/vpn/vpn_NN.cpp
@@ -1,18 +1,17 @@
1#include "vpn_NN.h" 1#include "vpn_NN.h"
2#include "vpn_NNI.h" 2#include "vpn_NNI.h"
3 3
4static const char * VPNNeeds[] = 4static const char * VPNNeeds[] =
5 { "connection", 5 { 0
6 0
7 }; 6 };
8 7
9/** 8/**
10 * Constructor, find all of the possible interfaces 9 * Constructor, find all of the possible interfaces
11 */ 10 */
12VPNNetNode::VPNNetNode() : ANetNode(tr("VPN Connection")) { 11VPNNetNode::VPNNetNode() : ANetNode(tr("VPN Connection")) {
13} 12}
14 13
15/** 14/**
16 * Delete any interfaces that we own. 15 * Delete any interfaces that we own.
17 */ 16 */
18VPNNetNode::~VPNNetNode(){ 17VPNNetNode::~VPNNetNode(){
@@ -29,34 +28,23 @@ const QString VPNNetNode::nodeDescription(){
29ANetNodeInstance * VPNNetNode::createInstance( void ) { 28ANetNodeInstance * VPNNetNode::createInstance( void ) {
30 return new AVPN( this ); 29 return new AVPN( this );
31} 30}
32 31
33const char ** VPNNetNode::needs( void ) { 32const char ** VPNNetNode::needs( void ) {
34 return VPNNeeds; 33 return VPNNeeds;
35} 34}
36 35
37const char * VPNNetNode::provides( void ) { 36const char * VPNNetNode::provides( void ) {
38 return "connection"; 37 return "connection";
39} 38}
40 39
41bool VPNNetNode::generateProperFilesFor(
42 ANetNodeInstance * ) {
43 return 0;
44}
45
46bool VPNNetNode::generateDeviceDataForCommonFile(
47 SystemFile & ,
48 long ) {
49 return 0;
50}
51
52void VPNNetNode::setSpecificAttribute( QString & , QString & ) { 40void VPNNetNode::setSpecificAttribute( QString & , QString & ) {
53} 41}
54 42
55void VPNNetNode::saveSpecificAttribute( QTextStream & ) { 43void VPNNetNode::saveSpecificAttribute( QTextStream & ) {
56} 44}
57 45
58extern "C" { 46extern "C" {
59void create_plugin( QList<ANetNode> & PNN ) { 47void create_plugin( QList<ANetNode> & PNN ) {
60 PNN.append( new VPNNetNode() ); 48 PNN.append( new VPNNetNode() );
61} 49}
62} 50}
diff --git a/noncore/settings/networksettings2/vpn/vpn_NN.h b/noncore/settings/networksettings2/vpn/vpn_NN.h
index 5b6632e..3c7b5e0 100644
--- a/noncore/settings/networksettings2/vpn/vpn_NN.h
+++ b/noncore/settings/networksettings2/vpn/vpn_NN.h
@@ -9,36 +9,28 @@ class VPNNetNode : public ANetNode{
9 9
10 Q_OBJECT 10 Q_OBJECT
11 11
12public: 12public:
13 13
14 VPNNetNode(); 14 VPNNetNode();
15 virtual ~VPNNetNode(); 15 virtual ~VPNNetNode();
16 16
17 virtual const QString pixmapName() 17 virtual const QString pixmapName()
18 { return "Devices/vpn"; } 18 { return "Devices/vpn"; }
19 19
20 virtual const QString nodeDescription() ; 20 virtual const QString nodeDescription() ;
21
22 virtual ANetNodeInstance * createInstance( void ); 21 virtual ANetNodeInstance * createInstance( void );
23
24 virtual const char ** needs( void ); 22 virtual const char ** needs( void );
25 virtual const char * provides( void ); 23 virtual const char * provides( void );
26 24
27 virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
28 virtual bool hasDataFor( const QString & )
29 { return 0; }
30 virtual bool generateDeviceDataForCommonFile(
31 SystemFile & SF, long DevNr );
32
33private: 25private:
34 26
35 virtual void setSpecificAttribute( QString & Attr, QString & Value ); 27 virtual void setSpecificAttribute( QString & Attr, QString & Value );
36 virtual void saveSpecificAttribute( QTextStream & TS ); 28 virtual void saveSpecificAttribute( QTextStream & TS );
37}; 29};
38 30
39extern "C" 31extern "C"
40{ 32{
41 void create_plugin( QList<ANetNode> & PNN ); 33 void create_plugin( QList<ANetNode> & PNN );
42}; 34};
43 35
44#endif 36#endif
diff --git a/noncore/settings/networksettings2/vpn/vpn_NNI.cpp b/noncore/settings/networksettings2/vpn/vpn_NNI.cpp
index ee999e8..6c20aeb 100644
--- a/noncore/settings/networksettings2/vpn/vpn_NNI.cpp
+++ b/noncore/settings/networksettings2/vpn/vpn_NNI.cpp
@@ -19,18 +19,12 @@ QWidget * AVPN::edit( QWidget * parent ) {
19 return GUI; 19 return GUI;
20} 20}
21 21
22QString AVPN::acceptable( void ) { 22QString AVPN::acceptable( void ) {
23 return ( GUI ) ? GUI->acceptable( ) : QString(); 23 return ( GUI ) ? GUI->acceptable( ) : QString();
24} 24}
25 25
26void AVPN::commit( void ) { 26void AVPN::commit( void ) {
27 if( GUI && GUI->commit( Data ) ) 27 if( GUI && GUI->commit( Data ) )
28 setModified( 1 ); 28 setModified( 1 );
29} 29}
30 30
31bool AVPN::generateDataForCommonFile(
32 SystemFile & ,
33 long) {
34 return 1;
35}
36
diff --git a/noncore/settings/networksettings2/vpn/vpn_NNI.h b/noncore/settings/networksettings2/vpn/vpn_NNI.h
index c3eb016..aee5891 100644
--- a/noncore/settings/networksettings2/vpn/vpn_NNI.h
+++ b/noncore/settings/networksettings2/vpn/vpn_NNI.h
@@ -5,41 +5,37 @@
5#include "vpndata.h" 5#include "vpndata.h"
6#include "vpnrun.h" 6#include "vpnrun.h"
7 7
8class VPNNetNode; 8class VPNNetNode;
9class VPNEdit; 9class VPNEdit;
10 10
11class AVPN : public ANetNodeInstance { 11class AVPN : public ANetNodeInstance {
12 12
13public : 13public :
14 14
15 AVPN( VPNNetNode * PNN ); 15 AVPN( VPNNetNode * PNN );
16 16
17 RuntimeInfo * runtime( void )
18 { return
19 ( RT ) ? RT : ( RT = new VPNRun( this, Data ) );
20 }
21
17 QWidget * edit( QWidget * parent ); 22 QWidget * edit( QWidget * parent );
18 QString acceptable( void ); 23 QString acceptable( void );
19 void commit( void ); 24 void commit( void );
20 25
21 RuntimeInfo * runtime( void )
22 { if( RT == 0 )
23 RT = new VPNRun( this, Data );
24 return RT;
25 }
26
27 virtual void * data( void ) 26 virtual void * data( void )
28 { return (void *)&Data; } 27 { return (void *)&Data; }
29 28
30 virtual bool hasDataFor( const QString & ) 29
31 { return 0; }
32 virtual bool generateDataForCommonFile(
33 SystemFile & SF, long DevNr );
34protected : 30protected :
35 31
36 virtual void setSpecificAttribute( QString & Attr, QString & Value ); 32 virtual void setSpecificAttribute( QString & Attr, QString & Value );
37 virtual void saveSpecificAttribute( QTextStream & TS ); 33 virtual void saveSpecificAttribute( QTextStream & TS );
38 34
39private : 35private :
40 36
41 VPNEdit * GUI; 37 VPNEdit * GUI;
42 VPNData Data; 38 VPNData Data;
43 VPNRun * RT; 39 VPNRun * RT;
44 40
45}; 41};