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 | |||
@@ -31,20 +31,12 @@ QWidget * ABluetoothBNEP::edit( QWidget * parent ) { | |||
31 | GUI->showData( Data ); | 31 | GUI->showData( Data ); |
32 | return GUI; | 32 | return GUI; |
33 | } | 33 | } |
34 | 34 | ||
35 | QString ABluetoothBNEP::acceptable( void ) { | 35 | QString ABluetoothBNEP::acceptable( void ) { |
36 | return ( GUI ) ? GUI->acceptable( ) : QString(); | 36 | return ( GUI ) ? GUI->acceptable( ) : QString(); |
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 | |||
@@ -5,40 +5,36 @@ | |||
5 | #include "bluetoothBNEPdata.h" | 5 | #include "bluetoothBNEPdata.h" |
6 | #include "bluetoothBNEPrun.h" | 6 | #include "bluetoothBNEPrun.h" |
7 | 7 | ||
8 | class BluetoothBNEPNetNode; | 8 | class BluetoothBNEPNetNode; |
9 | class BluetoothBNEPEdit; | 9 | class BluetoothBNEPEdit; |
10 | 10 | ||
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 : |
39 | 35 | ||
40 | BluetoothBNEPEdit * GUI; | 36 | BluetoothBNEPEdit * GUI; |
41 | BluetoothBNEPData Data; | 37 | BluetoothBNEPData Data; |
42 | BluetoothBNEPRun * RT; | 38 | BluetoothBNEPRun * RT; |
43 | 39 | ||
44 | }; | 40 | }; |
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 | |||
@@ -19,20 +19,12 @@ QWidget * ABluetoothRFCOMM::edit( QWidget * parent ) { | |||
19 | GUI->showData( Data ); | 19 | GUI->showData( Data ); |
20 | return GUI; | 20 | return GUI; |
21 | } | 21 | } |
22 | 22 | ||
23 | QString ABluetoothRFCOMM::acceptable( void ) { | 23 | QString ABluetoothRFCOMM::acceptable( void ) { |
24 | return ( GUI ) ? GUI->acceptable( ) : QString(); | 24 | return ( GUI ) ? GUI->acceptable( ) : QString(); |
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 | |||
@@ -5,40 +5,36 @@ | |||
5 | #include "bluetoothRFCOMMdata.h" | 5 | #include "bluetoothRFCOMMdata.h" |
6 | #include "bluetoothRFCOMMrun.h" | 6 | #include "bluetoothRFCOMMrun.h" |
7 | 7 | ||
8 | class BluetoothRFCOMMNetNode; | 8 | class BluetoothRFCOMMNetNode; |
9 | class BluetoothRFCOMMEdit; | 9 | class BluetoothRFCOMMEdit; |
10 | 10 | ||
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 : |
39 | 35 | ||
40 | BluetoothRFCOMMEdit * GUI; | 36 | BluetoothRFCOMMEdit * GUI; |
41 | BluetoothRFCOMMData Data; | 37 | BluetoothRFCOMMData Data; |
42 | BluetoothRFCOMMRun * RT; | 38 | BluetoothRFCOMMRun * RT; |
43 | }; | 39 | }; |
44 | 40 | ||
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 | |||
@@ -3,23 +3,26 @@ | |||
3 | 3 | ||
4 | class BluetoothRFCOMMRun : public AsLine { | 4 | class BluetoothRFCOMMRun : public AsLine { |
5 | 5 | ||
6 | public : | 6 | public : |
7 | 7 | ||
8 | BluetoothRFCOMMRun( ANetNodeInstance * NNI, | 8 | BluetoothRFCOMMRun( ANetNodeInstance * NNI, |
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 ) |
21 | { return 0; } | 24 | { return 0; } |
22 | 25 | ||
23 | bool canSetState( State_t , Action_t ) | 26 | bool canSetState( State_t , Action_t ) |
24 | { return 0; } | 27 | { return 0; } |
25 | }; | 28 | }; |
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 | |||
@@ -37,47 +37,24 @@ const QString BluetoothBNEPNetNode::nodeDescription(){ | |||
37 | ANetNodeInstance * BluetoothBNEPNetNode::createInstance( void ) { | 37 | ANetNodeInstance * BluetoothBNEPNetNode::createInstance( void ) { |
38 | return new ABluetoothBNEP( this ); | 38 | return new ABluetoothBNEP( this ); |
39 | } | 39 | } |
40 | 40 | ||
41 | const char ** BluetoothBNEPNetNode::needs( void ) { | 41 | const char ** BluetoothBNEPNetNode::needs( void ) { |
42 | return BluetoothBNEPNeeds; | 42 | return BluetoothBNEPNeeds; |
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 | ||
78 | void BluetoothBNEPNetNode::setSpecificAttribute( QString & A, QString & V ) { | 55 | void BluetoothBNEPNetNode::setSpecificAttribute( QString & A, QString & V ) { |
79 | if( A == "interfacecount" ) { | 56 | if( A == "interfacecount" ) { |
80 | InstanceCount = V.toLong(); | 57 | InstanceCount = V.toLong(); |
81 | } | 58 | } |
82 | } | 59 | } |
83 | 60 | ||
@@ -115,39 +92,24 @@ const QString BluetoothRFCOMMNetNode::nodeDescription(){ | |||
115 | ANetNodeInstance * BluetoothRFCOMMNetNode::createInstance( void ) { | 92 | ANetNodeInstance * BluetoothRFCOMMNetNode::createInstance( void ) { |
116 | return new ABluetoothRFCOMM( this ); | 93 | return new ABluetoothRFCOMM( this ); |
117 | } | 94 | } |
118 | 95 | ||
119 | const char ** BluetoothRFCOMMNetNode::needs( void ) { | 96 | const char ** BluetoothRFCOMMNetNode::needs( void ) { |
120 | return BluetoothRFCOMMNeeds; | 97 | return BluetoothRFCOMMNeeds; |
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 | ||
148 | extern "C" { | 110 | extern "C" { |
149 | void create_plugin( QList<ANetNode> & PNN ) { | 111 | void create_plugin( QList<ANetNode> & PNN ) { |
150 | PNN.append( new BluetoothBNEPNetNode() ); | 112 | PNN.append( new BluetoothBNEPNetNode() ); |
151 | PNN.append( new BluetoothRFCOMMNetNode() ); | 113 | PNN.append( new BluetoothRFCOMMNetNode() ); |
152 | } | 114 | } |
153 | } | 115 | } |
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 | |||
@@ -1,80 +1,65 @@ | |||
1 | #ifndef BLUETOOTH_NETNODE_H | 1 | #ifndef BLUETOOTH_NETNODE_H |
2 | #define BLUETOOTH_NETNODE_H | 2 | #define BLUETOOTH_NETNODE_H |
3 | 3 | ||
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 | ||
41 | // number of interfaces for this device | 33 | // number of interfaces for this device |
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 | }; |
75 | 60 | ||
76 | extern "C" | 61 | extern "C" |
77 | { | 62 | { |
78 | void create_plugin( QList<ANetNode> & PNN ); | 63 | void create_plugin( QList<ANetNode> & PNN ); |
79 | }; | 64 | }; |
80 | 65 | ||