Diffstat (limited to 'noncore/settings/networksettings2/wlan') (more/less context) (show whitespace changes)
5 files changed, 29 insertions, 4 deletions
diff --git a/noncore/settings/networksettings2/wlan/wlan_NN.cpp b/noncore/settings/networksettings2/wlan/wlan_NN.cpp index 5a26e41..e1e20c0 100644 --- a/noncore/settings/networksettings2/wlan/wlan_NN.cpp +++ b/noncore/settings/networksettings2/wlan/wlan_NN.cpp | |||
@@ -33,28 +33,35 @@ const char ** WLanNetNode::needs( void ) { | |||
33 | return WLanNeeds; | 33 | return WLanNeeds; |
34 | } | 34 | } |
35 | 35 | ||
36 | const char * WLanNetNode::provides( void ) { | 36 | const char * WLanNetNode::provides( void ) { |
37 | return "device"; | 37 | return "device"; |
38 | } | 38 | } |
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 & ) { | 45 | bool WLanNetNode::hasDataFor( const QString & S, bool DS ) { |
46 | return 0; | 46 | return DS && S == "interfaces"; |
47 | } | 47 | } |
48 | 48 | ||
49 | bool WLanNetNode::generateDataForCommonFile( | 49 | bool WLanNetNode::generateDataForCommonFile( |
50 | SystemFile & , | 50 | SystemFile & , |
51 | long, | 51 | long, |
52 | ANetNodeInstance * ) { | 52 | ANetNodeInstance * ) { |
53 | return 1; | 53 | return 1; |
54 | } | 54 | } |
55 | 55 | ||
56 | bool WLanNetNode::generateDeviceDataForCommonFile( | ||
57 | SystemFile & S, | ||
58 | long DevNr, | ||
59 | ANetNodeInstance * NNI ) { | ||
60 | return ((AWLan *)NNI)->generateDeviceDataForCommonFile(S, DevNr); | ||
61 | } | ||
62 | |||
56 | extern "C" { | 63 | extern "C" { |
57 | void create_plugin( QList<ANetNode> & PNN ) { | 64 | void create_plugin( QList<ANetNode> & PNN ) { |
58 | PNN.append( new WLanNetNode() ); | 65 | PNN.append( new WLanNetNode() ); |
59 | } | 66 | } |
60 | } | 67 | } |
diff --git a/noncore/settings/networksettings2/wlan/wlan_NN.h b/noncore/settings/networksettings2/wlan/wlan_NN.h index 0728a79..9111995 100644 --- a/noncore/settings/networksettings2/wlan/wlan_NN.h +++ b/noncore/settings/networksettings2/wlan/wlan_NN.h | |||
@@ -19,26 +19,28 @@ public: | |||
19 | 19 | ||
20 | virtual const QString nodeName() | 20 | virtual const QString nodeName() |
21 | { return tr("WLan Device"); } | 21 | { return tr("WLan Device"); } |
22 | 22 | ||
23 | virtual const QString nodeDescription() ; | 23 | virtual const QString nodeDescription() ; |
24 | 24 | ||
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 ); | 31 | virtual bool hasDataFor( const QString & S, bool DS ); |
32 | virtual bool generateDataForCommonFile( | 32 | virtual bool generateDataForCommonFile( |
33 | SystemFile & SF, long DevNr, ANetNodeInstance * NNI ); | 33 | SystemFile & SF, long DevNr, ANetNodeInstance * NNI ); |
34 | virtual bool generateDeviceDataForCommonFile( | ||
35 | SystemFile & SF, long DevNr, ANetNodeInstance * NNI ); | ||
34 | 36 | ||
35 | private: | 37 | private: |
36 | 38 | ||
37 | }; | 39 | }; |
38 | 40 | ||
39 | extern "C" | 41 | extern "C" |
40 | { | 42 | { |
41 | void create_plugin( QList<ANetNode> & PNN ); | 43 | void create_plugin( QList<ANetNode> & PNN ); |
42 | }; | 44 | }; |
43 | 45 | ||
44 | #endif | 46 | #endif |
diff --git a/noncore/settings/networksettings2/wlan/wlan_NNI.cpp b/noncore/settings/networksettings2/wlan/wlan_NNI.cpp index 92f3457..8b948e0 100644 --- a/noncore/settings/networksettings2/wlan/wlan_NNI.cpp +++ b/noncore/settings/networksettings2/wlan/wlan_NNI.cpp | |||
@@ -19,12 +19,24 @@ QWidget * AWLan::edit( QWidget * parent ) { | |||
19 | return GUI; | 19 | return GUI; |
20 | } | 20 | } |
21 | 21 | ||
22 | QString AWLan::acceptable( void ) { | 22 | QString AWLan::acceptable( void ) { |
23 | return ( GUI ) ? GUI->acceptable( ) : QString(); | 23 | return ( GUI ) ? GUI->acceptable( ) : QString(); |
24 | } | 24 | } |
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 ) { | ||
32 | AsDevice * Dev = runtime()->device(); | ||
33 | QString NIC = Dev->genNic( DevNr ); | ||
34 | |||
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 | } | ||
diff --git a/noncore/settings/networksettings2/wlan/wlan_NNI.h b/noncore/settings/networksettings2/wlan/wlan_NNI.h index 8b695b5..e464c84 100644 --- a/noncore/settings/networksettings2/wlan/wlan_NNI.h +++ b/noncore/settings/networksettings2/wlan/wlan_NNI.h | |||
@@ -18,24 +18,26 @@ public : | |||
18 | QString acceptable( void ); | 18 | QString acceptable( void ); |
19 | void commit( void ); | 19 | void commit( void ); |
20 | 20 | ||
21 | RuntimeInfo * runtime( void ) | 21 | RuntimeInfo * runtime( void ) |
22 | { if( RT == 0 ) | 22 | { if( RT == 0 ) |
23 | RT = new WLanRun( this, Data ); | 23 | RT = new WLanRun( this, Data ); |
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 ); | ||
31 | |||
30 | protected : | 32 | protected : |
31 | 33 | ||
32 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); | 34 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); |
33 | virtual void saveSpecificAttribute( QTextStream & TS ); | 35 | virtual void saveSpecificAttribute( QTextStream & TS ); |
34 | 36 | ||
35 | private : | 37 | private : |
36 | 38 | ||
37 | WLanEdit * GUI; | 39 | WLanEdit * GUI; |
38 | WLanData Data; | 40 | WLanData Data; |
39 | WLanRun * RT; | 41 | WLanRun * RT; |
40 | 42 | ||
41 | }; | 43 | }; |
diff --git a/noncore/settings/networksettings2/wlan/wlanrun.h b/noncore/settings/networksettings2/wlan/wlanrun.h index 4cbb059..b853262 100644 --- a/noncore/settings/networksettings2/wlan/wlanrun.h +++ b/noncore/settings/networksettings2/wlan/wlanrun.h | |||
@@ -10,25 +10,27 @@ class WLanRun : public AsDevice { | |||
10 | public : | 10 | 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 ) | 17 | virtual long count( void ) |
18 | { return 2; } | 18 | { return 2; } |
19 | virtual QString genNic( long nr ) | 19 | virtual QString genNic( long nr ) |
20 | { QString S; return S.sprintf( "wlan%ld", nr ); } | 20 | { QString S; return S.sprintf( "wlan%ld", nr ); } |
21 | virtual AsDevice * device( void ) | 21 | virtual AsDevice * device( void ) |
22 | { return asDevice(); } | 22 | { return (AsDevice *)this; } |
23 | virtual AsDevice * asDevice( void ) | ||
24 | { return (AsDevice *)this; } | ||
23 | 25 | ||
24 | protected : | 26 | protected : |
25 | 27 | ||
26 | void detectState( NodeCollection * ) | 28 | void detectState( NodeCollection * ) |
27 | { } | 29 | { } |
28 | 30 | ||
29 | bool setState( NodeCollection *, Action_t ) | 31 | bool setState( NodeCollection *, Action_t ) |
30 | { return 0; } | 32 | { return 0; } |
31 | 33 | ||
32 | bool canSetState( State_t, Action_t ) | 34 | bool canSetState( State_t, Action_t ) |
33 | { return 0; } | 35 | { return 0; } |
34 | 36 | ||