Diffstat (limited to 'noncore/settings/networksettings2/lancard') (more/less context) (show whitespace changes)
8 files changed, 285 insertions, 65 deletions
diff --git a/noncore/settings/networksettings2/lancard/lancardGUI.ui b/noncore/settings/networksettings2/lancard/lancardGUI.ui index 8d94816..c407175 100644 --- a/noncore/settings/networksettings2/lancard/lancardGUI.ui +++ b/noncore/settings/networksettings2/lancard/lancardGUI.ui | |||
@@ -13,3 +13,3 @@ | |||
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>362</width> | 14 | <width>354</width> |
15 | <height>359</height> | 15 | <height>359</height> |
@@ -71,3 +71,3 @@ | |||
71 | <name>margin</name> | 71 | <name>margin</name> |
72 | <number>11</number> | 72 | <number>5</number> |
73 | </property> | 73 | </property> |
@@ -82,3 +82,3 @@ | |||
82 | <name>text</name> | 82 | <name>text</name> |
83 | <string>Name</string> | 83 | <string>MACAddress</string> |
84 | </property> | 84 | </property> |
@@ -93,25 +93,71 @@ | |||
93 | </column> | 93 | </column> |
94 | <column> | 94 | <property stdset="1"> |
95 | <property> | 95 | <name>name</name> |
96 | <cstring>LanCards_LV</cstring> | ||
97 | </property> | ||
98 | <property stdset="1"> | ||
99 | <name>allColumnsShowFocus</name> | ||
100 | <bool>true</bool> | ||
101 | </property> | ||
102 | </widget> | ||
103 | <widget> | ||
104 | <class>QLayoutWidget</class> | ||
105 | <property stdset="1"> | ||
106 | <name>name</name> | ||
107 | <cstring>Layout2</cstring> | ||
108 | </property> | ||
109 | <hbox> | ||
110 | <property stdset="1"> | ||
111 | <name>margin</name> | ||
112 | <number>0</number> | ||
113 | </property> | ||
114 | <property stdset="1"> | ||
115 | <name>spacing</name> | ||
116 | <number>6</number> | ||
117 | </property> | ||
118 | <widget> | ||
119 | <class>QPushButton</class> | ||
120 | <property stdset="1"> | ||
121 | <name>name</name> | ||
122 | <cstring>RemoveUnknown_BUT</cstring> | ||
123 | </property> | ||
124 | <property stdset="1"> | ||
96 | <name>text</name> | 125 | <name>text</name> |
97 | <string>MACAddress</string> | 126 | <string>Remove Unknown</string> |
98 | </property> | 127 | </property> |
128 | </widget> | ||
129 | <spacer> | ||
99 | <property> | 130 | <property> |
100 | <name>clickable</name> | 131 | <name>name</name> |
101 | <bool>true</bool> | 132 | <cstring>Spacer1</cstring> |
133 | </property> | ||
134 | <property stdset="1"> | ||
135 | <name>orientation</name> | ||
136 | <enum>Horizontal</enum> | ||
137 | </property> | ||
138 | <property stdset="1"> | ||
139 | <name>sizeType</name> | ||
140 | <enum>Expanding</enum> | ||
102 | </property> | 141 | </property> |
103 | <property> | 142 | <property> |
104 | <name>resizeable</name> | 143 | <name>sizeHint</name> |
105 | <bool>true</bool> | 144 | <size> |
145 | <width>20</width> | ||
146 | <height>20</height> | ||
147 | </size> | ||
106 | </property> | 148 | </property> |
107 | </column> | 149 | </spacer> |
150 | <widget> | ||
151 | <class>QPushButton</class> | ||
108 | <property stdset="1"> | 152 | <property stdset="1"> |
109 | <name>name</name> | 153 | <name>name</name> |
110 | <cstring>LanCards_LV</cstring> | 154 | <cstring>RescanCards_BUT</cstring> |
111 | </property> | 155 | </property> |
112 | <property stdset="1"> | 156 | <property stdset="1"> |
113 | <name>allColumnsShowFocus</name> | 157 | <name>text</name> |
114 | <bool>true</bool> | 158 | <string>Rescan</string> |
115 | </property> | 159 | </property> |
116 | </widget> | 160 | </widget> |
161 | </hbox> | ||
162 | </widget> | ||
117 | </vbox> | 163 | </vbox> |
@@ -127,2 +173,16 @@ | |||
127 | </connection> | 173 | </connection> |
174 | <connection> | ||
175 | <sender>RescanCards_BUT</sender> | ||
176 | <signal>clicked()</signal> | ||
177 | <receiver>Lancard_FRM</receiver> | ||
178 | <slot>SLOT_ScanCards()</slot> | ||
179 | </connection> | ||
180 | <connection> | ||
181 | <sender>RemoveUnknown_BUT</sender> | ||
182 | <signal>clicked()</signal> | ||
183 | <receiver>Lancard_FRM</receiver> | ||
184 | <slot>SLOT_RemoveUnknown()</slot> | ||
185 | </connection> | ||
186 | <slot access="public">SLOT_ScanCards()</slot> | ||
187 | <slot access="public">SLOT_RemoveUnknown()</slot> | ||
128 | </connections> | 188 | </connections> |
diff --git a/noncore/settings/networksettings2/lancard/lancard_NN.cpp b/noncore/settings/networksettings2/lancard/lancard_NN.cpp index ba1c1f8..a4afab1 100644 --- a/noncore/settings/networksettings2/lancard/lancard_NN.cpp +++ b/noncore/settings/networksettings2/lancard/lancard_NN.cpp | |||
@@ -9,3 +9,3 @@ static const char * LanCardNeeds[] = | |||
9 | */ | 9 | */ |
10 | LanCardNetNode::LanCardNetNode() : ANetNode() { | 10 | LanCardNetNode::LanCardNetNode() : ANetNode(tr("LAN card")), NICMACAddresses() { |
11 | InstanceCount = 2; | 11 | InstanceCount = 2; |
@@ -71,2 +71,4 @@ void LanCardNetNode::setSpecificAttribute( QString & A, QString & V ) { | |||
71 | InstanceCount = V.toLong(); | 71 | InstanceCount = V.toLong(); |
72 | } else if ( A == "macaddress" ) { | ||
73 | NICMACAddresses.append( V ); | ||
72 | } | 74 | } |
@@ -78,2 +80,9 @@ void LanCardNetNode::saveSpecificAttribute( QTextStream & TS) { | |||
78 | << endl; | 80 | << endl; |
81 | for( QStringList::Iterator it = NICMACAddresses.begin(); | ||
82 | it != NICMACAddresses.end(); | ||
83 | ++it ) { | ||
84 | TS << "macaddress=" | ||
85 | << (*it) | ||
86 | << endl; | ||
87 | } | ||
79 | } | 88 | } |
diff --git a/noncore/settings/networksettings2/lancard/lancard_NN.h b/noncore/settings/networksettings2/lancard/lancard_NN.h index 5f2b25d..d58823c 100644 --- a/noncore/settings/networksettings2/lancard/lancard_NN.h +++ b/noncore/settings/networksettings2/lancard/lancard_NN.h | |||
@@ -3,2 +3,3 @@ | |||
3 | 3 | ||
4 | #include <qstringlist.h> | ||
4 | #include "netnode.h" | 5 | #include "netnode.h" |
@@ -19,5 +20,2 @@ public: | |||
19 | 20 | ||
20 | virtual const QString nodeName() | ||
21 | { return tr("LAN card"); } | ||
22 | |||
23 | virtual const QString nodeDescription() ; | 21 | virtual const QString nodeDescription() ; |
@@ -38,2 +36,4 @@ public: | |||
38 | virtual QString genNic( long ); | 36 | virtual QString genNic( long ); |
37 | virtual QStringList & addressesOfNIC( void ) | ||
38 | { return NICMACAddresses; } | ||
39 | 39 | ||
@@ -47,2 +47,4 @@ private: | |||
47 | 47 | ||
48 | QStringList NICMACAddresses; | ||
49 | |||
48 | }; | 50 | }; |
diff --git a/noncore/settings/networksettings2/lancard/lancard_NNI.cpp b/noncore/settings/networksettings2/lancard/lancard_NNI.cpp index 5962d52..99c033e 100644 --- a/noncore/settings/networksettings2/lancard/lancard_NNI.cpp +++ b/noncore/settings/networksettings2/lancard/lancard_NNI.cpp | |||
@@ -32,3 +32,3 @@ QWidget * ALanCard::edit( QWidget * parent ) { | |||
32 | GUI = new LanCardEdit( parent ); | 32 | GUI = new LanCardEdit( parent ); |
33 | GUI->showData( Data ); | 33 | GUI->showData( this ); |
34 | return GUI; | 34 | return GUI; |
diff --git a/noncore/settings/networksettings2/lancard/lancardedit.cpp b/noncore/settings/networksettings2/lancard/lancardedit.cpp index fa7f6dc..ffe9bf6 100644 --- a/noncore/settings/networksettings2/lancard/lancardedit.cpp +++ b/noncore/settings/networksettings2/lancard/lancardedit.cpp | |||
@@ -2,2 +2,3 @@ | |||
2 | #include <resources.h> | 2 | #include <resources.h> |
3 | #include <qarray.h> | ||
3 | #include <qlistview.h> | 4 | #include <qlistview.h> |
@@ -6,23 +7,10 @@ | |||
6 | #include <qregexp.h> | 7 | #include <qregexp.h> |
8 | |||
7 | #include "lancardedit.h" | 9 | #include "lancardedit.h" |
10 | #include "lancard_NN.h" | ||
11 | #include "lancard_NNI.h" | ||
8 | 12 | ||
9 | LanCardEdit::LanCardEdit( QWidget * Parent ) : LanCardGUI( Parent ){ | 13 | LanCardEdit::LanCardEdit( QWidget * Parent ) : LanCardGUI( Parent ){ |
10 | System & S = NSResources->system(); | ||
11 | QRegExp R( "eth[0-9]" ); | ||
12 | QCheckListItem * CLI; | ||
13 | |||
14 | LanCards_LV->header()->hide(); | 14 | LanCards_LV->header()->hide(); |
15 | 15 | ||
16 | // populate with all lancards in system | ||
17 | for( QDictIterator<InterfaceInfo> It(S.interfaces()); | ||
18 | It.current(); | ||
19 | ++It ) { | ||
20 | if( R.match( It.current()->Name ) >= 0 && | ||
21 | It.current()->CardType == ARPHRD_ETHER | ||
22 | ) { | ||
23 | CLI = new QCheckListItem( LanCards_LV, It.current()->Name, | ||
24 | QCheckListItem::CheckBox ); | ||
25 | CLI->setText( 1, It.current()->MACAddress ); | ||
26 | } | ||
27 | } | ||
28 | } | 16 | } |
@@ -33,3 +21,2 @@ QString LanCardEdit::acceptable( void ) { | |||
33 | 21 | ||
34 | |||
35 | bool LanCardEdit::commit( LanCardData & Data ) { | 22 | bool LanCardEdit::commit( LanCardData & Data ) { |
@@ -39,3 +26,7 @@ bool LanCardEdit::commit( LanCardData & Data ) { | |||
39 | if( ! Data.AnyLanCard ) { | 26 | if( ! Data.AnyLanCard ) { |
40 | // collect set of lancards that match | 27 | // take copy for orig list |
28 | QStringList NewList( Data.HWAddresses ); | ||
29 | |||
30 | // update HWAddresses to new state | ||
31 | // remove item also from NewList | ||
41 | int idx; | 32 | int idx; |
@@ -43,3 +34,3 @@ bool LanCardEdit::commit( LanCardData & Data ) { | |||
43 | while( CLI ) { | 34 | while( CLI ) { |
44 | idx = Data.HWAddresses.findIndex(CLI->text(1)); | 35 | idx = Data.HWAddresses.findIndex(CLI->text(0)); |
45 | if( CLI->isOn() ) { | 36 | if( CLI->isOn() ) { |
@@ -47,3 +38,3 @@ bool LanCardEdit::commit( LanCardData & Data ) { | |||
47 | // should be in list | 38 | // should be in list |
48 | Data.HWAddresses.append( CLI->text(1) ); | 39 | Data.HWAddresses.append( CLI->text(0) ); |
49 | SM = 1; | 40 | SM = 1; |
@@ -53,3 +44,4 @@ bool LanCardEdit::commit( LanCardData & Data ) { | |||
53 | if( idx >= 0 ) { | 44 | if( idx >= 0 ) { |
54 | Data.HWAddresses.remove( Data.HWAddresses.at(idx) ); | 45 | NewList.remove( CLI->text(0) ); |
46 | Data.HWAddresses.remove( CLI->text(0) ); | ||
55 | SM = 1; | 47 | SM = 1; |
@@ -59,29 +51,102 @@ bool LanCardEdit::commit( LanCardData & Data ) { | |||
59 | } | 51 | } |
52 | |||
53 | // if newlist still contains items. it were items | ||
54 | // that were checked but no longer are present in the system | ||
55 | SM |= ( NewList.count() > 0 ) ; | ||
60 | } | 56 | } |
61 | return SM || ContainedObsoleteMAC ; | 57 | return SM; |
62 | } | 58 | } |
63 | 59 | ||
64 | void LanCardEdit::showData( LanCardData & Data ) { | 60 | void LanCardEdit::showData( ALanCard * LC ) { |
61 | NNI = LC; | ||
62 | LanCardData & Data = *((LanCardData *)LC->data()); | ||
63 | |||
65 | AnyCard_CB->setChecked( Data.AnyLanCard ); | 64 | AnyCard_CB->setChecked( Data.AnyLanCard ); |
66 | 65 | ||
66 | // load all cards | ||
67 | populateList(); | ||
68 | |||
69 | // set checks | ||
67 | QCheckListItem * CLI = (QCheckListItem *)LanCards_LV->firstChild(); | 70 | QCheckListItem * CLI = (QCheckListItem *)LanCards_LV->firstChild(); |
71 | while( CLI ) { | ||
72 | CLI->setOn( Data.HWAddresses.findIndex(CLI->text(0)) >= 0 ); | ||
73 | CLI = (QCheckListItem *)CLI->nextSibling(); | ||
74 | } | ||
75 | } | ||
76 | |||
77 | // load all known cards in list | ||
78 | void LanCardEdit::populateList( void ) { | ||
79 | LanCardNetNode *NN = (LanCardNetNode *)NNI->nodeClass(); | ||
80 | QCheckListItem * CLI; | ||
81 | bool Found; | ||
82 | |||
83 | LanCards_LV->clear(); | ||
84 | |||
85 | for( QStringList::Iterator it = NN->addressesOfNIC().begin(); | ||
86 | it != NN->addressesOfNIC().end(); | ||
87 | ++it ) { | ||
88 | CLI = new QCheckListItem( LanCards_LV, (*it), QCheckListItem::CheckBox ); | ||
68 | 89 | ||
69 | ContainedObsoleteMAC = 0; | 90 | // check interfaces and see if this card is present |
70 | // remove obsolete address | 91 | Found = 0; |
71 | for( QStringList::Iterator it=Data.HWAddresses.begin(); | 92 | for( QDictIterator<InterfaceInfo> NIt(NSResources->system().interfaces()); |
72 | it != Data.HWAddresses.end(); | 93 | NIt.current(); |
94 | ++NIt ) { | ||
95 | if( NIt.current()->MACAddress == (*it) ) { | ||
96 | Found = 1; | ||
97 | break; | ||
98 | } | ||
99 | } | ||
100 | |||
101 | CLI->setPixmap( 0, NSResources->getPixmap( | ||
102 | (Found) ? "add" : "remove" ) ); | ||
103 | } | ||
104 | } | ||
105 | |||
106 | // rescan system for new cards | ||
107 | void LanCardEdit::SLOT_ScanCards( void ) { | ||
108 | LanCardNetNode *NN = (LanCardNetNode *)NNI->nodeClass(); | ||
109 | |||
110 | // add any NIC that is new and matches our interfacename | ||
111 | System & S = NSResources->system(); | ||
112 | QRegExp R( "eth[0-9]" ); | ||
113 | // populate with all lancards in system | ||
114 | for( QDictIterator<InterfaceInfo> It(S.interfaces()); | ||
115 | It.current(); | ||
116 | ++It ) { | ||
117 | fprintf( stderr, "TEST %s %s\n", | ||
118 | It.current()->Name.latin1(), | ||
119 | It.current()->MACAddress.latin1() ); | ||
120 | if( R.match( It.current()->Name ) >= 0 && | ||
121 | ( It.current()->CardType == ARPHRD_ETHER | ||
122 | #ifdef ARPHRD_IEEE1394 | ||
123 | || It.current()->CardType == ARPHRD_IEEE1394 | ||
124 | #endif | ||
125 | ) | ||
73 | ) { | 126 | ) { |
74 | CLI = (QCheckListItem *)LanCards_LV->firstChild(); | 127 | // old item ? |
128 | QCheckListItem * CLI = | ||
129 | (QCheckListItem *)LanCards_LV->firstChild(); | ||
75 | while( CLI ) { | 130 | while( CLI ) { |
76 | if( CLI->text(1) == (*it) ) | 131 | if( CLI->text(0) == It.current()->MACAddress ) { |
77 | // still valid | ||
78 | break; | 132 | break; |
133 | } | ||
79 | CLI = (QCheckListItem *)CLI->nextSibling(); | 134 | CLI = (QCheckListItem *)CLI->nextSibling(); |
80 | } | 135 | } |
81 | if( CLI == 0 ) { | 136 | |
82 | // address not found -> remove | 137 | if( ! CLI ) { |
83 | ContainedObsoleteMAC = 1; | 138 | // new item |
84 | Data.HWAddresses.remove( it ); | 139 | CLI = new QCheckListItem( LanCards_LV, |
85 | } else { | 140 | It.current()->MACAddress, |
86 | ++ it; | 141 | QCheckListItem::CheckBox ); |
142 | } | ||
143 | |||
144 | // mark present | ||
145 | CLI->setPixmap( 0, NSResources->getPixmap( | ||
146 | "add" ) ); | ||
147 | |||
148 | if( NN->addressesOfNIC().findIndex( It.current()->MACAddress) < 0 ) { | ||
149 | // new | ||
150 | NN->addressesOfNIC().append( It.current()->MACAddress ); | ||
151 | } | ||
87 | } | 152 | } |
@@ -89,7 +154,55 @@ void LanCardEdit::showData( LanCardData & Data ) { | |||
89 | 154 | ||
90 | // set checks | 155 | } |
156 | |||
157 | // remove all cards that are not present -> flagged with 'remove' | ||
158 | // and unchecked | ||
159 | void LanCardEdit::SLOT_RemoveUnknown( void ) { | ||
160 | QArray<QCheckListItem *> AllItems; | ||
161 | |||
162 | LanCardNetNode *NN = (LanCardNetNode *)NNI->nodeClass(); | ||
163 | |||
164 | QCheckListItem * CLI = (QCheckListItem *)LanCards_LV->firstChild(); | ||
91 | while( CLI ) { | 165 | while( CLI ) { |
92 | CLI->setOn( Data.HWAddresses.findIndex(CLI->text(1)) >= 0 ); | 166 | AllItems.resize( AllItems.size()+1 ); |
167 | AllItems[ AllItems.size()-1 ] = CLI; | ||
93 | CLI = (QCheckListItem *)CLI->nextSibling(); | 168 | CLI = (QCheckListItem *)CLI->nextSibling(); |
94 | } | 169 | } |
170 | |||
171 | // force update of system | ||
172 | System & S = NSResources->system(); | ||
173 | S.probeInterfaces(); | ||
174 | |||
175 | // add any NIC that is new and matches our interfacename | ||
176 | QRegExp R( "eth[0-9]" ); | ||
177 | |||
178 | |||
179 | for( QDictIterator<InterfaceInfo> It(S.interfaces()); | ||
180 | It.current(); | ||
181 | ++It ) { | ||
182 | if( R.match( It.current()->Name ) >= 0 && | ||
183 | ( It.current()->CardType == ARPHRD_ETHER | ||
184 | #ifdef ARPHRD_IEEE1394 | ||
185 | || It.current()->CardType == ARPHRD_IEEE1394 | ||
186 | #endif | ||
187 | ) | ||
188 | ) { | ||
189 | |||
190 | for ( unsigned i = 0; i< AllItems.size(); i++ ) { | ||
191 | if( AllItems[i] && | ||
192 | AllItems[i]->text(0) == It.current()->MACAddress ) { | ||
193 | AllItems[i] = 0; | ||
194 | break; | ||
195 | } | ||
196 | } | ||
197 | } | ||
198 | } | ||
199 | |||
200 | // AllItems now contains all cards NOT present | ||
201 | // remove all items non null and not ON | ||
202 | for ( unsigned i = 0; i< AllItems.size(); i++ ) { | ||
203 | if( AllItems[i] && ! AllItems[i]->isOn() ) { | ||
204 | NN->addressesOfNIC().remove( AllItems[i]->text(0) ); | ||
205 | delete AllItems[i]; | ||
206 | } | ||
207 | } | ||
95 | } | 208 | } |
diff --git a/noncore/settings/networksettings2/lancard/lancardedit.h b/noncore/settings/networksettings2/lancard/lancardedit.h index 8def789..282db1f 100644 --- a/noncore/settings/networksettings2/lancard/lancardedit.h +++ b/noncore/settings/networksettings2/lancard/lancardedit.h | |||
@@ -3,2 +3,4 @@ | |||
3 | 3 | ||
4 | class ALanCard; | ||
5 | |||
4 | class LanCardEdit : public LanCardGUI { | 6 | class LanCardEdit : public LanCardGUI { |
@@ -10,3 +12,8 @@ public : | |||
10 | bool commit( LanCardData & Data ); | 12 | bool commit( LanCardData & Data ); |
11 | void showData( LanCardData & Data ); | 13 | void showData( ALanCard * NNI ); |
14 | |||
15 | public slots : | ||
16 | |||
17 | void SLOT_ScanCards( void ); | ||
18 | void SLOT_RemoveUnknown( void ); | ||
12 | 19 | ||
@@ -14,3 +21,4 @@ private : | |||
14 | 21 | ||
15 | bool ContainedObsoleteMAC; | 22 | void populateList( void ); |
23 | ALanCard * NNI; | ||
16 | }; | 24 | }; |
diff --git a/noncore/settings/networksettings2/lancard/lancardrun.cpp b/noncore/settings/networksettings2/lancard/lancardrun.cpp index 951756d..2e4fc43 100644 --- a/noncore/settings/networksettings2/lancard/lancardrun.cpp +++ b/noncore/settings/networksettings2/lancard/lancardrun.cpp | |||
@@ -2,2 +2,3 @@ | |||
2 | #include <qtextstream.h> | 2 | #include <qtextstream.h> |
3 | #include <qstringlist.h> | ||
3 | #include <resources.h> | 4 | #include <resources.h> |
@@ -55,4 +56,8 @@ void LanCardRun::detectState( NodeCollection * NC ) { | |||
55 | Run = It.current(); | 56 | Run = It.current(); |
56 | if( handlesInterface( Run->Name ) && | 57 | if( handlesInterface( *Run ) && |
57 | Run->CardType == ARPHRD_ETHER && | 58 | ( Run->CardType == ARPHRD_ETHER |
59 | #ifdef ARPHRD_IEEE1394 | ||
60 | || Run->CardType == ARPHRD_IEEE1394 | ||
61 | #endif | ||
62 | ) && | ||
58 | ! Run->IsUp | 63 | ! Run->IsUp |
@@ -147,4 +152,8 @@ InterfaceInfo * LanCardRun::getInterface( void ) { | |||
147 | Run = It.current(); | 152 | Run = It.current(); |
148 | if( handlesInterface( Run->Name ) && | 153 | if( handlesInterface( *Run ) && |
149 | Run->CardType == ARPHRD_ETHER | 154 | ( Run->CardType == ARPHRD_ETHER |
155 | #ifdef ARPHRD_IEEE1394 | ||
156 | || Run->CardType == ARPHRD_IEEE1394 | ||
157 | #endif | ||
158 | ) | ||
150 | ) { | 159 | ) { |
@@ -164,3 +173,20 @@ InterfaceInfo * LanCardRun::getInterface( void ) { | |||
164 | bool LanCardRun::handlesInterface( const QString & S ) { | 173 | bool LanCardRun::handlesInterface( const QString & S ) { |
174 | InterfaceInfo * II; | ||
175 | II = NSResources->system().interface( S ); | ||
176 | if( ( II = NSResources->system().interface( S ) ) ) { | ||
177 | return handlesInterface( *II ); | ||
178 | } | ||
165 | return Pat.match( S ) >= 0; | 179 | return Pat.match( S ) >= 0; |
166 | } | 180 | } |
181 | |||
182 | bool LanCardRun::handlesInterface( const InterfaceInfo & II ) { | ||
183 | if( Pat.match( II.Name ) < 0 ) | ||
184 | return 0; | ||
185 | |||
186 | if( Data->AnyLanCard ) { | ||
187 | return 1; | ||
188 | } | ||
189 | |||
190 | // must also match hardware address | ||
191 | return ( Data->HWAddresses.findIndex( II.MACAddress ) >= 0 ); | ||
192 | } | ||
diff --git a/noncore/settings/networksettings2/lancard/lancardrun.h b/noncore/settings/networksettings2/lancard/lancardrun.h index 499b417..e8a535a 100644 --- a/noncore/settings/networksettings2/lancard/lancardrun.h +++ b/noncore/settings/networksettings2/lancard/lancardrun.h | |||
@@ -12,5 +12,5 @@ public : | |||
12 | LanCardRun( ANetNodeInstance * NNI, | 12 | LanCardRun( ANetNodeInstance * NNI, |
13 | LanCardData & Data ) : AsDevice( NNI ), | 13 | LanCardData & D ) : AsDevice( NNI ), |
14 | Pat( "eth[0-9]" ) | 14 | Pat( "eth[0-9]" ) |
15 | { } | 15 | { Data = &D; } |
16 | 16 | ||
@@ -29,2 +29,3 @@ protected : | |||
29 | bool handlesInterface( const QString & I ); | 29 | bool handlesInterface( const QString & I ); |
30 | bool handlesInterface( const InterfaceInfo & II ); | ||
30 | 31 | ||
@@ -34,2 +35,3 @@ private : | |||
34 | QRegExp Pat; | 35 | QRegExp Pat; |
36 | LanCardData * Data; | ||
35 | 37 | ||