Diffstat (limited to 'noncore/settings/networksettings2/bluetooth') (more/less context) (ignore whitespace changes)
7 files changed, 34 insertions, 108 deletions
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.cpp index d8420b9..398dcdc 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.cpp +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.cpp | |||
@@ -37,14 +37,6 @@ QString ABluetoothBNEP::acceptable( void ) { | |||
37 | } | 37 | } |
38 | 38 | ||
39 | void ABluetoothBNEP::commit( void ) { | 39 | void ABluetoothBNEP::commit( void ) { |
40 | if( GUI && GUI->commit( Data ) ) | 40 | if( GUI && GUI->commit( Data ) ) |
41 | setModified( 1 ); | 41 | setModified( 1 ); |
42 | } | 42 | } |
43 | |||
44 | bool ABluetoothBNEP::hasDataFor( const QString & ) { | ||
45 | return 0; | ||
46 | } | ||
47 | |||
48 | bool ABluetoothBNEP::generateDataForCommonFile( SystemFile & , long ){ | ||
49 | return 0; | ||
50 | } | ||
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h index bb3e7e7..1bf0f48 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h | |||
@@ -11,28 +11,24 @@ class BluetoothBNEPEdit; | |||
11 | class ABluetoothBNEP : public ANetNodeInstance { | 11 | class ABluetoothBNEP : public ANetNodeInstance { |
12 | 12 | ||
13 | public : | 13 | public : |
14 | 14 | ||
15 | ABluetoothBNEP( BluetoothBNEPNetNode * PNN ); | 15 | ABluetoothBNEP( BluetoothBNEPNetNode * PNN ); |
16 | 16 | ||
17 | RuntimeInfo * runtime( void ) | ||
18 | { return | ||
19 | ( RT ) ? RT : ( RT = new BluetoothBNEPRun( this, Data ) ); | ||
20 | } | ||
21 | |||
17 | QWidget * edit( QWidget * parent ); | 22 | QWidget * edit( QWidget * parent ); |
18 | QString acceptable( void ); | 23 | QString acceptable( void ); |
19 | void commit( void ); | 24 | void commit( void ); |
20 | 25 | ||
21 | RuntimeInfo * runtime( void ) | ||
22 | { if( RT == 0 ) | ||
23 | RT = new BluetoothBNEPRun( this, Data ); | ||
24 | return RT; | ||
25 | } | ||
26 | |||
27 | virtual void * data( void ) | 26 | virtual void * data( void ) |
28 | { return (void *)&Data; } | 27 | { return (void *)&Data; } |
29 | 28 | ||
30 | virtual bool hasDataFor( const QString & S ); | ||
31 | virtual bool generateDataForCommonFile( SystemFile & SF, long ); | ||
32 | |||
33 | protected : | 29 | protected : |
34 | 30 | ||
35 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); | 31 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); |
36 | virtual void saveSpecificAttribute( QTextStream & TS ); | 32 | virtual void saveSpecificAttribute( QTextStream & TS ); |
37 | 33 | ||
38 | private : | 34 | private : |
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.cpp b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.cpp index cff2639..7ec8288 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.cpp +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.cpp | |||
@@ -25,14 +25,6 @@ QString ABluetoothRFCOMM::acceptable( void ) { | |||
25 | } | 25 | } |
26 | 26 | ||
27 | void ABluetoothRFCOMM::commit( void ) { | 27 | void ABluetoothRFCOMM::commit( void ) { |
28 | if( GUI->commit( Data ) ) | 28 | if( GUI->commit( Data ) ) |
29 | setModified( 1 ); | 29 | setModified( 1 ); |
30 | } | 30 | } |
31 | |||
32 | bool ABluetoothRFCOMM::hasDataFor( const QString & ) { | ||
33 | return 0; | ||
34 | } | ||
35 | |||
36 | bool ABluetoothRFCOMM::generateDataForCommonFile( SystemFile & , long ){ | ||
37 | return 0; | ||
38 | } | ||
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h index 97bd29c..820fc17 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h | |||
@@ -11,28 +11,24 @@ class BluetoothRFCOMMEdit; | |||
11 | class ABluetoothRFCOMM : public ANetNodeInstance { | 11 | class ABluetoothRFCOMM : public ANetNodeInstance { |
12 | 12 | ||
13 | public : | 13 | public : |
14 | 14 | ||
15 | ABluetoothRFCOMM( BluetoothRFCOMMNetNode * PNN ); | 15 | ABluetoothRFCOMM( BluetoothRFCOMMNetNode * PNN ); |
16 | 16 | ||
17 | RuntimeInfo * runtime( void ) | ||
18 | { return | ||
19 | ( RT ) ? RT : ( RT = new BluetoothRFCOMMRun( this, Data ) ); | ||
20 | } | ||
21 | |||
17 | QWidget * edit( QWidget * parent ); | 22 | QWidget * edit( QWidget * parent ); |
18 | QString acceptable( void ); | 23 | QString acceptable( void ); |
19 | void commit( void ); | 24 | void commit( void ); |
20 | 25 | ||
21 | RuntimeInfo * runtime( void ) | ||
22 | { if( RT == 0 ) | ||
23 | RT = new BluetoothRFCOMMRun( this, Data ); | ||
24 | return RT; | ||
25 | } | ||
26 | |||
27 | virtual void * data( void ) | 26 | virtual void * data( void ) |
28 | { return (void *)&Data; } | 27 | { return (void *)&Data; } |
29 | 28 | ||
30 | virtual bool hasDataFor( const QString & S ); | ||
31 | virtual bool generateDataForCommonFile( SystemFile & SF, long ); | ||
32 | |||
33 | protected : | 29 | protected : |
34 | 30 | ||
35 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); | 31 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); |
36 | virtual void saveSpecificAttribute( QTextStream & TS ); | 32 | virtual void saveSpecificAttribute( QTextStream & TS ); |
37 | 33 | ||
38 | private : | 34 | private : |
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h index aff1f59..65fd686 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h | |||
@@ -9,12 +9,15 @@ public : | |||
9 | BluetoothRFCOMMData & Data ) : AsLine( NNI ) | 9 | BluetoothRFCOMMData & Data ) : AsLine( NNI ) |
10 | { } | 10 | { } |
11 | 11 | ||
12 | virtual AsLine * asLine( void ) | 12 | virtual AsLine * asLine( void ) |
13 | { return (AsLine *)this; } | 13 | { return (AsLine *)this; } |
14 | 14 | ||
15 | virtual QString deviceFile( void ) | ||
16 | { return QString( "/dev/rfcomm..." ); } | ||
17 | |||
15 | protected : | 18 | protected : |
16 | 19 | ||
17 | void detectState( NodeCollection * ) | 20 | void detectState( NodeCollection * ) |
18 | { } | 21 | { } |
19 | 22 | ||
20 | bool setState( NodeCollection * , Action_t, bool ) | 23 | bool setState( NodeCollection * , Action_t, bool ) |
diff --git a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp index b59b4f0..443a627 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp +++ b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp | |||
@@ -43,35 +43,12 @@ const char ** BluetoothBNEPNetNode::needs( void ) { | |||
43 | } | 43 | } |
44 | 44 | ||
45 | const char * BluetoothBNEPNetNode::provides( void ) { | 45 | const char * BluetoothBNEPNetNode::provides( void ) { |
46 | return "device"; | 46 | return "device"; |
47 | } | 47 | } |
48 | 48 | ||
49 | bool BluetoothBNEPNetNode::generateProperFilesFor( | ||
50 | ANetNodeInstance * ) { | ||
51 | return 0; | ||
52 | } | ||
53 | |||
54 | bool BluetoothBNEPNetNode::hasDataFor( const QString & S ) { | ||
55 | return S == "interfaces"; | ||
56 | } | ||
57 | |||
58 | bool BluetoothBNEPNetNode::generateDeviceDataForCommonFile( | ||
59 | SystemFile & S , | ||
60 | long DevNr) { | ||
61 | QString NIC = genNic( DevNr ); | ||
62 | |||
63 | if( S.name() == "interfaces" ) { | ||
64 | // generate mapping stanza for this interface | ||
65 | S << "# check if " << NIC << " can be brought UP" << endl; | ||
66 | S << "mapping " << NIC << endl; | ||
67 | S << " script networksettings2-request" << endl << endl; | ||
68 | } | ||
69 | return 0; | ||
70 | } | ||
71 | |||
72 | QString BluetoothBNEPNetNode::genNic( long nr ) { | 49 | QString BluetoothBNEPNetNode::genNic( long nr ) { |
73 | QString S; | 50 | QString S; |
74 | return S.sprintf( "bnep%ld", nr ); | 51 | return S.sprintf( "bnep%ld", nr ); |
75 | } | 52 | } |
76 | 53 | ||
77 | 54 | ||
@@ -121,27 +98,12 @@ const char ** BluetoothRFCOMMNetNode::needs( void ) { | |||
121 | } | 98 | } |
122 | 99 | ||
123 | const char * BluetoothRFCOMMNetNode::provides( void ) { | 100 | const char * BluetoothRFCOMMNetNode::provides( void ) { |
124 | return "line"; | 101 | return "line"; |
125 | } | 102 | } |
126 | 103 | ||
127 | bool BluetoothRFCOMMNetNode::generateProperFilesFor( | ||
128 | ANetNodeInstance * ) { | ||
129 | return 0; | ||
130 | } | ||
131 | |||
132 | bool BluetoothRFCOMMNetNode::hasDataFor( const QString & ) { | ||
133 | return 0; | ||
134 | } | ||
135 | |||
136 | bool BluetoothRFCOMMNetNode::generateDeviceDataForCommonFile( | ||
137 | SystemFile & , | ||
138 | long ) { | ||
139 | return 0; | ||
140 | } | ||
141 | |||
142 | void BluetoothRFCOMMNetNode::setSpecificAttribute( QString &, QString & ) { | 104 | void BluetoothRFCOMMNetNode::setSpecificAttribute( QString &, QString & ) { |
143 | } | 105 | } |
144 | 106 | ||
145 | void BluetoothRFCOMMNetNode::saveSpecificAttribute( QTextStream & ) { | 107 | void BluetoothRFCOMMNetNode::saveSpecificAttribute( QTextStream & ) { |
146 | } | 108 | } |
147 | 109 | ||
diff --git a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h index 2e5e1d2..4d6a3c1 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h +++ b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h | |||
@@ -4,37 +4,29 @@ | |||
4 | #include "netnode.h" | 4 | #include "netnode.h" |
5 | 5 | ||
6 | class ABluetoothBNEP; | 6 | class ABluetoothBNEP; |
7 | 7 | ||
8 | class BluetoothBNEPNetNode : public ANetNode { | 8 | class BluetoothBNEPNetNode : public ANetNode { |
9 | 9 | ||
10 | Q_OBJECT | 10 | Q_OBJECT |
11 | 11 | ||
12 | public: | 12 | public: |
13 | 13 | ||
14 | BluetoothBNEPNetNode(); | 14 | BluetoothBNEPNetNode(); |
15 | virtual ~BluetoothBNEPNetNode(); | 15 | virtual ~BluetoothBNEPNetNode(); |
16 | 16 | ||
17 | virtual const QString pixmapName() | 17 | virtual QString genNic( long ); |
18 | { return "Devices/bluetooth"; } | 18 | virtual long instanceCount( void ) |
19 | { return InstanceCount; } | ||
20 | virtual const QString pixmapName() | ||
21 | { return "Devices/bluetooth"; } | ||
19 | 22 | ||
20 | virtual const QString nodeDescription() ; | 23 | virtual const QString nodeDescription() ; |
21 | 24 | virtual ANetNodeInstance * createInstance( void ); | |
22 | virtual ANetNodeInstance * createInstance( void ); | 25 | virtual const char * provides( void ); |
23 | 26 | virtual const char ** needs( void ); | |
24 | virtual const char ** needs( void ); | ||
25 | virtual const char * provides( void ); | ||
26 | |||
27 | virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); | ||
28 | virtual bool hasDataFor( const QString & S ); | ||
29 | virtual bool generateDeviceDataForCommonFile( | ||
30 | SystemFile & , long DevNr ); | ||
31 | |||
32 | virtual long instanceCount( void ) | ||
33 | { return InstanceCount; } | ||
34 | virtual QString genNic( long ); | ||
35 | 27 | ||
36 | private: | 28 | private: |
37 | 29 | ||
38 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); | 30 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); |
39 | virtual void saveSpecificAttribute( QTextStream & TS ); | 31 | virtual void saveSpecificAttribute( QTextStream & TS ); |
40 | 32 | ||
@@ -42,33 +34,26 @@ private: | |||
42 | long InstanceCount; | 34 | long InstanceCount; |
43 | 35 | ||
44 | }; | 36 | }; |
45 | 37 | ||
46 | class BluetoothRFCOMMNetNode : public ANetNode { | 38 | class BluetoothRFCOMMNetNode : public ANetNode { |
47 | 39 | ||
48 | Q_OBJECT | 40 | Q_OBJECT |
49 | 41 | ||
50 | public: | 42 | public: |
51 | 43 | ||
52 | BluetoothRFCOMMNetNode(); | 44 | BluetoothRFCOMMNetNode(); |
53 | virtual ~BluetoothRFCOMMNetNode(); | 45 | virtual ~BluetoothRFCOMMNetNode(); |
54 | |||
55 | virtual const QString pixmapName() | ||
56 | { return "Devices/bluetooth"; } | ||
57 | |||
58 | virtual const QString nodeDescription() ; | ||
59 | |||
60 | virtual ANetNodeInstance * createInstance( void ); | ||
61 | 46 | ||
62 | virtual const char ** needs( void ); | 47 | virtual const QString pixmapName() |
63 | virtual const char * provides( void ); | 48 | { return "Devices/bluetooth"; } |
64 | 49 | ||
65 | virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); | 50 | virtual const QString nodeDescription() ; |
66 | virtual bool hasDataFor( const QString & S ); | 51 | virtual ANetNodeInstance * createInstance( void ); |
67 | virtual bool generateDeviceDataForCommonFile( | 52 | virtual const char ** needs( void ); |
68 | SystemFile & , long ); | 53 | virtual const char * provides( void ); |
69 | 54 | ||
70 | private: | 55 | private: |
71 | 56 | ||
72 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); | 57 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); |
73 | virtual void saveSpecificAttribute( QTextStream & TS ); | 58 | virtual void saveSpecificAttribute( QTextStream & TS ); |
74 | }; | 59 | }; |