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/network/network_NN.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/network/network_NN.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/network/network_NN.cpp | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/noncore/settings/networksettings2/network/network_NN.cpp b/noncore/settings/networksettings2/network/network_NN.cpp index b5c41bf..23b3d44 100644 --- a/noncore/settings/networksettings2/network/network_NN.cpp +++ b/noncore/settings/networksettings2/network/network_NN.cpp | |||
@@ -1,5 +1,6 @@ | |||
1 | #include <qpe/qpeapplication.h> | 1 | #include <qpe/qpeapplication.h> |
2 | #include <asdevice.h> | 2 | #include <resources.h> |
3 | #include <netnode.h> | ||
3 | #include "network_NN.h" | 4 | #include "network_NN.h" |
4 | #include "network_NNI.h" | 5 | #include "network_NNI.h" |
5 | 6 | ||
@@ -8,10 +9,18 @@ static const char * NetworkNeeds[] = | |||
8 | 0 | 9 | 0 |
9 | }; | 10 | }; |
10 | 11 | ||
12 | static const char * NetworkProvides[] = | ||
13 | { "connection", | ||
14 | 0 | ||
15 | }; | ||
16 | |||
11 | /** | 17 | /** |
12 | * Constructor, find all of the possible interfaces | 18 | * Constructor, find all of the possible interfaces |
13 | */ | 19 | */ |
14 | NetworkNetNode::NetworkNetNode() : ANetNode(tr("IP Configuration")) { | 20 | NetworkNetNode::NetworkNetNode() : ANetNode(tr("IP Configuration")) { |
21 | |||
22 | NSResources->addSystemFile( | ||
23 | "interfaces", "/etc/network/interfaces", 1 ); | ||
15 | } | 24 | } |
16 | 25 | ||
17 | /** | 26 | /** |
@@ -32,31 +41,34 @@ ANetNodeInstance * NetworkNetNode::createInstance( void ) { | |||
32 | return new ANetwork( this ); | 41 | return new ANetwork( this ); |
33 | } | 42 | } |
34 | 43 | ||
35 | bool NetworkNetNode::hasDataForFile( const QString & S ) { | 44 | bool NetworkNetNode::hasDataForFile( SystemFile & S ) { |
36 | return S == "interfaces"; | 45 | return S.name() == "interfaces"; |
37 | } | 46 | } |
38 | 47 | ||
39 | short NetworkNetNode::generateFile( const QString & ID, | 48 | short NetworkNetNode::generateFile( SystemFile & SF, |
40 | const QString & , | ||
41 | QTextStream & TS, | ||
42 | ANetNodeInstance * NNI, | 49 | ANetNodeInstance * NNI, |
43 | long DevNr ) { | 50 | long DevNr ) { |
44 | 51 | ||
52 | if( DevNr < 0 ) { | ||
53 | // generate device specific but common part | ||
54 | return 1; | ||
55 | } | ||
56 | |||
45 | QString NIC = NNI->runtime()->device()->netNode()->nodeClass()->genNic( DevNr ); | 57 | QString NIC = NNI->runtime()->device()->netNode()->nodeClass()->genNic( DevNr ); |
46 | 58 | ||
47 | if( ID == "interfaces" ) { | 59 | if( SF.name() == "interfaces" ) { |
48 | Log(("Generate entry for %s in %s\n", NIC.latin1(), ID.latin1() )); | 60 | Log(("Generate entry for %s in %s\n", NIC.latin1(), SF.name().latin1() )); |
49 | // generate mapping stanza for this interface | 61 | // generate mapping stanza for this interface |
50 | TS << "# check if " | 62 | SF << "# check if " |
51 | << NIC | 63 | << NIC |
52 | << " can be brought UP" | 64 | << " can be brought UP" |
53 | << endl; | 65 | << endl; |
54 | TS << "mapping " | 66 | SF << "mapping " |
55 | << NIC | 67 | << NIC |
56 | << endl; | 68 | << endl; |
57 | TS << " script " | 69 | SF << " script " |
58 | << QPEApplication::qpeDir() | 70 | << QPEApplication::qpeDir() |
59 | << "/bin/networksettings2-request" | 71 | << "bin/networksettings2-request" |
60 | << endl | 72 | << endl |
61 | << endl; | 73 | << endl; |
62 | return 0; | 74 | return 0; |
@@ -68,8 +80,8 @@ const char ** NetworkNetNode::needs( void ) { | |||
68 | return NetworkNeeds; | 80 | return NetworkNeeds; |
69 | } | 81 | } |
70 | 82 | ||
71 | const char * NetworkNetNode::provides( void ) { | 83 | const char ** NetworkNetNode::provides( void ) { |
72 | return "connection"; | 84 | return NetworkProvides; |
73 | } | 85 | } |
74 | 86 | ||
75 | void NetworkNetNode::setSpecificAttribute( QString & , QString & ) { | 87 | void NetworkNetNode::setSpecificAttribute( QString & , QString & ) { |