summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/lancard/lancard_NN.cpp
Unidiff
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.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/noncore/settings/networksettings2/lancard/lancard_NN.cpp b/noncore/settings/networksettings2/lancard/lancard_NN.cpp
index 20ae7f6..e36f757 100644
--- a/noncore/settings/networksettings2/lancard/lancard_NN.cpp
+++ b/noncore/settings/networksettings2/lancard/lancard_NN.cpp
@@ -1,62 +1,68 @@
1#include "lancard_NN.h" 1#include "lancard_NN.h"
2#include "lancard_NNI.h" 2#include "lancard_NNI.h"
3 3
4static const char * LanCardNeeds[] = 4static const char * LanCardNeeds[] =
5 { 0 }; 5 { 0
6 };
7
8static const char * LanCardProvides[] =
9 { "device",
10 0
11 };
6 12
7/** 13/**
8 * Constructor, find all of the possible interfaces 14 * Constructor, find all of the possible interfaces
9 */ 15 */
10LanCardNetNode::LanCardNetNode() : ANetNode(tr("LAN card")), NICMACAddresses() { 16LanCardNetNode::LanCardNetNode() : ANetNode(tr("LAN card")), NICMACAddresses() {
11 InstanceCount = 2; 17 InstanceCount = 2;
12} 18}
13 19
14/** 20/**
15 * Delete any interfaces that we own. 21 * Delete any interfaces that we own.
16 */ 22 */
17LanCardNetNode::~LanCardNetNode(){ 23LanCardNetNode::~LanCardNetNode(){
18} 24}
19 25
20const QString LanCardNetNode::nodeDescription(){ 26const QString LanCardNetNode::nodeDescription(){
21 return tr("\ 27 return tr("\
22<p>Sets up a wired regular LAN card.</p>\ 28<p>Sets up a wired regular LAN card.</p>\
23<p>Use this to set up 10/100/1000 MBit LAN cards.</p>\ 29<p>Use this to set up 10/100/1000 MBit LAN cards.</p>\
24" 30"
25); 31);
26} 32}
27 33
28ANetNodeInstance * LanCardNetNode::createInstance( void ) { 34ANetNodeInstance * LanCardNetNode::createInstance( void ) {
29 return new ALanCard( this ); 35 return new ALanCard( this );
30} 36}
31 37
32 38
33const char ** LanCardNetNode::needs( void ) { 39const char ** LanCardNetNode::needs( void ) {
34 return LanCardNeeds; 40 return LanCardNeeds;
35} 41}
36 42
37const char * LanCardNetNode::provides( void ) { 43const char ** LanCardNetNode::provides( void ) {
38 return "device"; 44 return LanCardProvides;
39} 45}
40 46
41QString LanCardNetNode::genNic( long nr ) { 47QString LanCardNetNode::genNic( long nr ) {
42 QString S; 48 QString S;
43 return S.sprintf( "eth%ld", nr ); 49 return S.sprintf( "eth%ld", nr );
44} 50}
45 51
46void LanCardNetNode::setSpecificAttribute( QString & A, QString & V ) { 52void LanCardNetNode::setSpecificAttribute( QString & A, QString & V ) {
47 if( A == "interfacecount" ) { 53 if( A == "interfacecount" ) {
48 InstanceCount = V.toLong(); 54 InstanceCount = V.toLong();
49 } else if ( A == "macaddress" ) { 55 } else if ( A == "macaddress" ) {
50 NICMACAddresses.append( V ); 56 NICMACAddresses.append( V );
51 } 57 }
52} 58}
53 59
54void LanCardNetNode::saveSpecificAttribute( QTextStream & TS) { 60void LanCardNetNode::saveSpecificAttribute( QTextStream & TS) {
55 TS << "interfacecount=" 61 TS << "interfacecount="
56 << InstanceCount 62 << InstanceCount
57 << endl; 63 << endl;
58 for( QStringList::Iterator it = NICMACAddresses.begin(); 64 for( QStringList::Iterator it = NICMACAddresses.begin();
59 it != NICMACAddresses.end(); 65 it != NICMACAddresses.end();
60 ++it ) { 66 ++it ) {
61 TS << "macaddress=" 67 TS << "macaddress="
62 << (*it) 68 << (*it)