summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/wlan/wlan_NN.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/wlan/wlan_NN.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/wlan/wlan_NN.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/noncore/settings/networksettings2/wlan/wlan_NN.cpp b/noncore/settings/networksettings2/wlan/wlan_NN.cpp
index e4c3f60..36a5c33 100644
--- a/noncore/settings/networksettings2/wlan/wlan_NN.cpp
+++ b/noncore/settings/networksettings2/wlan/wlan_NN.cpp
@@ -1,62 +1,70 @@
1#include <resources.h>
1#include "wlan_NN.h" 2#include "wlan_NN.h"
2#include "wlan_NNI.h" 3#include "wlan_NNI.h"
3 4
4static const char * WLanNeeds[] = 5static const char * WLanNeeds[] =
5 { 0 6 { 0
6 }; 7 };
7 8
9static const char * WLanProvides[] =
10 { "device",
11 0
12 };
13
8/** 14/**
9 * Constructor, find all of the possible interfaces 15 * Constructor, find all of the possible interfaces
10 */ 16 */
11WLanNetNode::WLanNetNode() : ANetNode(tr("WLan Device")) { 17WLanNetNode::WLanNetNode() : ANetNode(tr("WLan Device")) {
18 NSResources->addSystemFile(
19 "interfaces", "/etc/network/interfaces", 1 );
12 InstanceCount = 2; 20 InstanceCount = 2;
13} 21}
14 22
15/** 23/**
16 * Delete any interfaces that we own. 24 * Delete any interfaces that we own.
17 */ 25 */
18WLanNetNode::~WLanNetNode(){ 26WLanNetNode::~WLanNetNode(){
19} 27}
20 28
21const QString WLanNetNode::nodeDescription(){ 29const QString WLanNetNode::nodeDescription(){
22 return tr("\ 30 return tr("\
23<p>Configure Wi/Fi or WLan network cards.</p>\ 31<p>Configure Wi/Fi or WLan network cards.</p>\
24<p>Defines Wireless options for those cards</p>\ 32<p>Defines Wireless options for those cards</p>\
25" 33"
26); 34);
27} 35}
28 36
29ANetNodeInstance * WLanNetNode::createInstance( void ) { 37ANetNodeInstance * WLanNetNode::createInstance( void ) {
30 return new AWLan( this ); 38 return new AWLan( this );
31} 39}
32 40
33const char ** WLanNetNode::needs( void ) { 41const char ** WLanNetNode::needs( void ) {
34 return WLanNeeds; 42 return WLanNeeds;
35} 43}
36 44
37const char * WLanNetNode::provides( void ) { 45const char ** WLanNetNode::provides( void ) {
38 return "device"; 46 return WLanProvides;
39} 47}
40 48
41QString WLanNetNode::genNic( long nr ) { 49QString WLanNetNode::genNic( long nr ) {
42 QString S; 50 QString S;
43 return S.sprintf( "wlan%ld", nr ); 51 return S.sprintf( "wlan%ld", nr );
44} 52}
45 53
46void WLanNetNode::setSpecificAttribute( QString & A, QString & V ) { 54void WLanNetNode::setSpecificAttribute( QString & A, QString & V ) {
47 if( A == "interfacecount" ) { 55 if( A == "interfacecount" ) {
48 InstanceCount = V.toLong(); 56 InstanceCount = V.toLong();
49 } 57 }
50} 58}
51 59
52void WLanNetNode::saveSpecificAttribute( QTextStream & TS ) { 60void WLanNetNode::saveSpecificAttribute( QTextStream & TS ) {
53 TS << "interfacecount=" 61 TS << "interfacecount="
54 << InstanceCount 62 << InstanceCount
55 << endl; 63 << endl;
56} 64}
57 65
58extern "C" { 66extern "C" {
59void create_plugin( QList<ANetNode> & PNN ) { 67void create_plugin( QList<ANetNode> & PNN ) {
60 PNN.append( new WLanNetNode() ); 68 PNN.append( new WLanNetNode() );
61} 69}
62} 70}