Diffstat (limited to 'noncore/settings/networksettings2/wlan') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/wlan/wlan_NN.cpp | 29 | ||||
-rw-r--r-- | noncore/settings/networksettings2/wlan/wlan_NN.h | 12 | ||||
-rw-r--r-- | noncore/settings/networksettings2/wlan/wlan_NNI.cpp | 16 | ||||
-rw-r--r-- | noncore/settings/networksettings2/wlan/wlan_NNI.h | 6 | ||||
-rw-r--r-- | noncore/settings/networksettings2/wlan/wlanrun.h | 4 |
5 files changed, 34 insertions, 33 deletions
diff --git a/noncore/settings/networksettings2/wlan/wlan_NN.cpp b/noncore/settings/networksettings2/wlan/wlan_NN.cpp index e1e20c0..4e59ac1 100644 --- a/noncore/settings/networksettings2/wlan/wlan_NN.cpp +++ b/noncore/settings/networksettings2/wlan/wlan_NN.cpp | |||
@@ -39,28 +39,33 @@ const char * WLanNetNode::provides( void ) { | |||
39 | 39 | ||
40 | bool WLanNetNode::generateProperFilesFor( | 40 | bool WLanNetNode::generateProperFilesFor( |
41 | ANetNodeInstance * ) { | 41 | ANetNodeInstance * ) { |
42 | return 1; | 42 | return 1; |
43 | } | 43 | } |
44 | 44 | ||
45 | bool WLanNetNode::hasDataFor( const QString & S, bool DS ) { | 45 | bool WLanNetNode::hasDataFor( const QString & S ) { |
46 | return DS && S == "interfaces"; | 46 | return S == "interfaces"; |
47 | } | ||
48 | |||
49 | bool WLanNetNode::generateDataForCommonFile( | ||
50 | SystemFile &, | ||
51 | long , | ||
52 | ANetNodeInstance * ) { | ||
53 | return 1; | ||
54 | } | 47 | } |
55 | 48 | ||
56 | bool WLanNetNode::generateDeviceDataForCommonFile( | 49 | bool WLanNetNode::generateDeviceDataForCommonFile( |
57 | SystemFile & S, | 50 | SystemFile & S, |
58 | long DevNr, | 51 | long DevNr ) { |
59 | ANetNodeInstance * NNI ) { | 52 | QString NIC = genNic( DevNr ); |
60 | return ((AWLan *)NNI)->generateDeviceDataForCommonFile(S, DevNr); | 53 | |
54 | if( S.name() == "interfaces" ) { | ||
55 | // generate mapping stanza for this interface | ||
56 | S << "# check if " << NIC << " can be brought UP" << endl; | ||
57 | S << "mapping " << NIC << endl; | ||
58 | S << " script networksettings2-request" << endl << endl; | ||
59 | } | ||
60 | return 0; | ||
61 | } | ||
62 | |||
63 | QString WLanNetNode::genNic( long nr ) { | ||
64 | QString S; | ||
65 | return S.sprintf( "wlan%ld", nr ); | ||
61 | } | 66 | } |
62 | 67 | ||
63 | extern "C" { | 68 | extern "C" { |
64 | void create_plugin( QList<ANetNode> & PNN ) { | 69 | void create_plugin( QList<ANetNode> & PNN ) { |
65 | PNN.append( new WLanNetNode() ); | 70 | PNN.append( new WLanNetNode() ); |
66 | } | 71 | } |
diff --git a/noncore/settings/networksettings2/wlan/wlan_NN.h b/noncore/settings/networksettings2/wlan/wlan_NN.h index 9111995..f27e71c 100644 --- a/noncore/settings/networksettings2/wlan/wlan_NN.h +++ b/noncore/settings/networksettings2/wlan/wlan_NN.h | |||
@@ -25,17 +25,21 @@ 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 | virtual bool hasDataFor( const QString & S, bool DS ); | 31 | |
32 | virtual bool generateDataForCommonFile( | 32 | virtual bool hasDataFor( const QString & S ); |
33 | SystemFile & SF, long DevNr, ANetNodeInstance * NNI ); | ||
34 | virtual bool generateDeviceDataForCommonFile( | 33 | virtual bool generateDeviceDataForCommonFile( |
35 | SystemFile & SF, long DevNr, ANetNodeInstance * NNI ); | 34 | SystemFile & SF, long DevNr ); |
35 | |||
36 | virtual long instanceCount( void ) | ||
37 | { return 2; } | ||
38 | |||
39 | virtual QString genNic( long ); | ||
36 | 40 | ||
37 | private: | 41 | private: |
38 | 42 | ||
39 | }; | 43 | }; |
40 | 44 | ||
41 | extern "C" | 45 | extern "C" |
diff --git a/noncore/settings/networksettings2/wlan/wlan_NNI.cpp b/noncore/settings/networksettings2/wlan/wlan_NNI.cpp index 8b948e0..78e756c 100644 --- a/noncore/settings/networksettings2/wlan/wlan_NNI.cpp +++ b/noncore/settings/networksettings2/wlan/wlan_NNI.cpp | |||
@@ -25,18 +25,12 @@ QString AWLan::acceptable( void ) { | |||
25 | 25 | ||
26 | void AWLan::commit( void ) { | 26 | void AWLan::commit( void ) { |
27 | if( GUI && GUI->commit( Data ) ) | 27 | if( GUI && GUI->commit( Data ) ) |
28 | setModified( 1 ); | 28 | setModified( 1 ); |
29 | } | 29 | } |
30 | 30 | ||
31 | bool AWLan::generateDeviceDataForCommonFile( SystemFile & S, long DevNr ) { | 31 | bool AWLan::generateDataForCommonFile( |
32 | AsDevice * Dev = runtime()->device(); | 32 | SystemFile &, |
33 | QString NIC = Dev->genNic( DevNr ); | 33 | long ) { |
34 | 34 | return 1; | |
35 | if( S.name() == "interfaces" ) { | ||
36 | // generate mapping stanza for this interface | ||
37 | S << "# check if " << NIC << " can be brought UP" << endl; | ||
38 | S << "mapping " << NIC << endl; | ||
39 | S << " script networksettings2-request" << endl << endl; | ||
40 | } | ||
41 | return 0; | ||
42 | } | 35 | } |
36 | |||
diff --git a/noncore/settings/networksettings2/wlan/wlan_NNI.h b/noncore/settings/networksettings2/wlan/wlan_NNI.h index e464c84..d861d13 100644 --- a/noncore/settings/networksettings2/wlan/wlan_NNI.h +++ b/noncore/settings/networksettings2/wlan/wlan_NNI.h | |||
@@ -24,14 +24,16 @@ public : | |||
24 | return RT; | 24 | return RT; |
25 | } | 25 | } |
26 | 26 | ||
27 | virtual void * data( void ) | 27 | virtual void * data( void ) |
28 | { return (void *)&Data; } | 28 | { return (void *)&Data; } |
29 | 29 | ||
30 | bool generateDeviceDataForCommonFile( SystemFile & S, long DevNr ); | 30 | virtual bool hasDataFor( const QString & ) |
31 | 31 | { return 0; } | |
32 | virtual bool generateDataForCommonFile( | ||
33 | SystemFile & SF, long DevNr ); | ||
32 | protected : | 34 | protected : |
33 | 35 | ||
34 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); | 36 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); |
35 | virtual void saveSpecificAttribute( QTextStream & TS ); | 37 | virtual void saveSpecificAttribute( QTextStream & TS ); |
36 | 38 | ||
37 | private : | 39 | private : |
diff --git a/noncore/settings/networksettings2/wlan/wlanrun.h b/noncore/settings/networksettings2/wlan/wlanrun.h index b853262..f46bcb7 100644 --- a/noncore/settings/networksettings2/wlan/wlanrun.h +++ b/noncore/settings/networksettings2/wlan/wlanrun.h | |||
@@ -11,16 +11,12 @@ public : | |||
11 | 11 | ||
12 | WLanRun( ANetNodeInstance * NNI, WLanData & Data ) : | 12 | WLanRun( ANetNodeInstance * NNI, WLanData & Data ) : |
13 | AsDevice( NNI ), | 13 | AsDevice( NNI ), |
14 | Pat( "wlan[0-9]" ) | 14 | Pat( "wlan[0-9]" ) |
15 | { } | 15 | { } |
16 | 16 | ||
17 | virtual long count( void ) | ||
18 | { return 2; } | ||
19 | virtual QString genNic( long nr ) | ||
20 | { QString S; return S.sprintf( "wlan%ld", nr ); } | ||
21 | virtual AsDevice * device( void ) | 17 | virtual AsDevice * device( void ) |
22 | { return (AsDevice *)this; } | 18 | { return (AsDevice *)this; } |
23 | virtual AsDevice * asDevice( void ) | 19 | virtual AsDevice * asDevice( void ) |
24 | { return (AsDevice *)this; } | 20 | { return (AsDevice *)this; } |
25 | 21 | ||
26 | protected : | 22 | protected : |