Diffstat (limited to 'noncore/settings/networksettings2/lancard/lancard_NNI.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/lancard/lancard_NNI.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/lancard/lancard_NNI.cpp b/noncore/settings/networksettings2/lancard/lancard_NNI.cpp new file mode 100644 index 0000000..9595e2e --- a/dev/null +++ b/noncore/settings/networksettings2/lancard/lancard_NNI.cpp | |||
@@ -0,0 +1,44 @@ | |||
1 | #include "lancardedit.h" | ||
2 | #include "lancard_NNI.h" | ||
3 | #include "lancard_NN.h" | ||
4 | |||
5 | ALanCard::ALanCard( LanCardNetNode * PNN ) : ANetNodeInstance( PNN ) { | ||
6 | |||
7 | Data.AnyLanCard = 1; | ||
8 | Data.HWAddresses.clear(); | ||
9 | |||
10 | GUI = 0; | ||
11 | RT = 0; | ||
12 | } | ||
13 | |||
14 | void ALanCard::setSpecificAttribute( QString & A, QString & V ) { | ||
15 | if( A == "matchanycard" ) { | ||
16 | Data.AnyLanCard = (V == "yes" ); | ||
17 | } else if( A == "match" ) { | ||
18 | Data.HWAddresses.append( V ); | ||
19 | } | ||
20 | } | ||
21 | |||
22 | void ALanCard::saveSpecificAttribute( QTextStream & TS) { | ||
23 | TS << "matchanycard=" << | ||
24 | ((Data.AnyLanCard) ? "yes" : "no") << endl; | ||
25 | for( QStringList::Iterator it = Data.HWAddresses.begin(); | ||
26 | it != Data.HWAddresses.end(); ++it ) { | ||
27 | TS << "match=" << quote( *it ) << endl; | ||
28 | } | ||
29 | } | ||
30 | |||
31 | QWidget * ALanCard::edit( QWidget * parent ) { | ||
32 | GUI = new LanCardEdit( parent ); | ||
33 | GUI->showData( Data ); | ||
34 | return GUI; | ||
35 | } | ||
36 | |||
37 | QString ALanCard::acceptable( void ) { | ||
38 | return ( GUI ) ? GUI->acceptable( ) : QString(); | ||
39 | } | ||
40 | |||
41 | void ALanCard::commit( void ) { | ||
42 | if( GUI && GUI->commit( Data ) ) | ||
43 | setModified( 1 ); | ||
44 | } | ||