author | wimpie <wimpie> | 2005-01-04 01:35:26 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2005-01-04 01:35:26 (UTC) |
commit | a9c188235c97e07b0eb96b13adbcdfd4bad64767 (patch) (unidiff) | |
tree | 13f6ae5c499dc0c1d1bd4b763a1973a0fa8635cf /noncore/settings/networksettings2/profile/profile_NNI.cpp | |
parent | 48b6cd5966ec6cc0b968edf10ba1a1ad96ef165f (diff) | |
download | opie-a9c188235c97e07b0eb96b13adbcdfd4bad64767.zip opie-a9c188235c97e07b0eb96b13adbcdfd4bad64767.tar.gz opie-a9c188235c97e07b0eb96b13adbcdfd4bad64767.tar.bz2 |
CONTROL files : changed version string
NS2 many changes and first release of OT2
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 | 13 |
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,24 +1,25 @@ | |||
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 | ||
5 | AProfile::AProfile( ProfileNetNode * PNN ) : ANetNodeInstance( PNN ) { | 6 | AProfile::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; |
13 | } | 14 | } |
14 | 15 | ||
15 | void AProfile::setSpecificAttribute( QString & Attr, QString & Value ) { | 16 | void AProfile::setSpecificAttribute( QString & Attr, QString & Value ) { |
16 | 17 | ||
17 | if ( Attr == "automatic" ) { | 18 | if ( Attr == "automatic" ) { |
18 | Data.Automatic = (Value=="yes"); | 19 | Data.Automatic = (Value=="yes"); |
19 | } else if ( Attr == "preconfirm" ) { | 20 | } else if ( Attr == "preconfirm" ) { |
20 | Data.Confirm = (Value=="yes"); | 21 | Data.Confirm = (Value=="yes"); |
21 | } else if ( Attr == "disabled" ) { | 22 | } else if ( Attr == "disabled" ) { |
22 | Data.Disabled = (Value=="yes"); | 23 | Data.Disabled = (Value=="yes"); |
23 | } else if ( Attr == "triggervpn" ) { | 24 | } else if ( Attr == "triggervpn" ) { |
24 | Data.TriggerVPN = (Value=="yes"); | 25 | Data.TriggerVPN = (Value=="yes"); |
@@ -29,49 +30,47 @@ void AProfile::setSpecificAttribute( QString & Attr, QString & Value ) { | |||
29 | 30 | ||
30 | void AProfile::saveSpecificAttribute( QTextStream & TS ) { | 31 | void AProfile::saveSpecificAttribute( QTextStream & TS ) { |
31 | TS << "automatic=" << ((Data.Automatic) ? "yes" : "no") << endl; | 32 | TS << "automatic=" << ((Data.Automatic) ? "yes" : "no") << endl; |
32 | TS << "preconfirm=" << ((Data.Confirm) ? "yes" : "no") << endl; | 33 | TS << "preconfirm=" << ((Data.Confirm) ? "yes" : "no") << endl; |
33 | TS << "disabled=" << ((Data.Disabled) ? "yes" : "no") << endl; | 34 | TS << "disabled=" << ((Data.Disabled) ? "yes" : "no") << endl; |
34 | TS << "triggervpn=" << ((Data.TriggerVPN) ? "yes" : "no") << endl; | 35 | TS << "triggervpn=" << ((Data.TriggerVPN) ? "yes" : "no") << endl; |
35 | TS << "description=" << Data.Description << endl; | 36 | TS << "description=" << Data.Description << endl; |
36 | } | 37 | } |
37 | 38 | ||
38 | QWidget * AProfile::edit( QWidget * parent ) { | 39 | QWidget * AProfile::edit( QWidget * parent ) { |
39 | GUI = new ProfileEdit( parent, this ); | 40 | GUI = new ProfileEdit( parent, this ); |
40 | GUI->showData( Data ); | 41 | GUI->showData( Data ); |
41 | return GUI; | 42 | return GUI; |
42 | } | 43 | } |
43 | 44 | ||
44 | QString AProfile::acceptable( void ) { | 45 | QString AProfile::acceptable( void ) { |
45 | return ( GUI ) ? GUI->acceptable( ) : QString(); | 46 | return ( GUI ) ? GUI->acceptable( ) : QString(); |
46 | } | 47 | } |
47 | 48 | ||
48 | void AProfile::commit( void ) { | 49 | void 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 | ||
53 | short AProfile::generateFileEmbedded( const QString & ID, | 54 | short 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 | ||