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 | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/noncore/settings/networksettings2/lancard/lancard_NNI.cpp b/noncore/settings/networksettings2/lancard/lancard_NNI.cpp index a6401db..5962d52 100644 --- a/noncore/settings/networksettings2/lancard/lancard_NNI.cpp +++ b/noncore/settings/networksettings2/lancard/lancard_NNI.cpp | |||
@@ -1,58 +1,51 @@ | |||
1 | #include "lancardedit.h" | 1 | #include "lancardedit.h" |
2 | #include "lancard_NNI.h" | 2 | #include "lancard_NNI.h" |
3 | #include "lancard_NN.h" | 3 | #include "lancard_NN.h" |
4 | 4 | ||
5 | ALanCard::ALanCard( LanCardNetNode * PNN ) : ANetNodeInstance( PNN ) { | 5 | ALanCard::ALanCard( LanCardNetNode * PNN ) : ANetNodeInstance( PNN ) { |
6 | 6 | ||
7 | Data.AnyLanCard = 1; | 7 | Data.AnyLanCard = 1; |
8 | Data.HWAddresses.clear(); | 8 | Data.HWAddresses.clear(); |
9 | 9 | ||
10 | GUI = 0; | 10 | GUI = 0; |
11 | RT = 0; | 11 | RT = 0; |
12 | } | 12 | } |
13 | 13 | ||
14 | void ALanCard::setSpecificAttribute( QString & A, QString & V ) { | 14 | void ALanCard::setSpecificAttribute( QString & A, QString & V ) { |
15 | if( A == "matchanycard" ) { | 15 | if( A == "matchanycard" ) { |
16 | Data.AnyLanCard = (V == "yes" ); | 16 | Data.AnyLanCard = (V == "yes" ); |
17 | } else if( A == "match" ) { | 17 | } else if( A == "match" ) { |
18 | Data.HWAddresses.append( V ); | 18 | Data.HWAddresses.append( V ); |
19 | } | 19 | } |
20 | } | 20 | } |
21 | 21 | ||
22 | void ALanCard::saveSpecificAttribute( QTextStream & TS) { | 22 | void ALanCard::saveSpecificAttribute( QTextStream & TS) { |
23 | TS << "matchanycard=" << | 23 | TS << "matchanycard=" << |
24 | ((Data.AnyLanCard) ? "yes" : "no") << endl; | 24 | ((Data.AnyLanCard) ? "yes" : "no") << endl; |
25 | for( QStringList::Iterator it = Data.HWAddresses.begin(); | 25 | for( QStringList::Iterator it = Data.HWAddresses.begin(); |
26 | it != Data.HWAddresses.end(); ++it ) { | 26 | it != Data.HWAddresses.end(); ++it ) { |
27 | TS << "match=" << quote( *it ) << endl; | 27 | TS << "match=" << quote( *it ) << endl; |
28 | } | 28 | } |
29 | } | 29 | } |
30 | 30 | ||
31 | QWidget * ALanCard::edit( QWidget * parent ) { | 31 | QWidget * ALanCard::edit( QWidget * parent ) { |
32 | GUI = new LanCardEdit( parent ); | 32 | GUI = new LanCardEdit( parent ); |
33 | GUI->showData( Data ); | 33 | GUI->showData( Data ); |
34 | return GUI; | 34 | return GUI; |
35 | } | 35 | } |
36 | 36 | ||
37 | QString ALanCard::acceptable( void ) { | 37 | QString ALanCard::acceptable( void ) { |
38 | return ( GUI ) ? GUI->acceptable( ) : QString(); | 38 | return ( GUI ) ? GUI->acceptable( ) : QString(); |
39 | } | 39 | } |
40 | 40 | ||
41 | void ALanCard::commit( void ) { | 41 | void ALanCard::commit( void ) { |
42 | if( GUI && GUI->commit( Data ) ) | 42 | if( GUI && GUI->commit( Data ) ) |
43 | setModified( 1 ); | 43 | setModified( 1 ); |
44 | } | 44 | } |
45 | 45 | ||
46 | bool ALanCard::generateDeviceDataForCommonFile( SystemFile & S, long DevNr ) { | 46 | bool ALanCard::generateDataForCommonFile( |
47 | AsDevice * Dev = runtime()->device(); | 47 | SystemFile & , |
48 | QString NIC = Dev->genNic( DevNr ); | 48 | long ) { |
49 | 49 | return 1; | |
50 | if( S.name() == "interfaces" ) { | ||
51 | // generate mapping stanza for this interface | ||
52 | S << "# check if " << NIC << " can be brought UP" << endl; | ||
53 | S << "mapping " << NIC << endl; | ||
54 | S << " script networksettings2-request" << endl << endl; | ||
55 | } | ||
56 | return 0; | ||
57 | } | 50 | } |
58 | 51 | ||