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
@@ -31,20 +31,12 @@ QWidget * ABluetoothBNEP::edit( QWidget * 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
@@ -5,40 +5,36 @@
#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;
};
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 ) {
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
@@ -5,40 +5,36 @@
#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;
};
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 @@
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
@@ -37,47 +37,24 @@ const QString BluetoothBNEPNetNode::nodeDescription(){
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();
}
}
@@ -115,39 +92,24 @@ const QString BluetoothRFCOMMNetNode::nodeDescription(){
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
@@ -5,77 +5,62 @@
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