author | wimpie <wimpie> | 2004-04-04 15:23:16 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2004-04-04 15:23:16 (UTC) |
commit | fd9146de7698a796659b68606429da490f817138 (patch) (unidiff) | |
tree | f026bf2a7adcaaa3a0dd0429e7474f536787253d /noncore/settings/networksettings2/wlan | |
parent | 5b52572e2ec9f0f6f39706aceb9ec1e98440fd3d (diff) | |
download | opie-fd9146de7698a796659b68606429da490f817138.zip opie-fd9146de7698a796659b68606429da490f817138.tar.gz opie-fd9146de7698a796659b68606429da490f817138.tar.bz2 |
Many changes
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 | |||
@@ -33,35 +33,40 @@ 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 & 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 | } |
67 | } | 72 | } |
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 | |||
@@ -19,28 +19,32 @@ 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, 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" |
42 | { | 46 | { |
43 | void create_plugin( QList<ANetNode> & PNN ); | 47 | void create_plugin( QList<ANetNode> & PNN ); |
44 | }; | 48 | }; |
45 | 49 | ||
46 | #endif | 50 | #endif |
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 | |||
@@ -19,24 +19,18 @@ 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 ) { | 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 | |||
@@ -18,26 +18,28 @@ 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 ); | 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 : |
38 | 40 | ||
39 | WLanEdit * GUI; | 41 | WLanEdit * GUI; |
40 | WLanData Data; | 42 | WLanData Data; |
41 | WLanRun * RT; | 43 | WLanRun * RT; |
42 | 44 | ||
43 | }; | 45 | }; |
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 | |||
@@ -5,28 +5,24 @@ | |||
5 | #include <asdevice.h> | 5 | #include <asdevice.h> |
6 | #include "wlandata.h" | 6 | #include "wlandata.h" |
7 | 7 | ||
8 | class WLanRun : public AsDevice { | 8 | class WLanRun : public AsDevice { |
9 | 9 | ||
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 ) | ||
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 : |
27 | 23 | ||
28 | void detectState( NodeCollection * ) | 24 | void detectState( NodeCollection * ) |
29 | { } | 25 | { } |
30 | 26 | ||
31 | bool setState( NodeCollection *, Action_t ) | 27 | bool setState( NodeCollection *, Action_t ) |
32 | { return 0; } | 28 | { return 0; } |