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 | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/noncore/settings/networksettings2/profile/profile_NNI.cpp b/noncore/settings/networksettings2/profile/profile_NNI.cpp index a1e1254..fc2d809 100644 --- a/noncore/settings/networksettings2/profile/profile_NNI.cpp +++ b/noncore/settings/networksettings2/profile/profile_NNI.cpp | |||
@@ -1,24 +1,25 @@ | |||
1 | #include <qpe/qpeapplication.h> | ||
1 | #include <opie2/odebug.h> | 2 | #include <opie2/odebug.h> |
2 | #include "profileedit.h" | 3 | #include "profileedit.h" |
3 | #include "profile_NNI.h" | 4 | #include "profile_NNI.h" |
4 | #include "profile_NN.h" | 5 | #include "profile_NN.h" |
5 | 6 | ||
6 | AProfile::AProfile( ProfileNetNode * PNN ) : ANetNodeInstance( PNN ) { | 7 | AProfile::AProfile( ProfileNetNode * PNN ) : ANetNodeInstance( PNN ) { |
7 | Data.Automatic = 1; | 8 | Data.Automatic = 1; |
8 | Data.Confirm = 0; | 9 | Data.Confirm = 0; |
9 | Data.Description = ""; | 10 | Data.Description = ""; |
10 | Data.Disabled = 0; | 11 | Data.Disabled = 0; |
11 | Data.TriggerVPN = 0; | 12 | Data.TriggerVPN = 0; |
12 | GUI = 0; | 13 | GUI = 0; |
13 | RT = 0; | 14 | RT = 0; |
14 | } | 15 | } |
15 | 16 | ||
16 | void AProfile::setSpecificAttribute( QString & Attr, QString & Value ) { | 17 | void AProfile::setSpecificAttribute( QString & Attr, QString & Value ) { |
17 | 18 | ||
18 | if ( Attr == "automatic" ) { | 19 | if ( Attr == "automatic" ) { |
19 | Data.Automatic = (Value=="yes"); | 20 | Data.Automatic = (Value=="yes"); |
20 | } else if ( Attr == "preconfirm" ) { | 21 | } else if ( Attr == "preconfirm" ) { |
21 | Data.Confirm = (Value=="yes"); | 22 | Data.Confirm = (Value=="yes"); |
22 | } else if ( Attr == "disabled" ) { | 23 | } else if ( Attr == "disabled" ) { |
23 | Data.Disabled = (Value=="yes"); | 24 | Data.Disabled = (Value=="yes"); |
24 | } else if ( Attr == "triggervpn" ) { | 25 | } else if ( Attr == "triggervpn" ) { |
@@ -41,36 +42,40 @@ QWidget * AProfile::edit( QWidget * parent ) { | |||
41 | GUI->showData( Data ); | 42 | GUI->showData( Data ); |
42 | return GUI; | 43 | return GUI; |
43 | } | 44 | } |
44 | 45 | ||
45 | QString AProfile::acceptable( void ) { | 46 | QString AProfile::acceptable( void ) { |
46 | return ( GUI ) ? GUI->acceptable( ) : QString(); | 47 | return ( GUI ) ? GUI->acceptable( ) : QString(); |
47 | } | 48 | } |
48 | 49 | ||
49 | void AProfile::commit( void ) { | 50 | void AProfile::commit( void ) { |
50 | if( GUI && GUI->commit( Data ) ) | 51 | if( GUI && GUI->commit( Data ) ) |
51 | setModified( 1 ); | 52 | setModified( 1 ); |
52 | } | 53 | } |
53 | 54 | ||
54 | short AProfile::generateFileEmbedded( SystemFile & SF, | 55 | short AProfile::generateFileEmbedded( SystemFile & SF, |
55 | long DevNr ) { | 56 | long DevNr ) { |
56 | 57 | ||
57 | short rvl, rvd; | 58 | short rvl, rvd; |
58 | 59 | ||
59 | rvl = 1; | 60 | rvl = 1; |
60 | 61 | ||
61 | if( SF.name() == "interfaces" ) { | 62 | if( SF.name() == "interfaces" ) { |
62 | Log(("Generate Profile for %s\n", SF.name().latin1() )); | 63 | Log(("Generate Profile for %s\n", SF.name().latin1() )); |
63 | if( Data.TriggerVPN ) { | 64 | if( Data.TriggerVPN ) { |
64 | // this profile triggers VPN -> insert trigger | 65 | // this profile triggers VPN -> insert trigger |
65 | SF << " up networksettings2 --triggervpn" | 66 | SF << " up " |
67 | << QPEApplication::qpeDir() | ||
68 | << "bin/networksettings2 --triggervpn " | ||
69 | << runtime()->device()->netNode()->nodeClass()->genNic( DevNr ) | ||
70 | << " || true" | ||
66 | << endl; | 71 | << endl; |
67 | rvl = 0; | 72 | rvl = 0; |
68 | } | 73 | } |
69 | } | 74 | } |
70 | rvd = ANetNodeInstance::generateFileEmbedded( SF, DevNr ); | 75 | rvd = ANetNodeInstance::generateFileEmbedded( SF, DevNr ); |
71 | return (rvd == 2 || rvl == 2 ) ? 2 : | 76 | return (rvd == 2 || rvl == 2 ) ? 2 : |
72 | (rvd == 0 || rvl == 0 ) ? 0 : 1; | 77 | (rvd == 0 || rvl == 0 ) ? 0 : 1; |
73 | } | 78 | } |
74 | 79 | ||
75 | 80 | ||
76 | 81 | ||