author | wimpie <wimpie> | 2004-04-07 00:09:37 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2004-04-07 00:09:37 (UTC) |
commit | b93d9e0c4384be0a6f40be257ba791004388400b (patch) (unidiff) | |
tree | 2ca0e41dc8c99e1af3ce2f0305d458f76d10db45 /noncore/settings/networksettings2/lancard/lancard_NN.cpp | |
parent | 1b7aaf904fa70c16eee03155bd826e921798cc22 (diff) | |
download | opie-b93d9e0c4384be0a6f40be257ba791004388400b.zip opie-b93d9e0c4384be0a6f40be257ba791004388400b.tar.gz opie-b93d9e0c4384be0a6f40be257ba791004388400b.tar.bz2 |
MANY changes ... lancards should be OK now
Diffstat (limited to 'noncore/settings/networksettings2/lancard/lancard_NN.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/lancard/lancard_NN.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/noncore/settings/networksettings2/lancard/lancard_NN.cpp b/noncore/settings/networksettings2/lancard/lancard_NN.cpp index ba1c1f8..a4afab1 100644 --- a/noncore/settings/networksettings2/lancard/lancard_NN.cpp +++ b/noncore/settings/networksettings2/lancard/lancard_NN.cpp | |||
@@ -1,26 +1,26 @@ | |||
1 | #include "lancard_NN.h" | 1 | #include "lancard_NN.h" |
2 | #include "lancard_NNI.h" | 2 | #include "lancard_NNI.h" |
3 | 3 | ||
4 | static const char * LanCardNeeds[] = | 4 | static const char * LanCardNeeds[] = |
5 | { 0 }; | 5 | { 0 }; |
6 | 6 | ||
7 | /** | 7 | /** |
8 | * Constructor, find all of the possible interfaces | 8 | * Constructor, find all of the possible interfaces |
9 | */ | 9 | */ |
10 | LanCardNetNode::LanCardNetNode() : ANetNode() { | 10 | LanCardNetNode::LanCardNetNode() : ANetNode(tr("LAN card")), NICMACAddresses() { |
11 | InstanceCount = 2; | 11 | InstanceCount = 2; |
12 | } | 12 | } |
13 | 13 | ||
14 | /** | 14 | /** |
15 | * Delete any interfaces that we own. | 15 | * Delete any interfaces that we own. |
16 | */ | 16 | */ |
17 | LanCardNetNode::~LanCardNetNode(){ | 17 | LanCardNetNode::~LanCardNetNode(){ |
18 | } | 18 | } |
19 | 19 | ||
20 | const QString LanCardNetNode::nodeDescription(){ | 20 | const QString LanCardNetNode::nodeDescription(){ |
21 | return tr("\ | 21 | return tr("\ |
22 | <p>Sets up a wired regular LAN card.</p>\ | 22 | <p>Sets up a wired regular LAN card.</p>\ |
23 | <p>Use this to set up 10/100/1000 MBit LAN cards.</p>\ | 23 | <p>Use this to set up 10/100/1000 MBit LAN cards.</p>\ |
24 | " | 24 | " |
25 | ); | 25 | ); |
26 | } | 26 | } |
@@ -56,30 +56,39 @@ bool LanCardNetNode::generateDeviceDataForCommonFile( | |||
56 | // generate mapping stanza for this interface | 56 | // generate mapping stanza for this interface |
57 | S << "# check if " << NIC << " can be brought UP" << endl; | 57 | S << "# check if " << NIC << " can be brought UP" << endl; |
58 | S << "mapping " << NIC << endl; | 58 | S << "mapping " << NIC << endl; |
59 | S << " script networksettings2-request" << endl << endl; | 59 | S << " script networksettings2-request" << endl << endl; |
60 | } | 60 | } |
61 | return 0; | 61 | return 0; |
62 | } | 62 | } |
63 | 63 | ||
64 | QString LanCardNetNode::genNic( long nr ) { | 64 | QString LanCardNetNode::genNic( long nr ) { |
65 | QString S; | 65 | QString S; |
66 | return S.sprintf( "eth%ld", nr ); | 66 | return S.sprintf( "eth%ld", nr ); |
67 | } | 67 | } |
68 | 68 | ||
69 | void LanCardNetNode::setSpecificAttribute( QString & A, QString & V ) { | 69 | void LanCardNetNode::setSpecificAttribute( QString & A, QString & V ) { |
70 | if( A == "interfacecount" ) { | 70 | if( A == "interfacecount" ) { |
71 | InstanceCount = V.toLong(); | 71 | InstanceCount = V.toLong(); |
72 | } else if ( A == "macaddress" ) { | ||
73 | NICMACAddresses.append( V ); | ||
72 | } | 74 | } |
73 | } | 75 | } |
74 | 76 | ||
75 | void LanCardNetNode::saveSpecificAttribute( QTextStream & TS) { | 77 | void LanCardNetNode::saveSpecificAttribute( QTextStream & TS) { |
76 | TS << "interfacecount=" | 78 | TS << "interfacecount=" |
77 | << InstanceCount | 79 | << InstanceCount |
78 | << endl; | 80 | << endl; |
81 | for( QStringList::Iterator it = NICMACAddresses.begin(); | ||
82 | it != NICMACAddresses.end(); | ||
83 | ++it ) { | ||
84 | TS << "macaddress=" | ||
85 | << (*it) | ||
86 | << endl; | ||
87 | } | ||
79 | } | 88 | } |
80 | 89 | ||
81 | extern "C" { | 90 | extern "C" { |
82 | void create_plugin( QList<ANetNode> & PNN ) { | 91 | void create_plugin( QList<ANetNode> & PNN ) { |
83 | PNN.append( new LanCardNetNode() ); | 92 | PNN.append( new LanCardNetNode() ); |
84 | } | 93 | } |
85 | } | 94 | } |