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.cpp | 27 |
1 files changed, 23 insertions, 4 deletions
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 | |||
@@ -29,30 +29,49 @@ void AProfile::setSpecificAttribute( QString & Attr, QString & Value ) { | |||
29 | 29 | ||
30 | void AProfile::saveSpecificAttribute( QTextStream & TS ) { | 30 | void AProfile::saveSpecificAttribute( QTextStream & TS ) { |
31 | TS << "automatic=" << ((Data.Automatic) ? "yes" : "no") << endl; | 31 | TS << "automatic=" << ((Data.Automatic) ? "yes" : "no") << endl; |
32 | TS << "preconfirm=" << ((Data.Confirm) ? "yes" : "no") << endl; | 32 | TS << "preconfirm=" << ((Data.Confirm) ? "yes" : "no") << endl; |
33 | TS << "disabled=" << ((Data.Disabled) ? "yes" : "no") << endl; | 33 | TS << "disabled=" << ((Data.Disabled) ? "yes" : "no") << endl; |
34 | TS << "triggervpn=" << ((Data.TriggerVPN) ? "yes" : "no") << endl; | 34 | TS << "triggervpn=" << ((Data.TriggerVPN) ? "yes" : "no") << endl; |
35 | TS << "description=" << Data.Description << endl; | 35 | TS << "description=" << Data.Description << endl; |
36 | } | 36 | } |
37 | 37 | ||
38 | QWidget * AProfile::edit( QWidget * parent ) { | 38 | QWidget * AProfile::edit( QWidget * parent ) { |
39 | GUI = new ProfileEdit( parent, this ); | 39 | GUI = new ProfileEdit( parent, this ); |
40 | GUI->showData( Data ); | 40 | GUI->showData( Data ); |
41 | return GUI; | 41 | return GUI; |
42 | } | 42 | } |
43 | 43 | ||
44 | QString AProfile::acceptable( void ) { | 44 | QString AProfile::acceptable( void ) { |
45 | return ( GUI ) ? GUI->acceptable( ) : QString(); | 45 | return ( GUI ) ? GUI->acceptable( ) : QString(); |
46 | } | 46 | } |
47 | 47 | ||
48 | void AProfile::commit( void ) { | 48 | void AProfile::commit( void ) { |
49 | if( GUI && GUI->commit( Data ) ) | 49 | if( GUI && GUI->commit( Data ) ) |
50 | setModified( 1 ); | 50 | setModified( 1 ); |
51 | } | 51 | } |
52 | 52 | ||
53 | bool AProfile::generateDataForCommonFile( | 53 | short 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 | } | ||
70 | } | ||
71 | rvd = ANetNodeInstance::generateFileEmbedded( ID, Path, TS, DevNr ); | ||
72 | return (rvd == 2 || rvl == 2 ) ? 2 : | ||
73 | (rvd == 0 || rvl == 0 ) ? 0 : 1; | ||
57 | } | 74 | } |
58 | 75 | ||
76 | |||
77 | |||