From 9aeac7cefc3c8baf32944e7275b57e0a0cde1515 Mon Sep 17 00:00:00 2001 From: wimpie Date: Mon, 05 Apr 2004 22:58:06 +0000 Subject: Add save of node specific config data --- (limited to 'noncore/settings/networksettings2/lancard') 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 @@ -8,6 +8,7 @@ static const char * LanCardNeeds[] = * Constructor, find all of the possible interfaces */ LanCardNetNode::LanCardNetNode() : ANetNode() { + InstanceCount = 2; } /** @@ -65,6 +66,18 @@ QString LanCardNetNode::genNic( long nr ) { return S.sprintf( "eth%ld", nr ); } +void LanCardNetNode::setSpecificAttribute( QString & A, QString & V ) { + if( A == "interfacecount" ) { + InstanceCount = V.toLong(); + } +} + +void LanCardNetNode::saveSpecificAttribute( QTextStream & TS) { + TS << "interfacecount=" + << InstanceCount + << endl; +} + extern "C" { void create_plugin( QList & PNN ) { PNN.append( new LanCardNetNode() ); diff --git a/noncore/settings/networksettings2/lancard/lancard_NN.h b/noncore/settings/networksettings2/lancard/lancard_NN.h index dcdd0da..5f2b25d 100644 --- a/noncore/settings/networksettings2/lancard/lancard_NN.h +++ b/noncore/settings/networksettings2/lancard/lancard_NN.h @@ -33,12 +33,18 @@ public: SystemFile & SF, long DevNr ); virtual long instanceCount( void ) - { return 2; } + { return InstanceCount; } virtual QString genNic( long ); private: + virtual void setSpecificAttribute( QString & Attr, QString & Value ); + virtual void saveSpecificAttribute( QTextStream & TS ); + + // number of interfaces for this device + long InstanceCount; + }; extern "C" -- cgit v0.9.0.2