Diffstat (limited to 'noncore/settings/networksettings2/profile') (more/less context) (ignore whitespace changes)
4 files changed, 16 insertions, 17 deletions
diff --git a/noncore/settings/networksettings2/profile/profile_NN.cpp b/noncore/settings/networksettings2/profile/profile_NN.cpp index fcf1ca6..7609cdc 100644 --- a/noncore/settings/networksettings2/profile/profile_NN.cpp +++ b/noncore/settings/networksettings2/profile/profile_NN.cpp | |||
@@ -22,47 +22,35 @@ const QString ProfileNetNode::nodeDescription(){ | |||
22 | return tr("\ | 22 | return tr("\ |
23 | <p>Define use of an IP connection.</p>\ | 23 | <p>Define use of an IP connection.</p>\ |
24 | <p>Configure if and when this connection needs to be established</p>\ | 24 | <p>Configure if and when this connection needs to be established</p>\ |
25 | " | 25 | " |
26 | ); | 26 | ); |
27 | } | 27 | } |
28 | 28 | ||
29 | ANetNodeInstance * ProfileNetNode::createInstance( void ) { | 29 | ANetNodeInstance * ProfileNetNode::createInstance( void ) { |
30 | return new AProfile( this ); | 30 | return new AProfile( this ); |
31 | } | 31 | } |
32 | 32 | ||
33 | const char ** ProfileNetNode::needs( void ) { | 33 | const char ** ProfileNetNode::needs( void ) { |
34 | return ProfileNeeds; | 34 | return ProfileNeeds; |
35 | } | 35 | } |
36 | 36 | ||
37 | const char * ProfileNetNode::provides( void ) { | 37 | const char * ProfileNetNode::provides( void ) { |
38 | return "fullsetup"; | 38 | return "fullsetup"; |
39 | } | 39 | } |
40 | 40 | ||
41 | bool ProfileNetNode::generateProperFilesFor( | 41 | bool ProfileNetNode::generateProperFilesFor( |
42 | ANetNodeInstance * ) { | 42 | ANetNodeInstance * ) { |
43 | return 1; | 43 | return 1; |
44 | } | 44 | } |
45 | 45 | ||
46 | bool ProfileNetNode::hasDataFor( const QString &, bool ) { | ||
47 | return 0; | ||
48 | } | ||
49 | |||
50 | bool ProfileNetNode::generateDataForCommonFile( | ||
51 | SystemFile & , | ||
52 | long, | ||
53 | ANetNodeInstance * ) { | ||
54 | return 1; | ||
55 | } | ||
56 | |||
57 | bool ProfileNetNode::generateDeviceDataForCommonFile( | 46 | bool ProfileNetNode::generateDeviceDataForCommonFile( |
58 | SystemFile & , | 47 | SystemFile & , |
59 | long , | 48 | long ) { |
60 | ANetNodeInstance * ) { | ||
61 | return 1; | 49 | return 1; |
62 | } | 50 | } |
63 | 51 | ||
64 | extern "C" { | 52 | extern "C" { |
65 | void create_plugin( QList<ANetNode> & PNN ) { | 53 | void create_plugin( QList<ANetNode> & PNN ) { |
66 | PNN.append( new ProfileNetNode() ); | 54 | PNN.append( new ProfileNetNode() ); |
67 | } | 55 | } |
68 | } | 56 | } |
diff --git a/noncore/settings/networksettings2/profile/profile_NN.h b/noncore/settings/networksettings2/profile/profile_NN.h index b64a6dd..f7c2b22 100644 --- a/noncore/settings/networksettings2/profile/profile_NN.h +++ b/noncore/settings/networksettings2/profile/profile_NN.h | |||
@@ -7,40 +7,39 @@ class AProfile; | |||
7 | 7 | ||
8 | class ProfileNetNode : public ANetNode{ | 8 | class ProfileNetNode : public ANetNode{ |
9 | 9 | ||
10 | Q_OBJECT | 10 | Q_OBJECT |
11 | 11 | ||
12 | public: | 12 | public: |
13 | 13 | ||
14 | ProfileNetNode(); | 14 | ProfileNetNode(); |
15 | virtual ~ProfileNetNode(); | 15 | virtual ~ProfileNetNode(); |
16 | 16 | ||
17 | virtual const QString pixmapName() | 17 | virtual const QString pixmapName() |
18 | { return "Devices/commprofile"; } | 18 | { return "Devices/commprofile"; } |
19 | 19 | ||
20 | virtual const QString nodeName() | 20 | virtual const QString nodeName() |
21 | { return tr("Regular profile"); } | 21 | { return tr("Regular profile"); } |
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); |
36 | 35 | ||
37 | private: | 36 | private: |
38 | 37 | ||
39 | }; | 38 | }; |
40 | 39 | ||
41 | extern "C" | 40 | extern "C" |
42 | { | 41 | { |
43 | void create_plugin( QList<ANetNode> & PNN ); | 42 | void create_plugin( QList<ANetNode> & PNN ); |
44 | }; | 43 | }; |
45 | 44 | ||
46 | #endif | 45 | #endif |
diff --git a/noncore/settings/networksettings2/profile/profile_NNI.cpp b/noncore/settings/networksettings2/profile/profile_NNI.cpp index bc0118e..5b54aa4 100644 --- a/noncore/settings/networksettings2/profile/profile_NNI.cpp +++ b/noncore/settings/networksettings2/profile/profile_NNI.cpp | |||
@@ -25,24 +25,30 @@ void AProfile::setSpecificAttribute( QString & Attr, QString & Value ) { | |||
25 | } | 25 | } |
26 | 26 | ||
27 | void AProfile::saveSpecificAttribute( QTextStream & TS ) { | 27 | void AProfile::saveSpecificAttribute( QTextStream & TS ) { |
28 | TS << "automatic=" << ((Data.Automatic) ? "yes" : "no") << endl; | 28 | TS << "automatic=" << ((Data.Automatic) ? "yes" : "no") << endl; |
29 | TS << "preconfirm=" << ((Data.Confirm) ? "yes" : "no") << endl; | 29 | TS << "preconfirm=" << ((Data.Confirm) ? "yes" : "no") << endl; |
30 | TS << "disabled=" << ((Data.Disabled) ? "yes" : "no") << endl; | 30 | TS << "disabled=" << ((Data.Disabled) ? "yes" : "no") << endl; |
31 | TS << "description=" << Data.Description << endl; | 31 | TS << "description=" << Data.Description << endl; |
32 | } | 32 | } |
33 | 33 | ||
34 | QWidget * AProfile::edit( QWidget * parent ) { | 34 | QWidget * AProfile::edit( QWidget * parent ) { |
35 | GUI = new ProfileEdit( parent, this ); | 35 | GUI = new ProfileEdit( parent, this ); |
36 | GUI->showData( Data ); | 36 | GUI->showData( Data ); |
37 | return GUI; | 37 | return GUI; |
38 | } | 38 | } |
39 | 39 | ||
40 | QString AProfile::acceptable( void ) { | 40 | QString AProfile::acceptable( void ) { |
41 | return ( GUI ) ? GUI->acceptable( ) : QString(); | 41 | return ( GUI ) ? GUI->acceptable( ) : QString(); |
42 | } | 42 | } |
43 | 43 | ||
44 | void AProfile::commit( void ) { | 44 | void AProfile::commit( void ) { |
45 | if( GUI && GUI->commit( Data ) ) | 45 | if( GUI && GUI->commit( Data ) ) |
46 | setModified( 1 ); | 46 | setModified( 1 ); |
47 | } | 47 | } |
48 | 48 | ||
49 | bool AProfile::generateDataForCommonFile( | ||
50 | SystemFile & , | ||
51 | long) { | ||
52 | return 1; | ||
53 | } | ||
54 | |||
diff --git a/noncore/settings/networksettings2/profile/profile_NNI.h b/noncore/settings/networksettings2/profile/profile_NNI.h index dfeb178..2c2db7f 100644 --- a/noncore/settings/networksettings2/profile/profile_NNI.h +++ b/noncore/settings/networksettings2/profile/profile_NNI.h | |||
@@ -8,38 +8,44 @@ | |||
8 | class ProfileNetNode; | 8 | class ProfileNetNode; |
9 | class ProfileEdit; | 9 | class ProfileEdit; |
10 | 10 | ||
11 | class AProfile : public ANetNodeInstance { | 11 | class AProfile : public ANetNodeInstance { |
12 | 12 | ||
13 | public : | 13 | public : |
14 | 14 | ||
15 | AProfile( ProfileNetNode * PNN ); | 15 | AProfile( ProfileNetNode * 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 | const QString & description( void ) | 21 | const QString & description( void ) |
22 | { return Data.Description; } | 22 | { return Data.Description; } |
23 | RuntimeInfo * runtime( void ) | 23 | RuntimeInfo * runtime( void ) |
24 | { if( RT == 0 ) | 24 | { if( RT == 0 ) |
25 | RT = new ProfileRun( this, Data ); | 25 | RT = new ProfileRun( this, Data ); |
26 | return RT; | 26 | return RT; |
27 | } | 27 | } |
28 | 28 | ||
29 | virtual void * data( void ) | 29 | virtual void * data( void ) |
30 | { return (void *)&Data; } | 30 | { return (void *)&Data; } |
31 | 31 | ||
32 | virtual bool hasDataFor( const QString & ) | ||
33 | { return 0; } | ||
34 | |||
35 | virtual bool generateDataForCommonFile( | ||
36 | SystemFile & SF, long DevNr); | ||
37 | |||
32 | protected : | 38 | protected : |
33 | 39 | ||
34 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); | 40 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); |
35 | virtual void saveSpecificAttribute( QTextStream & TS ); | 41 | virtual void saveSpecificAttribute( QTextStream & TS ); |
36 | 42 | ||
37 | private : | 43 | private : |
38 | 44 | ||
39 | ProfileEdit * GUI; | 45 | ProfileEdit * GUI; |
40 | ProfileData Data; | 46 | ProfileData Data; |
41 | ProfileRun * RT; | 47 | ProfileRun * RT; |
42 | 48 | ||
43 | }; | 49 | }; |
44 | 50 | ||
45 | #endif | 51 | #endif |