summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/wlan
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/wlan') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings2/wlan/wlan_NN.cpp13
-rw-r--r--noncore/settings/networksettings2/wlan/wlan_NN.h8
2 files changed, 20 insertions, 1 deletions
diff --git a/noncore/settings/networksettings2/wlan/wlan_NN.cpp b/noncore/settings/networksettings2/wlan/wlan_NN.cpp
index 4e59ac1..e0c4db2 100644
--- a/noncore/settings/networksettings2/wlan/wlan_NN.cpp
+++ b/noncore/settings/networksettings2/wlan/wlan_NN.cpp
@@ -1,23 +1,24 @@
1#include "wlan_NN.h" 1#include "wlan_NN.h"
2#include "wlan_NNI.h" 2#include "wlan_NNI.h"
3 3
4static const char * WLanNeeds[] = 4static const char * WLanNeeds[] =
5 { 0 5 { 0
6 }; 6 };
7 7
8/** 8/**
9 * Constructor, find all of the possible interfaces 9 * Constructor, find all of the possible interfaces
10 */ 10 */
11WLanNetNode::WLanNetNode() : ANetNode() { 11WLanNetNode::WLanNetNode() : ANetNode() {
12 InstanceCount = 2;
12} 13}
13 14
14/** 15/**
15 * Delete any interfaces that we own. 16 * Delete any interfaces that we own.
16 */ 17 */
17WLanNetNode::~WLanNetNode(){ 18WLanNetNode::~WLanNetNode(){
18} 19}
19 20
20const QString WLanNetNode::nodeDescription(){ 21const QString WLanNetNode::nodeDescription(){
21 return tr("\ 22 return tr("\
22<p>Configure Wi/Fi or WLan network cards.</p>\ 23<p>Configure Wi/Fi or WLan network cards.</p>\
23<p>Defines Wireless options for those cards</p>\ 24<p>Defines Wireless options for those cards</p>\
@@ -56,17 +57,29 @@ bool WLanNetNode::generateDeviceDataForCommonFile(
56 S << "# check if " << NIC << " can be brought UP" << endl; 57 S << "# check if " << NIC << " can be brought UP" << endl;
57 S << "mapping " << NIC << endl; 58 S << "mapping " << NIC << endl;
58 S << " script networksettings2-request" << endl << endl; 59 S << " script networksettings2-request" << endl << endl;
59 } 60 }
60 return 0; 61 return 0;
61} 62}
62 63
63QString WLanNetNode::genNic( long nr ) { 64QString WLanNetNode::genNic( long nr ) {
64 QString S; 65 QString S;
65 return S.sprintf( "wlan%ld", nr ); 66 return S.sprintf( "wlan%ld", nr );
66} 67}
67 68
69void WLanNetNode::setSpecificAttribute( QString & A, QString & V ) {
70 if( A == "interfacecount" ) {
71 InstanceCount = V.toLong();
72 }
73}
74
75void WLanNetNode::saveSpecificAttribute( QTextStream & TS ) {
76 TS << "interfacecount="
77 << InstanceCount
78 << endl;
79}
80
68extern "C" { 81extern "C" {
69void create_plugin( QList<ANetNode> & PNN ) { 82void create_plugin( QList<ANetNode> & PNN ) {
70 PNN.append( new WLanNetNode() ); 83 PNN.append( new WLanNetNode() );
71} 84}
72} 85}
diff --git a/noncore/settings/networksettings2/wlan/wlan_NN.h b/noncore/settings/networksettings2/wlan/wlan_NN.h
index f27e71c..e93a89a 100644
--- a/noncore/settings/networksettings2/wlan/wlan_NN.h
+++ b/noncore/settings/networksettings2/wlan/wlan_NN.h
@@ -25,26 +25,32 @@ public:
25 virtual ANetNodeInstance * createInstance( void ); 25 virtual ANetNodeInstance * createInstance( void );
26 26
27 virtual const char ** needs( void ); 27 virtual const char ** needs( void );
28 virtual const char * provides( void ); 28 virtual const char * provides( void );
29 29
30 virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); 30 virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
31 31
32 virtual bool hasDataFor( const QString & S ); 32 virtual bool hasDataFor( const QString & S );
33 virtual bool generateDeviceDataForCommonFile( 33 virtual bool generateDeviceDataForCommonFile(
34 SystemFile & SF, long DevNr ); 34 SystemFile & SF, long DevNr );
35 35
36 virtual long instanceCount( void ) 36 virtual long instanceCount( void )
37 { return 2; } 37 { return InstanceCount; }
38 38
39 virtual QString genNic( long ); 39 virtual QString genNic( long );
40 40
41private: 41private:
42 42
43 virtual void setSpecificAttribute( QString & Attr, QString & Value );
44 virtual void saveSpecificAttribute( QTextStream & TS );
45
46 // number of interfaces for this device
47 long InstanceCount;
48
43}; 49};
44 50
45extern "C" 51extern "C"
46{ 52{
47 void create_plugin( QList<ANetNode> & PNN ); 53 void create_plugin( QList<ANetNode> & PNN );
48}; 54};
49 55
50#endif 56#endif