summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/profile
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/profile') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings2/profile/profile_NN.cpp13
-rw-r--r--noncore/settings/networksettings2/profile/profile_NN.h8
-rw-r--r--noncore/settings/networksettings2/profile/profile_NNI.cpp27
-rw-r--r--noncore/settings/networksettings2/profile/profile_NNI.h23
4 files changed, 35 insertions, 36 deletions
diff --git a/noncore/settings/networksettings2/profile/profile_NN.cpp b/noncore/settings/networksettings2/profile/profile_NN.cpp
index 59c34a3..945b48d 100644
--- a/noncore/settings/networksettings2/profile/profile_NN.cpp
+++ b/noncore/settings/networksettings2/profile/profile_NN.cpp
@@ -9,7 +9,7 @@ static const char * ProfileNeeds[] =
9/** 9/**
10 * Constructor, find all of the possible interfaces 10 * Constructor, find all of the possible interfaces
11 */ 11 */
12ProfileNetNode::ProfileNetNode() : ANetNode( tr("Regular profile")) { 12ProfileNetNode::ProfileNetNode() : ANetNode( tr("Regular connection profile")) {
13} 13}
14 14
15/** 15/**
@@ -38,17 +38,6 @@ const char * ProfileNetNode::provides( void ) {
38 return "fullsetup"; 38 return "fullsetup";
39} 39}
40 40
41bool ProfileNetNode::generateProperFilesFor(
42 ANetNodeInstance * ) {
43 return 0;
44}
45
46bool ProfileNetNode::generateDeviceDataForCommonFile(
47 SystemFile & ,
48 long ) {
49 return 0;
50}
51
52void ProfileNetNode::setSpecificAttribute( QString & , QString & ) { 41void ProfileNetNode::setSpecificAttribute( QString & , QString & ) {
53} 42}
54 43
diff --git a/noncore/settings/networksettings2/profile/profile_NN.h b/noncore/settings/networksettings2/profile/profile_NN.h
index e602bd7..1f1ee2c 100644
--- a/noncore/settings/networksettings2/profile/profile_NN.h
+++ b/noncore/settings/networksettings2/profile/profile_NN.h
@@ -18,18 +18,10 @@ public:
18 { return "Devices/commprofile"; } 18 { return "Devices/commprofile"; }
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 );
diff --git a/noncore/settings/networksettings2/profile/profile_NNI.cpp b/noncore/settings/networksettings2/profile/profile_NNI.cpp
index cb52b2a..f0f0b97 100644
--- a/noncore/settings/networksettings2/profile/profile_NNI.cpp
+++ b/noncore/settings/networksettings2/profile/profile_NNI.cpp
@@ -50,9 +50,28 @@ void AProfile::commit( void ) {
50 setModified( 1 ); 50 setModified( 1 );
51} 51}
52 52
53bool AProfile::generateDataForCommonFile( 53short AProfile::generateFileEmbedded( const QString & ID,
54 SystemFile & , 54 const QString & Path,
55 long) { 55 QTextStream & TS,
56 return 1; 56 long DevNr ) {
57
58 short rvl, rvd;
59
60 rvl = 1;
61
62 if( ID == "interfaces" ) {
63 Log(("Generate Profile for %s\n", ID.latin1() ));
64 if( Data.TriggerVPN ) {
65 // this profile triggers VPN -> insert trigger
66 TS << " up networksettings2 --triggervpn"
67 << endl;
68 rvl = 0;
69 }
57} 70}
71 rvd = ANetNodeInstance::generateFileEmbedded( ID, Path, TS, DevNr );
72 return (rvd == 2 || rvl == 2 ) ? 2 :
73 (rvd == 0 || rvl == 0 ) ? 0 : 1;
74}
75
76
58 77
diff --git a/noncore/settings/networksettings2/profile/profile_NNI.h b/noncore/settings/networksettings2/profile/profile_NNI.h
index 2c2db7f..957f4af 100644
--- a/noncore/settings/networksettings2/profile/profile_NNI.h
+++ b/noncore/settings/networksettings2/profile/profile_NNI.h
@@ -14,26 +14,25 @@ public :
14 14
15 AProfile( ProfileNetNode * PNN ); 15 AProfile( ProfileNetNode * PNN );
16 16
17 RuntimeInfo * runtime( void )
18 { return
19 ( RT ) ? RT : ( RT = new ProfileRun( 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 const QString & description( void )
22 { return Data.Description; }
23 RuntimeInfo * runtime( void )
24 { if( RT == 0 )
25 RT = new ProfileRun( this, Data );
26 return RT;
27 }
28
29 virtual void * data( void ) 26 virtual void * data( void )
30 { return (void *)&Data; } 27 { return (void *)&Data; }
31 28
32 virtual bool hasDataFor( const QString & ) 29 virtual short generateFileEmbedded( const QString & ID,
33 { return 0; } 30 const QString & Path,
31 QTextStream & TS,
32 long DevNr );
34 33
35 virtual bool generateDataForCommonFile( 34 const QString & description( void )
36 SystemFile & SF, long DevNr); 35 { return Data.Description; }
37 36
38protected : 37protected :
39 38