Diffstat (limited to 'noncore/settings/networksettings2/ppp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/ppp/ppp_NN.cpp | 17 | ||||
-rw-r--r-- | noncore/settings/networksettings2/ppp/ppp_NN.h | 9 | ||||
-rw-r--r-- | noncore/settings/networksettings2/ppp/ppp_NNI.cpp | 6 | ||||
-rw-r--r-- | noncore/settings/networksettings2/ppp/ppp_NNI.h | 5 | ||||
-rw-r--r-- | noncore/settings/networksettings2/ppp/ppprun.h | 2 |
5 files changed, 21 insertions, 18 deletions
diff --git a/noncore/settings/networksettings2/ppp/ppp_NN.cpp b/noncore/settings/networksettings2/ppp/ppp_NN.cpp index 51d17ec..b3f70c5 100644 --- a/noncore/settings/networksettings2/ppp/ppp_NN.cpp +++ b/noncore/settings/networksettings2/ppp/ppp_NN.cpp | |||
@@ -23,47 +23,40 @@ const QString PPPNetNode::nodeDescription(){ | |||
23 | return tr("\ | 23 | return tr("\ |
24 | <p>Sets up IP using PPP.</p>\ | 24 | <p>Sets up IP using PPP.</p>\ |
25 | <p>Use this for dialup devices or serial setups</p>\ | 25 | <p>Use this for dialup devices or serial setups</p>\ |
26 | " | 26 | " |
27 | ); | 27 | ); |
28 | } | 28 | } |
29 | 29 | ||
30 | ANetNodeInstance * PPPNetNode::createInstance( void ) { | 30 | ANetNodeInstance * PPPNetNode::createInstance( void ) { |
31 | return new APPP( this ); | 31 | return new APPP( this ); |
32 | } | 32 | } |
33 | 33 | ||
34 | const char ** PPPNetNode::needs( void ) { | 34 | const char ** PPPNetNode::needs( void ) { |
35 | return PPPNeeds; | 35 | return PPPNeeds; |
36 | } | 36 | } |
37 | 37 | ||
38 | const char * PPPNetNode::provides( void ) { | 38 | const char * PPPNetNode::provides( void ) { |
39 | return "connection"; | 39 | return "connection"; |
40 | } | 40 | } |
41 | 41 | ||
42 | bool PPPNetNode::generateProperFilesFor( | 42 | bool PPPNetNode::generateProperFilesFor( |
43 | ANetNodeInstance * ) { | 43 | ANetNodeInstance * ) { |
44 | return 1; | 44 | return 1; |
45 | } | 45 | } |
46 | 46 | ||
47 | bool PPPNetNode::hasDataFor( const QString &, bool ) { | 47 | bool PPPNetNode::generateDeviceDataForCommonFile( |
48 | return 0; | ||
49 | } | ||
50 | |||
51 | bool PPPNetNode::generateDataForCommonFile( | ||
52 | SystemFile & , | 48 | SystemFile & , |
53 | long, | 49 | long ) { |
54 | ANetNodeInstance * ) { | ||
55 | return 1; | 50 | return 1; |
56 | } | 51 | } |
57 | 52 | ||
58 | bool PPPNetNode::generateDeviceDataForCommonFile( | 53 | QString PPPNetNode::genNic( long NicNr ) { |
59 | SystemFile & , | 54 | QString S; |
60 | long , | 55 | return S.sprintf( "ppp%ld", NicNr ); |
61 | ANetNodeInstance * ) { | ||
62 | return 1; | ||
63 | } | 56 | } |
64 | 57 | ||
65 | extern "C" { | 58 | extern "C" { |
66 | void create_plugin( QList<ANetNode> & PNN ) { | 59 | void create_plugin( QList<ANetNode> & PNN ) { |
67 | PNN.append( new PPPNetNode() ); | 60 | PNN.append( new PPPNetNode() ); |
68 | } | 61 | } |
69 | } | 62 | } |
diff --git a/noncore/settings/networksettings2/ppp/ppp_NN.h b/noncore/settings/networksettings2/ppp/ppp_NN.h index 8d56e7f..c33f281 100644 --- a/noncore/settings/networksettings2/ppp/ppp_NN.h +++ b/noncore/settings/networksettings2/ppp/ppp_NN.h | |||
@@ -7,40 +7,41 @@ class APPP; | |||
7 | 7 | ||
8 | class PPPNetNode : public ANetNode{ | 8 | class PPPNetNode : public ANetNode{ |
9 | 9 | ||
10 | Q_OBJECT | 10 | Q_OBJECT |
11 | 11 | ||
12 | public: | 12 | public: |
13 | 13 | ||
14 | PPPNetNode(); | 14 | PPPNetNode(); |
15 | virtual ~PPPNetNode(); | 15 | virtual ~PPPNetNode(); |
16 | 16 | ||
17 | virtual const QString pixmapName() | 17 | virtual const QString pixmapName() |
18 | { return "Devices/ppp"; } | 18 | { return "Devices/ppp"; } |
19 | 19 | ||
20 | virtual const QString nodeName() | 20 | virtual const QString nodeName() |
21 | { return tr("PPP Connection"); } | 21 | { return tr("PPP Connection"); } |
22 | 22 | ||
23 | virtual const QString nodeDescription() ; | 23 | virtual const QString nodeDescription() ; |
24 | 24 | ||
25 | virtual ANetNodeInstance * createInstance( void ); | 25 | virtual ANetNodeInstance * createInstance( void ); |
26 | 26 | ||
27 | virtual const char ** needs( void ); | 27 | virtual const char ** needs( void ); |
28 | virtual const char * provides( void ); | 28 | virtual const char * provides( void ); |
29 | 29 | ||
30 | virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); | 30 | virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); |
31 | virtual bool hasDataFor( const QString & S, bool DS ); | 31 | virtual bool hasDataFor( const QString & ) |
32 | virtual bool generateDataForCommonFile( | 32 | { return 0; } |
33 | SystemFile & SF, long DevNr, ANetNodeInstance * NNI ); | ||
34 | virtual bool generateDeviceDataForCommonFile( | 33 | virtual bool generateDeviceDataForCommonFile( |
35 | SystemFile & SF, long DevNr, ANetNodeInstance * NNI ); | 34 | SystemFile & SF, long DevNr ); |
35 | |||
36 | virtual QString genNic( long NicNr ); | ||
36 | 37 | ||
37 | private: | 38 | private: |
38 | 39 | ||
39 | }; | 40 | }; |
40 | 41 | ||
41 | extern "C" | 42 | extern "C" |
42 | { | 43 | { |
43 | void create_plugin( QList<ANetNode> & PNN ); | 44 | void create_plugin( QList<ANetNode> & PNN ); |
44 | }; | 45 | }; |
45 | 46 | ||
46 | #endif | 47 | #endif |
diff --git a/noncore/settings/networksettings2/ppp/ppp_NNI.cpp b/noncore/settings/networksettings2/ppp/ppp_NNI.cpp index d09ecf9..d0fd31c 100644 --- a/noncore/settings/networksettings2/ppp/ppp_NNI.cpp +++ b/noncore/settings/networksettings2/ppp/ppp_NNI.cpp | |||
@@ -92,24 +92,30 @@ void APPP::saveSpecificAttribute( QTextStream & TS ) { | |||
92 | TS << "ipautomatic=" << ( ( Data.IP.IPAutomatic ) ? "yes" : "no" ) << endl; | 92 | TS << "ipautomatic=" << ( ( Data.IP.IPAutomatic ) ? "yes" : "no" ) << endl; |
93 | TS << "gwautomatic=" << ( ( Data.IP.GWAutomatic ) ? "yes" : "no" ) << endl; | 93 | TS << "gwautomatic=" << ( ( Data.IP.GWAutomatic ) ? "yes" : "no" ) << endl; |
94 | TS << "gwisdefault=" << ( ( Data.IP.GWIsDefault ) ? "yes" : "no" ) << endl; | 94 | TS << "gwisdefault=" << ( ( Data.IP.GWIsDefault ) ? "yes" : "no" ) << endl; |
95 | TS << "ipaddress=" << Data.IP.IPAddress << endl; | 95 | TS << "ipaddress=" << Data.IP.IPAddress << endl; |
96 | TS << "ipsubmask=" << Data.IP.IPSubMask << endl; | 96 | TS << "ipsubmask=" << Data.IP.IPSubMask << endl; |
97 | TS << "gwaddress=" << Data.IP.GWAddress << endl; | 97 | TS << "gwaddress=" << Data.IP.GWAddress << endl; |
98 | } | 98 | } |
99 | 99 | ||
100 | QWidget * APPP::edit( QWidget * parent ) { | 100 | QWidget * APPP::edit( QWidget * parent ) { |
101 | GUI = new PPPEdit( parent ); | 101 | GUI = new PPPEdit( parent ); |
102 | GUI->showData( Data ); | 102 | GUI->showData( Data ); |
103 | return GUI; | 103 | return GUI; |
104 | } | 104 | } |
105 | 105 | ||
106 | QString APPP::acceptable( void ) { | 106 | QString APPP::acceptable( void ) { |
107 | return ( GUI ) ? GUI->acceptable( ) : QString(); | 107 | return ( GUI ) ? GUI->acceptable( ) : QString(); |
108 | } | 108 | } |
109 | 109 | ||
110 | void APPP::commit( void ) { | 110 | void APPP::commit( void ) { |
111 | if( GUI && GUI->commit( Data ) ) { | 111 | if( GUI && GUI->commit( Data ) ) { |
112 | setModified( 1 ); | 112 | setModified( 1 ); |
113 | } | 113 | } |
114 | } | 114 | } |
115 | 115 | ||
116 | bool APPP::generateDataForCommonFile( | ||
117 | SystemFile & , | ||
118 | long) { | ||
119 | return 1; | ||
120 | } | ||
121 | |||
diff --git a/noncore/settings/networksettings2/ppp/ppp_NNI.h b/noncore/settings/networksettings2/ppp/ppp_NNI.h index a17721a..989c2f0 100644 --- a/noncore/settings/networksettings2/ppp/ppp_NNI.h +++ b/noncore/settings/networksettings2/ppp/ppp_NNI.h | |||
@@ -6,38 +6,43 @@ | |||
6 | #include "ppprun.h" | 6 | #include "ppprun.h" |
7 | 7 | ||
8 | class PPPNetNode; | 8 | class PPPNetNode; |
9 | class PPPEdit; | 9 | class PPPEdit; |
10 | 10 | ||
11 | class APPP : public ANetNodeInstance { | 11 | class APPP : public ANetNodeInstance { |
12 | 12 | ||
13 | public : | 13 | public : |
14 | 14 | ||
15 | APPP( PPPNetNode * PNN ); | 15 | APPP( PPPNetNode * PNN ); |
16 | 16 | ||
17 | QWidget * edit( QWidget * parent ); | 17 | QWidget * edit( QWidget * parent ); |
18 | QString acceptable( void ); | 18 | QString acceptable( void ); |
19 | void commit( void ); | 19 | void commit( void ); |
20 | 20 | ||
21 | RuntimeInfo * runtime( void ) | 21 | RuntimeInfo * runtime( void ) |
22 | { if( RT == 0 ) | 22 | { if( RT == 0 ) |
23 | RT = new PPPRun( this, Data ); | 23 | RT = new PPPRun( this, Data ); |
24 | return RT->runtimeInfo(); | 24 | return RT->runtimeInfo(); |
25 | } | 25 | } |
26 | 26 | ||
27 | virtual void * data( void ) | 27 | virtual void * data( void ) |
28 | { return (void *)&Data; } | 28 | { return (void *)&Data; } |
29 | 29 | ||
30 | virtual bool hasDataFor( const QString & ) | ||
31 | { return 0; } | ||
32 | |||
33 | virtual bool generateDataForCommonFile( | ||
34 | SystemFile & SF, long DevNr ); | ||
30 | protected : | 35 | protected : |
31 | 36 | ||
32 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); | 37 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); |
33 | virtual void saveSpecificAttribute( QTextStream & TS ); | 38 | virtual void saveSpecificAttribute( QTextStream & TS ); |
34 | 39 | ||
35 | private : | 40 | private : |
36 | 41 | ||
37 | PPPEdit * GUI; | 42 | PPPEdit * GUI; |
38 | PPPData Data; | 43 | PPPData Data; |
39 | PPPRun * RT; | 44 | PPPRun * RT; |
40 | 45 | ||
41 | }; | 46 | }; |
42 | 47 | ||
43 | #endif | 48 | #endif |
diff --git a/noncore/settings/networksettings2/ppp/ppprun.h b/noncore/settings/networksettings2/ppp/ppprun.h index 765aff2..af51fbe 100644 --- a/noncore/settings/networksettings2/ppp/ppprun.h +++ b/noncore/settings/networksettings2/ppp/ppprun.h | |||
@@ -1,40 +1,38 @@ | |||
1 | #ifndef PPPRUN_H | 1 | #ifndef PPPRUN_H |
2 | #define PPPRUN_H | 2 | #define PPPRUN_H |
3 | 3 | ||
4 | #include <qregexp.h> | 4 | #include <qregexp.h> |
5 | #include <asconnection.h> | 5 | #include <asconnection.h> |
6 | #include <asdevice.h> | 6 | #include <asdevice.h> |
7 | #include "pppdata.h" | 7 | #include "pppdata.h" |
8 | 8 | ||
9 | class PPPRun : public AsConnection, public AsDevice { | 9 | class PPPRun : public AsConnection, public AsDevice { |
10 | 10 | ||
11 | public : | 11 | public : |
12 | 12 | ||
13 | PPPRun( ANetNodeInstance * NNI, | 13 | PPPRun( ANetNodeInstance * NNI, |
14 | PPPData & Data ); | 14 | PPPData & Data ); |
15 | virtual QString genNic( long NicNr ) | ||
16 | { QString S; return S.sprintf( "ppp%ld", NicNr ); } | ||
17 | 15 | ||
18 | virtual AsDevice * asDevice( void ) | 16 | virtual AsDevice * asDevice( void ) |
19 | { return (AsDevice *)this; } | 17 | { return (AsDevice *)this; } |
20 | virtual AsConnection * asConnection( void ) | 18 | virtual AsConnection * asConnection( void ) |
21 | { return (AsConnection *)this; } | 19 | { return (AsConnection *)this; } |
22 | 20 | ||
23 | virtual AsDevice * device( void ) | 21 | virtual AsDevice * device( void ) |
24 | { return (AsDevice *)this; } | 22 | { return (AsDevice *)this; } |
25 | 23 | ||
26 | virtual RuntimeInfo * runtimeInfo( void ) | 24 | virtual RuntimeInfo * runtimeInfo( void ) |
27 | { return ( AsConnection *)this; } | 25 | { return ( AsConnection *)this; } |
28 | 26 | ||
29 | protected : | 27 | protected : |
30 | 28 | ||
31 | void detectState( NodeCollection * NC ); | 29 | void detectState( NodeCollection * NC ); |
32 | bool setState( NodeCollection * NC, Action_t A ); | 30 | bool setState( NodeCollection * NC, Action_t A ); |
33 | bool canSetState( State_t S, Action_t A ) | 31 | bool canSetState( State_t S, Action_t A ) |
34 | { return AsDevice::connection()->findNext( | 32 | { return AsDevice::connection()->findNext( |
35 | AsDevice::netNode() )->runtime()->canSetState( S,A ); } | 33 | AsDevice::netNode() )->runtime()->canSetState( S,A ); } |
36 | 34 | ||
37 | bool handlesInterface( const QString & I ); | 35 | bool handlesInterface( const QString & I ); |
38 | 36 | ||
39 | private : | 37 | private : |
40 | 38 | ||