summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/wlan/wlan_NN.cpp
blob: 36a5c332a541d762214fa3db9081449ad228ecca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include <resources.h>
#include "wlan_NN.h"
#include "wlan_NNI.h"

static const char * WLanNeeds[] = 
    { 0
    };

static const char * WLanProvides[] = 
    { "device",
      0
    };

/**
 * Constructor, find all of the possible interfaces
 */
WLanNetNode::WLanNetNode() : ANetNode(tr("WLan Device")) {
    NSResources->addSystemFile(
      "interfaces", "/etc/network/interfaces", 1 );
    InstanceCount = 2;
}

/**
 * Delete any interfaces that we own.
 */
WLanNetNode::~WLanNetNode(){
}

const QString WLanNetNode::nodeDescription(){
      return tr("\
<p>Configure Wi/Fi or WLan network cards.</p>\
<p>Defines Wireless options for those cards</p>\
"
);
}

ANetNodeInstance * WLanNetNode::createInstance( void ) {
      return new AWLan( this );
}

const char ** WLanNetNode::needs( void ) {
      return WLanNeeds;
}

const char ** WLanNetNode::provides( void ) {
      return WLanProvides;
}

QString WLanNetNode::genNic( long nr ) { 
      QString S; 
      return S.sprintf( "wlan%ld", nr );
}

void WLanNetNode::setSpecificAttribute( QString & A, QString & V ) {
      if( A == "interfacecount" ) {
        InstanceCount = V.toLong();
      }
}

void WLanNetNode::saveSpecificAttribute( QTextStream & TS ) {
      TS << "interfacecount="
         << InstanceCount
         << endl;
}

extern "C" {
void create_plugin( QList<ANetNode> & PNN ) {
      PNN.append( new WLanNetNode() );
}
}