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.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/lancard/lancard_NN.cpp b/noncore/settings/networksettings2/lancard/lancard_NN.cpp
index 480ddf9..ba1c1f8 100644
--- a/noncore/settings/networksettings2/lancard/lancard_NN.cpp
+++ b/noncore/settings/networksettings2/lancard/lancard_NN.cpp
@@ -1,22 +1,23 @@
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 6
7/** 7/**
8 * Constructor, find all of the possible interfaces 8 * Constructor, find all of the possible interfaces
9 */ 9 */
10LanCardNetNode::LanCardNetNode() : ANetNode() { 10LanCardNetNode::LanCardNetNode() : ANetNode() {
11 InstanceCount = 2;
11} 12}
12 13
13/** 14/**
14 * Delete any interfaces that we own. 15 * Delete any interfaces that we own.
15 */ 16 */
16LanCardNetNode::~LanCardNetNode(){ 17LanCardNetNode::~LanCardNetNode(){
17} 18}
18 19
19const QString LanCardNetNode::nodeDescription(){ 20const QString LanCardNetNode::nodeDescription(){
20 return tr("\ 21 return tr("\
21<p>Sets up a wired regular LAN card.</p>\ 22<p>Sets up a wired regular LAN card.</p>\
22<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>\
@@ -56,17 +57,29 @@ bool LanCardNetNode::generateDeviceDataForCommonFile(
56 S << "# check if " << NIC << " can be brought UP" << endl; 57 S << "# check if " << NIC << " can be brought UP" << endl;
57 S << "mapping " << NIC << endl; 58 S << "mapping " << NIC << endl;
58 S << " script networksettings2-request" << endl << endl; 59 S << " script networksettings2-request" << endl << endl;
59 } 60 }
60 return 0; 61 return 0;
61} 62}
62 63
63QString LanCardNetNode::genNic( long nr ) { 64QString LanCardNetNode::genNic( long nr ) {
64 QString S; 65 QString S;
65 return S.sprintf( "eth%ld", nr ); 66 return S.sprintf( "eth%ld", nr );
66} 67}
67 68
69void LanCardNetNode::setSpecificAttribute( QString & A, QString & V ) {
70 if( A == "interfacecount" ) {
71 InstanceCount = V.toLong();
72 }
73}
74
75void LanCardNetNode::saveSpecificAttribute( QTextStream & TS) {
76 TS << "interfacecount="
77 << InstanceCount
78 << endl;
79}
80
68extern "C" { 81extern "C" {
69void create_plugin( QList<ANetNode> & PNN ) { 82void create_plugin( QList<ANetNode> & PNN ) {
70 PNN.append( new LanCardNetNode() ); 83 PNN.append( new LanCardNetNode() );
71} 84}
72} 85}