Diffstat (limited to 'noncore/settings/networksettings2/bluetooth') (more/less context) (ignore whitespace changes)
5 files changed, 24 insertions, 27 deletions
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h index a21f574..bb3e7e7 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h | |||
@@ -6,38 +6,41 @@ | |||
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 | QWidget * edit( QWidget * parent ); | 17 | QWidget * edit( QWidget * parent ); |
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 BluetoothBNEPRun( this, Data ); | 23 | RT = new BluetoothBNEPRun( 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 | virtual bool hasDataFor( const QString & S ); | ||
31 | virtual bool generateDataForCommonFile( SystemFile & SF, long ); | ||
32 | |||
30 | protected : | 33 | protected : |
31 | 34 | ||
32 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); | 35 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); |
33 | virtual void saveSpecificAttribute( QTextStream & TS ); | 36 | virtual void saveSpecificAttribute( QTextStream & TS ); |
34 | 37 | ||
35 | private : | 38 | private : |
36 | 39 | ||
37 | BluetoothBNEPEdit * GUI; | 40 | BluetoothBNEPEdit * GUI; |
38 | BluetoothBNEPData Data; | 41 | BluetoothBNEPData Data; |
39 | BluetoothBNEPRun * RT; | 42 | BluetoothBNEPRun * RT; |
40 | 43 | ||
41 | }; | 44 | }; |
42 | 45 | ||
43 | #endif | 46 | #endif |
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h index 347da0c..4a773cd 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h +++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h | |||
@@ -1,36 +1,31 @@ | |||
1 | #include <asdevice.h> | 1 | #include <asdevice.h> |
2 | #include "bluetoothBNEPdata.h" | 2 | #include "bluetoothBNEPdata.h" |
3 | 3 | ||
4 | class BluetoothBNEPRun : public AsDevice { | 4 | class BluetoothBNEPRun : public AsDevice { |
5 | 5 | ||
6 | public : | 6 | public : |
7 | 7 | ||
8 | BluetoothBNEPRun( ANetNodeInstance * NNI, | 8 | BluetoothBNEPRun( ANetNodeInstance * NNI, |
9 | BluetoothBNEPData & Data ) : AsDevice( NNI ) | 9 | BluetoothBNEPData & Data ) : AsDevice( NNI ) |
10 | { } | 10 | { } |
11 | 11 | ||
12 | virtual long count( void ) | ||
13 | { return 3; } | ||
14 | virtual QString genNic( long nr ) | ||
15 | { QString S; return S.sprintf( "bnep%ld", nr ); } | ||
16 | |||
17 | virtual AsDevice * asDevice( void ) | 12 | virtual AsDevice * asDevice( void ) |
18 | { return (AsDevice *)this; } | 13 | { return (AsDevice *)this; } |
19 | 14 | ||
20 | virtual AsDevice * device( void ) | 15 | virtual AsDevice * device( void ) |
21 | { return asDevice(); } | 16 | { return asDevice(); } |
22 | 17 | ||
23 | protected : | 18 | protected : |
24 | 19 | ||
25 | void detectState( NodeCollection * ) | 20 | void detectState( NodeCollection * ) |
26 | { } | 21 | { } |
27 | 22 | ||
28 | bool setState( NodeCollection * , Action_t ) | 23 | bool setState( NodeCollection * , Action_t ) |
29 | { return 0; } | 24 | { return 0; } |
30 | 25 | ||
31 | bool canSetState( State_t , Action_t ) | 26 | bool canSetState( State_t , Action_t ) |
32 | { return 0; } | 27 | { return 0; } |
33 | 28 | ||
34 | bool handlesInterface( const QString & ) | 29 | bool handlesInterface( const QString & ) |
35 | { return 0; } | 30 | { return 0; } |
36 | }; | 31 | }; |
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h index 57ff95e..97bd29c 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h +++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h | |||
@@ -6,37 +6,40 @@ | |||
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 | QWidget * edit( QWidget * parent ); | 17 | QWidget * edit( QWidget * parent ); |
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 BluetoothRFCOMMRun( this, Data ); | 23 | RT = new BluetoothRFCOMMRun( 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 | virtual bool hasDataFor( const QString & S ); | ||
31 | virtual bool generateDataForCommonFile( SystemFile & SF, long ); | ||
32 | |||
30 | protected : | 33 | protected : |
31 | 34 | ||
32 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); | 35 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); |
33 | virtual void saveSpecificAttribute( QTextStream & TS ); | 36 | virtual void saveSpecificAttribute( QTextStream & TS ); |
34 | 37 | ||
35 | private : | 38 | private : |
36 | 39 | ||
37 | BluetoothRFCOMMEdit * GUI; | 40 | BluetoothRFCOMMEdit * GUI; |
38 | BluetoothRFCOMMData Data; | 41 | BluetoothRFCOMMData Data; |
39 | BluetoothRFCOMMRun * RT; | 42 | BluetoothRFCOMMRun * RT; |
40 | }; | 43 | }; |
41 | 44 | ||
42 | #endif | 45 | #endif |
diff --git a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp index 47272c4..3d1aa69 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp +++ b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp | |||
@@ -28,100 +28,96 @@ const QString BluetoothBNEPNetNode::nodeDescription(){ | |||
28 | return tr("\ | 28 | return tr("\ |
29 | <p>Sets up a bluetooth link using the bluetooth Network profile.</p>\ | 29 | <p>Sets up a bluetooth link using the bluetooth Network profile.</p>\ |
30 | <p>Use this to connect two computing devices.</p>\ | 30 | <p>Use this to connect two computing devices.</p>\ |
31 | " | 31 | " |
32 | ); | 32 | ); |
33 | } | 33 | } |
34 | 34 | ||
35 | ANetNodeInstance * BluetoothBNEPNetNode::createInstance( void ) { | 35 | ANetNodeInstance * BluetoothBNEPNetNode::createInstance( void ) { |
36 | return new ABluetoothBNEP( this ); | 36 | return new ABluetoothBNEP( this ); |
37 | } | 37 | } |
38 | 38 | ||
39 | const char ** BluetoothBNEPNetNode::needs( void ) { | 39 | const char ** BluetoothBNEPNetNode::needs( void ) { |
40 | return BluetoothBNEPNeeds; | 40 | return BluetoothBNEPNeeds; |
41 | } | 41 | } |
42 | 42 | ||
43 | const char * BluetoothBNEPNetNode::provides( void ) { | 43 | const char * BluetoothBNEPNetNode::provides( void ) { |
44 | return "device"; | 44 | return "device"; |
45 | } | 45 | } |
46 | 46 | ||
47 | bool BluetoothBNEPNetNode::generateProperFilesFor( | 47 | bool BluetoothBNEPNetNode::generateProperFilesFor( |
48 | ANetNodeInstance * ) { | 48 | ANetNodeInstance * ) { |
49 | return 1; | 49 | return 1; |
50 | } | 50 | } |
51 | 51 | ||
52 | bool BluetoothBNEPNetNode::hasDataFor( const QString & S, bool DS ) { | 52 | bool BluetoothBNEPNetNode::hasDataFor( const QString & S ) { |
53 | return DS && S == "interfaces"; | 53 | return S == "interfaces"; |
54 | } | 54 | } |
55 | 55 | ||
56 | bool BluetoothBNEPNetNode::generateDataForCommonFile( | 56 | bool BluetoothBNEPNetNode::generateDeviceDataForCommonFile( |
57 | SystemFile & , | 57 | SystemFile & , |
58 | long , | 58 | long ) { |
59 | ANetNodeInstance * ) { | ||
60 | return 1; | 59 | return 1; |
61 | } | 60 | } |
62 | 61 | ||
63 | bool BluetoothBNEPNetNode::generateDeviceDataForCommonFile( | 62 | QString BluetoothBNEPNetNode::genNic( long nr ) { |
64 | SystemFile & , | 63 | QString S; |
65 | long , | 64 | return S.sprintf( "bnep%ld", nr ); |
66 | ANetNodeInstance * ) { | ||
67 | return 1; | ||
68 | } | 65 | } |
69 | 66 | ||
70 | // | 67 | // |
71 | // | 68 | // |
72 | // BLUETOOTH PAN/NAP node | 69 | // BLUETOOTH PAN/NAP node |
73 | // | 70 | // |
74 | // | 71 | // |
75 | 72 | ||
76 | static const char * BluetoothRFCOMMNeeds[] = | 73 | static const char * BluetoothRFCOMMNeeds[] = |
77 | { 0 | 74 | { 0 |
78 | }; | 75 | }; |
79 | 76 | ||
80 | BluetoothRFCOMMNetNode::BluetoothRFCOMMNetNode() : ANetNode() { | 77 | BluetoothRFCOMMNetNode::BluetoothRFCOMMNetNode() : ANetNode() { |
81 | } | 78 | } |
82 | 79 | ||
83 | BluetoothRFCOMMNetNode::~BluetoothRFCOMMNetNode(){ | 80 | BluetoothRFCOMMNetNode::~BluetoothRFCOMMNetNode(){ |
84 | } | 81 | } |
85 | 82 | ||
86 | const QString BluetoothRFCOMMNetNode::nodeDescription(){ | 83 | const QString BluetoothRFCOMMNetNode::nodeDescription(){ |
87 | return tr("\ | 84 | return tr("\ |
88 | <p>Sets up a bluetooth link using the bluetooth serial profile.</p>\ | 85 | <p>Sets up a bluetooth link using the bluetooth serial profile.</p>\ |
89 | <p>Use this to connect to a GSM.</p>\ | 86 | <p>Use this to connect to a GSM.</p>\ |
90 | " | 87 | " |
91 | ); | 88 | ); |
92 | } | 89 | } |
93 | 90 | ||
94 | ANetNodeInstance * BluetoothRFCOMMNetNode::createInstance( void ) { | 91 | ANetNodeInstance * BluetoothRFCOMMNetNode::createInstance( void ) { |
95 | return new ABluetoothRFCOMM( this ); | 92 | return new ABluetoothRFCOMM( this ); |
96 | } | 93 | } |
97 | 94 | ||
98 | const char ** BluetoothRFCOMMNetNode::needs( void ) { | 95 | const char ** BluetoothRFCOMMNetNode::needs( void ) { |
99 | return BluetoothRFCOMMNeeds; | 96 | return BluetoothRFCOMMNeeds; |
100 | } | 97 | } |
101 | 98 | ||
102 | const char * BluetoothRFCOMMNetNode::provides( void ) { | 99 | const char * BluetoothRFCOMMNetNode::provides( void ) { |
103 | return "line"; | 100 | return "line"; |
104 | } | 101 | } |
105 | 102 | ||
106 | bool BluetoothRFCOMMNetNode::generateProperFilesFor( | 103 | bool BluetoothRFCOMMNetNode::generateProperFilesFor( |
107 | ANetNodeInstance * ) { | 104 | ANetNodeInstance * ) { |
108 | return 0; | 105 | return 0; |
109 | } | 106 | } |
110 | 107 | ||
111 | bool BluetoothRFCOMMNetNode::hasDataFor( const QString &, bool ) { | 108 | bool BluetoothRFCOMMNetNode::hasDataFor( const QString & ) { |
112 | return 0; | 109 | return 0; |
113 | } | 110 | } |
114 | 111 | ||
115 | bool BluetoothRFCOMMNetNode::generateDataForCommonFile( | 112 | bool BluetoothRFCOMMNetNode::generateDeviceDataForCommonFile( |
116 | SystemFile & , | 113 | SystemFile & , |
117 | long, | 114 | long ) { |
118 | ANetNodeInstance * ) { | ||
119 | return 0; | 115 | return 0; |
120 | } | 116 | } |
121 | 117 | ||
122 | extern "C" { | 118 | extern "C" { |
123 | void create_plugin( QList<ANetNode> & PNN ) { | 119 | void create_plugin( QList<ANetNode> & PNN ) { |
124 | PNN.append( new BluetoothBNEPNetNode() ); | 120 | PNN.append( new BluetoothBNEPNetNode() ); |
125 | PNN.append( new BluetoothRFCOMMNetNode() ); | 121 | PNN.append( new BluetoothRFCOMMNetNode() ); |
126 | } | 122 | } |
127 | } | 123 | } |
diff --git a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h index d72b0d4..5cd6c52 100644 --- a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h +++ b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h | |||
@@ -7,73 +7,73 @@ 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 const QString pixmapName() |
18 | { return "Devices/bluetooth"; } | 18 | { return "Devices/bluetooth"; } |
19 | 19 | ||
20 | virtual const QString nodeName() | 20 | virtual const QString nodeName() |
21 | { return tr("Bluetooth PAN/NAP"); } | 21 | { return tr("Bluetooth PAN/NAP"); } |
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 | virtual bool hasDataFor( const QString & S ); |
32 | virtual bool generateDataForCommonFile( | ||
33 | SystemFile & SF, long DevNr, ANetNodeInstance * NNI ); | ||
34 | virtual bool generateDeviceDataForCommonFile( | 32 | virtual bool generateDeviceDataForCommonFile( |
35 | SystemFile & SF, long DevNr, ANetNodeInstance * NNI ); | 33 | SystemFile & , long DevNr ); |
34 | |||
35 | virtual long instanceCount( void ) | ||
36 | { return 7; } | ||
37 | virtual QString genNic( long ); | ||
36 | 38 | ||
37 | private: | 39 | private: |
38 | 40 | ||
39 | }; | 41 | }; |
40 | 42 | ||
41 | class BluetoothRFCOMMNetNode : public ANetNode { | 43 | class BluetoothRFCOMMNetNode : public ANetNode { |
42 | 44 | ||
43 | Q_OBJECT | 45 | Q_OBJECT |
44 | 46 | ||
45 | public: | 47 | public: |
46 | 48 | ||
47 | BluetoothRFCOMMNetNode(); | 49 | BluetoothRFCOMMNetNode(); |
48 | virtual ~BluetoothRFCOMMNetNode(); | 50 | virtual ~BluetoothRFCOMMNetNode(); |
49 | 51 | ||
50 | virtual const QString pixmapName() | 52 | virtual const QString pixmapName() |
51 | { return "Devices/bluetooth"; } | 53 | { return "Devices/bluetooth"; } |
52 | 54 | ||
53 | virtual const QString nodeName() | 55 | virtual const QString nodeName() |
54 | { return tr("Bluetooth serial link"); } | 56 | { return tr("Bluetooth serial link"); } |
55 | 57 | ||
56 | virtual const QString nodeDescription() ; | 58 | virtual const QString nodeDescription() ; |
57 | 59 | ||
58 | virtual ANetNodeInstance * createInstance( void ); | 60 | virtual ANetNodeInstance * createInstance( void ); |
59 | 61 | ||
60 | virtual const char ** needs( void ); | 62 | virtual const char ** needs( void ); |
61 | virtual const char * provides( void ); | 63 | virtual const char * provides( void ); |
62 | 64 | ||
63 | virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); | 65 | virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); |
64 | virtual bool hasDataFor( const QString & S, bool ); | 66 | virtual bool hasDataFor( const QString & S ); |
65 | virtual bool generateDataForCommonFile( | ||
66 | SystemFile & SF, long, ANetNodeInstance * NNI ); | ||
67 | virtual bool generateDeviceDataForCommonFile( | 67 | virtual bool generateDeviceDataForCommonFile( |
68 | SystemFile & SF, long, ANetNodeInstance * NNI ); | 68 | SystemFile & , long ); |
69 | 69 | ||
70 | private: | 70 | private: |
71 | 71 | ||
72 | }; | 72 | }; |
73 | 73 | ||
74 | extern "C" | 74 | extern "C" |
75 | { | 75 | { |
76 | void create_plugin( QList<ANetNode> & PNN ); | 76 | void create_plugin( QList<ANetNode> & PNN ); |
77 | }; | 77 | }; |
78 | 78 | ||
79 | #endif | 79 | #endif |