summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/profile/profile_NNI.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/profile/profile_NNI.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/profile/profile_NNI.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/noncore/settings/networksettings2/profile/profile_NNI.cpp b/noncore/settings/networksettings2/profile/profile_NNI.cpp
index f0f0b97..a1e1254 100644
--- a/noncore/settings/networksettings2/profile/profile_NNI.cpp
+++ b/noncore/settings/networksettings2/profile/profile_NNI.cpp
@@ -1,12 +1,13 @@
1#include <opie2/odebug.h>
1#include "profileedit.h" 2#include "profileedit.h"
2#include "profile_NNI.h" 3#include "profile_NNI.h"
3#include "profile_NN.h" 4#include "profile_NN.h"
4 5
5AProfile::AProfile( ProfileNetNode * PNN ) : ANetNodeInstance( PNN ) { 6AProfile::AProfile( ProfileNetNode * PNN ) : ANetNodeInstance( PNN ) {
6 Data.Automatic = 1; 7 Data.Automatic = 1;
7 Data.Confirm = 0; 8 Data.Confirm = 0;
8 Data.Description = ""; 9 Data.Description = "";
9 Data.Disabled = 0; 10 Data.Disabled = 0;
10 Data.TriggerVPN = 0; 11 Data.TriggerVPN = 0;
11 GUI = 0; 12 GUI = 0;
12 RT = 0; 13 RT = 0;
@@ -41,37 +42,35 @@ QWidget * AProfile::edit( QWidget * parent ) {
41 return GUI; 42 return GUI;
42} 43}
43 44
44QString AProfile::acceptable( void ) { 45QString AProfile::acceptable( void ) {
45 return ( GUI ) ? GUI->acceptable( ) : QString(); 46 return ( GUI ) ? GUI->acceptable( ) : QString();
46} 47}
47 48
48void AProfile::commit( void ) { 49void AProfile::commit( void ) {
49 if( GUI && GUI->commit( Data ) ) 50 if( GUI && GUI->commit( Data ) )
50 setModified( 1 ); 51 setModified( 1 );
51} 52}
52 53
53short AProfile::generateFileEmbedded( const QString & ID, 54short AProfile::generateFileEmbedded( SystemFile & SF,
54 const QString & Path,
55 QTextStream & TS,
56 long DevNr ) { 55 long DevNr ) {
57 56
58 short rvl, rvd; 57 short rvl, rvd;
59 58
60 rvl = 1; 59 rvl = 1;
61 60
62 if( ID == "interfaces" ) { 61 if( SF.name() == "interfaces" ) {
63 Log(("Generate Profile for %s\n", ID.latin1() )); 62 Log(("Generate Profile for %s\n", SF.name().latin1() ));
64 if( Data.TriggerVPN ) { 63 if( Data.TriggerVPN ) {
65 // this profile triggers VPN -> insert trigger 64 // this profile triggers VPN -> insert trigger
66 TS << " up networksettings2 --triggervpn" 65 SF << " up networksettings2 --triggervpn"
67 << endl; 66 << endl;
68 rvl = 0; 67 rvl = 0;
69 } 68 }
70 } 69 }
71 rvd = ANetNodeInstance::generateFileEmbedded( ID, Path, TS, DevNr ); 70 rvd = ANetNodeInstance::generateFileEmbedded( SF, DevNr );
72 return (rvd == 2 || rvl == 2 ) ? 2 : 71 return (rvd == 2 || rvl == 2 ) ? 2 :
73 (rvd == 0 || rvl == 0 ) ? 0 : 1; 72 (rvd == 0 || rvl == 0 ) ? 0 : 1;
74} 73}
75 74
76 75
77 76