summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/bluetooth
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings2/bluetooth') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.cpp8
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothBNEP_NNI.h14
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.cpp8
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothRFCOMM_NNI.h14
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h3
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp38
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetooth_NN.h23
7 files changed, 17 insertions, 91 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
@@ -19,32 +19,24 @@ void ABluetoothBNEP::setSpecificAttribute( QString & S, QString & A ) {
void ABluetoothBNEP::saveSpecificAttribute( QTextStream & TS ) {
TS << "allowall=" << Data.AllowAll << endl;
for ( QStringList::Iterator it = Data.BDAddress.begin();
it != Data.BDAddress.end();
++it ) {
TS << "bdaddress=" << (*it) << endl;
}
}
QWidget * ABluetoothBNEP::edit( QWidget * parent ) {
GUI = new BluetoothBNEPEdit( parent );
GUI->showData( Data );
return GUI;
}
QString ABluetoothBNEP::acceptable( void ) {
return ( GUI ) ? GUI->acceptable( ) : QString();
}
void ABluetoothBNEP::commit( void ) {
if( GUI && GUI->commit( Data ) )
setModified( 1 );
}
-
-bool ABluetoothBNEP::hasDataFor( const QString & ) {
- return 0;
-}
-
-bool ABluetoothBNEP::generateDataForCommonFile( SystemFile & , long ){
- return 0;
-}
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
@@ -1,46 +1,42 @@
#ifndef BLUETOOTHBNEP_H
#define BLUETOOTHBNEP_H
#include <netnode.h>
#include "bluetoothBNEPdata.h"
#include "bluetoothBNEPrun.h"
class BluetoothBNEPNetNode;
class BluetoothBNEPEdit;
class ABluetoothBNEP : public ANetNodeInstance {
public :
ABluetoothBNEP( BluetoothBNEPNetNode * PNN );
+ RuntimeInfo * runtime( void )
+ { return
+ ( RT ) ? RT : ( RT = new BluetoothBNEPRun( this, Data ) );
+ }
+
QWidget * edit( QWidget * parent );
QString acceptable( void );
void commit( void );
- RuntimeInfo * runtime( void )
- { if( RT == 0 )
- RT = new BluetoothBNEPRun( this, Data );
- return RT;
- }
-
virtual void * data( void )
{ return (void *)&Data; }
- virtual bool hasDataFor( const QString & S );
- virtual bool generateDataForCommonFile( SystemFile & SF, long );
-
protected :
virtual void setSpecificAttribute( QString & Attr, QString & Value );
virtual void saveSpecificAttribute( QTextStream & TS );
private :
BluetoothBNEPEdit * GUI;
BluetoothBNEPData Data;
BluetoothBNEPRun * RT;
};
#endif
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
@@ -7,32 +7,24 @@ ABluetoothRFCOMM::ABluetoothRFCOMM( BluetoothRFCOMMNetNode * PNN ) : ANetNodeIns
RT = 0;
}
void ABluetoothRFCOMM::setSpecificAttribute( QString & , QString & ) {
}
void ABluetoothRFCOMM::saveSpecificAttribute( QTextStream & ) {
}
QWidget * ABluetoothRFCOMM::edit( QWidget * parent ) {
GUI = new BluetoothRFCOMMEdit( parent );
GUI->showData( Data );
return GUI;
}
QString ABluetoothRFCOMM::acceptable( void ) {
return ( GUI ) ? GUI->acceptable( ) : QString();
}
void ABluetoothRFCOMM::commit( void ) {
if( GUI->commit( Data ) )
setModified( 1 );
}
-
-bool ABluetoothRFCOMM::hasDataFor( const QString & ) {
- return 0;
-}
-
-bool ABluetoothRFCOMM::generateDataForCommonFile( SystemFile & , long ){
- return 0;
-}
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
@@ -1,45 +1,41 @@
#ifndef BLUETOOTHRFCOMM_H
#define BLUETOOTHRFCOMM_H
#include <netnode.h>
#include "bluetoothRFCOMMdata.h"
#include "bluetoothRFCOMMrun.h"
class BluetoothRFCOMMNetNode;
class BluetoothRFCOMMEdit;
class ABluetoothRFCOMM : public ANetNodeInstance {
public :
ABluetoothRFCOMM( BluetoothRFCOMMNetNode * PNN );
+ RuntimeInfo * runtime( void )
+ { return
+ ( RT ) ? RT : ( RT = new BluetoothRFCOMMRun( this, Data ) );
+ }
+
QWidget * edit( QWidget * parent );
QString acceptable( void );
void commit( void );
- RuntimeInfo * runtime( void )
- { if( RT == 0 )
- RT = new BluetoothRFCOMMRun( this, Data );
- return RT;
- }
-
virtual void * data( void )
{ return (void *)&Data; }
- virtual bool hasDataFor( const QString & S );
- virtual bool generateDataForCommonFile( SystemFile & SF, long );
-
protected :
virtual void setSpecificAttribute( QString & Attr, QString & Value );
virtual void saveSpecificAttribute( QTextStream & TS );
private :
BluetoothRFCOMMEdit * GUI;
BluetoothRFCOMMData Data;
BluetoothRFCOMMRun * RT;
};
#endif
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
@@ -1,25 +1,28 @@
#include <asline.h>
#include "bluetoothRFCOMMdata.h"
class BluetoothRFCOMMRun : public AsLine {
public :
BluetoothRFCOMMRun( ANetNodeInstance * NNI,
BluetoothRFCOMMData & Data ) : AsLine( NNI )
{ }
virtual AsLine * asLine( void )
{ return (AsLine *)this; }
+ virtual QString deviceFile( void )
+ { return QString( "/dev/rfcomm..." ); }
+
protected :
void detectState( NodeCollection * )
{ }
bool setState( NodeCollection * , Action_t, bool )
{ return 0; }
bool canSetState( State_t , Action_t )
{ return 0; }
};
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
@@ -25,71 +25,48 @@ BluetoothBNEPNetNode::BluetoothBNEPNetNode() :
*/
BluetoothBNEPNetNode::~BluetoothBNEPNetNode(){
}
const QString BluetoothBNEPNetNode::nodeDescription(){
return tr("\
<p>Sets up a bluetooth link using the bluetooth Network profile.</p>\
<p>Use this to connect two computing devices.</p>\
"
);
}
ANetNodeInstance * BluetoothBNEPNetNode::createInstance( void ) {
return new ABluetoothBNEP( this );
}
const char ** BluetoothBNEPNetNode::needs( void ) {
return BluetoothBNEPNeeds;
}
const char * BluetoothBNEPNetNode::provides( void ) {
return "device";
}
-bool BluetoothBNEPNetNode::generateProperFilesFor(
- ANetNodeInstance * ) {
- return 0;
-}
-
-bool BluetoothBNEPNetNode::hasDataFor( const QString & S ) {
- return S == "interfaces";
-}
-
-bool BluetoothBNEPNetNode::generateDeviceDataForCommonFile(
- SystemFile & S ,
- long DevNr) {
- QString NIC = genNic( DevNr );
-
- if( S.name() == "interfaces" ) {
- // generate mapping stanza for this interface
- S << "# check if " << NIC << " can be brought UP" << endl;
- S << "mapping " << NIC << endl;
- S << " script networksettings2-request" << endl << endl;
- }
- return 0;
-}
-
QString BluetoothBNEPNetNode::genNic( long nr ) {
QString S;
return S.sprintf( "bnep%ld", nr );
}
void BluetoothBNEPNetNode::setSpecificAttribute( QString & A, QString & V ) {
if( A == "interfacecount" ) {
InstanceCount = V.toLong();
}
}
void BluetoothBNEPNetNode::saveSpecificAttribute( QTextStream & TS) {
TS << "interfacecount="
<< InstanceCount
<< endl;
}
//
//
// BLUETOOTH RFCOMM
//
//
@@ -103,51 +80,36 @@ BluetoothRFCOMMNetNode::BluetoothRFCOMMNetNode() :
BluetoothRFCOMMNetNode::~BluetoothRFCOMMNetNode(){
}
const QString BluetoothRFCOMMNetNode::nodeDescription(){
return tr("\
<p>Sets up a bluetooth link using the bluetooth serial profile.</p>\
<p>Use this to connect to a GSM.</p>\
"
);
}
ANetNodeInstance * BluetoothRFCOMMNetNode::createInstance( void ) {
return new ABluetoothRFCOMM( this );
}
const char ** BluetoothRFCOMMNetNode::needs( void ) {
return BluetoothRFCOMMNeeds;
}
const char * BluetoothRFCOMMNetNode::provides( void ) {
return "line";
}
-bool BluetoothRFCOMMNetNode::generateProperFilesFor(
- ANetNodeInstance * ) {
- return 0;
-}
-
-bool BluetoothRFCOMMNetNode::hasDataFor( const QString & ) {
- return 0;
-}
-
-bool BluetoothRFCOMMNetNode::generateDeviceDataForCommonFile(
- SystemFile & ,
- long ) {
- return 0;
-}
-
void BluetoothRFCOMMNetNode::setSpecificAttribute( QString &, QString & ) {
}
void BluetoothRFCOMMNetNode::saveSpecificAttribute( QTextStream & ) {
}
extern "C" {
void create_plugin( QList<ANetNode> & PNN ) {
PNN.append( new BluetoothBNEPNetNode() );
PNN.append( new BluetoothRFCOMMNetNode() );
}
}
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,81 +1,66 @@
#ifndef BLUETOOTH_NETNODE_H
#define BLUETOOTH_NETNODE_H
#include "netnode.h"
class ABluetoothBNEP;
class BluetoothBNEPNetNode : public ANetNode {
Q_OBJECT
public:
BluetoothBNEPNetNode();
virtual ~BluetoothBNEPNetNode();
+ virtual QString genNic( long );
+ virtual long instanceCount( void )
+ { return InstanceCount; }
virtual const QString pixmapName()
{ return "Devices/bluetooth"; }
virtual const QString nodeDescription() ;
-
virtual ANetNodeInstance * createInstance( void );
-
- virtual const char ** needs( void );
virtual const char * provides( void );
-
- virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
- virtual bool hasDataFor( const QString & S );
- virtual bool generateDeviceDataForCommonFile(
- SystemFile & , long DevNr );
-
- virtual long instanceCount( void )
- { return InstanceCount; }
- virtual QString genNic( long );
+ virtual const char ** needs( void );
private:
virtual void setSpecificAttribute( QString & Attr, QString & Value );
virtual void saveSpecificAttribute( QTextStream & TS );
// number of interfaces for this device
long InstanceCount;
};
class BluetoothRFCOMMNetNode : public ANetNode {
Q_OBJECT
public:
BluetoothRFCOMMNetNode();
virtual ~BluetoothRFCOMMNetNode();
virtual const QString pixmapName()
{ return "Devices/bluetooth"; }
virtual const QString nodeDescription() ;
-
virtual ANetNodeInstance * createInstance( void );
-
virtual const char ** needs( void );
virtual const char * provides( void );
- virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
- virtual bool hasDataFor( const QString & S );
- virtual bool generateDeviceDataForCommonFile(
- SystemFile & , long );
-
private:
virtual void setSpecificAttribute( QString & Attr, QString & Value );
virtual void saveSpecificAttribute( QTextStream & TS );
};
extern "C"
{
void create_plugin( QList<ANetNode> & PNN );
};
#endif