Diffstat (limited to 'noncore/settings/networksettings2/irda') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/irda/irda_NN.cpp | 11 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irda_NN.h | 26 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irda_NNI.cpp | 6 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irda_NNI.h | 16 | ||||
-rw-r--r-- | noncore/settings/networksettings2/irda/irdarun.h | 3 |
5 files changed, 17 insertions, 45 deletions
diff --git a/noncore/settings/networksettings2/irda/irda_NN.cpp b/noncore/settings/networksettings2/irda/irda_NN.cpp index 49bc06e..9483e22 100644 --- a/noncore/settings/networksettings2/irda/irda_NN.cpp +++ b/noncore/settings/networksettings2/irda/irda_NN.cpp | |||
@@ -15,46 +15,35 @@ IRDANetNode::IRDANetNode() : ANetNode(tr("Infrared link")) { | |||
15 | * Delete any interfaces that we own. | 15 | * Delete any interfaces that we own. |
16 | */ | 16 | */ |
17 | IRDANetNode::~IRDANetNode(){ | 17 | IRDANetNode::~IRDANetNode(){ |
18 | } | 18 | } |
19 | 19 | ||
20 | const QString IRDANetNode::nodeDescription(){ | 20 | const QString IRDANetNode::nodeDescription(){ |
21 | return tr("\ | 21 | return tr("\ |
22 | <p>Sets up a infra red serial link.</p>\ | 22 | <p>Sets up a infra red serial link.</p>\ |
23 | " | 23 | " |
24 | ); | 24 | ); |
25 | } | 25 | } |
26 | 26 | ||
27 | ANetNodeInstance * IRDANetNode::createInstance( void ) { | 27 | ANetNodeInstance * IRDANetNode::createInstance( void ) { |
28 | return new AIRDA( this ); | 28 | return new AIRDA( this ); |
29 | } | 29 | } |
30 | 30 | ||
31 | const char ** IRDANetNode::needs( void ) { | 31 | const char ** IRDANetNode::needs( void ) { |
32 | return IRDANeeds; | 32 | return IRDANeeds; |
33 | } | 33 | } |
34 | 34 | ||
35 | const char * IRDANetNode::provides( void ) { | 35 | const char * IRDANetNode::provides( void ) { |
36 | return "line"; | 36 | return "line"; |
37 | } | 37 | } |
38 | 38 | ||
39 | bool IRDANetNode::generateProperFilesFor( | ||
40 | ANetNodeInstance * ) { | ||
41 | return 0; | ||
42 | } | ||
43 | |||
44 | bool IRDANetNode::generateDeviceDataForCommonFile( | ||
45 | SystemFile & , | ||
46 | long ) { | ||
47 | return 0; | ||
48 | } | ||
49 | |||
50 | void IRDANetNode::setSpecificAttribute( QString & , QString & ) { | 39 | void IRDANetNode::setSpecificAttribute( QString & , QString & ) { |
51 | } | 40 | } |
52 | 41 | ||
53 | void IRDANetNode::saveSpecificAttribute( QTextStream & ) { | 42 | void IRDANetNode::saveSpecificAttribute( QTextStream & ) { |
54 | } | 43 | } |
55 | 44 | ||
56 | extern "C" { | 45 | extern "C" { |
57 | void create_plugin( QList<ANetNode> & PNN ) { | 46 | void create_plugin( QList<ANetNode> & PNN ) { |
58 | PNN.append( new IRDANetNode() ); | 47 | PNN.append( new IRDANetNode() ); |
59 | } | 48 | } |
60 | } | 49 | } |
diff --git a/noncore/settings/networksettings2/irda/irda_NN.h b/noncore/settings/networksettings2/irda/irda_NN.h index fa6408d..900bbc6 100644 --- a/noncore/settings/networksettings2/irda/irda_NN.h +++ b/noncore/settings/networksettings2/irda/irda_NN.h | |||
@@ -1,44 +1,36 @@ | |||
1 | #ifndef IRDA_NETNODE_H | 1 | #ifndef IRDA_NETNODE_H |
2 | #define IRDA_NETNODE_H | 2 | #define IRDA_NETNODE_H |
3 | 3 | ||
4 | #include "netnode.h" | 4 | #include "netnode.h" |
5 | 5 | ||
6 | class AIRDA; | 6 | class AIRDA; |
7 | 7 | ||
8 | class IRDANetNode : public ANetNode { | 8 | class IRDANetNode : public ANetNode { |
9 | 9 | ||
10 | Q_OBJECT | 10 | Q_OBJECT |
11 | 11 | ||
12 | public: | 12 | public: |
13 | 13 | ||
14 | IRDANetNode(); | 14 | IRDANetNode(); |
15 | virtual ~IRDANetNode(); | 15 | virtual ~IRDANetNode(); |
16 | 16 | ||
17 | virtual const QString pixmapName() | 17 | virtual const QString pixmapName() |
18 | { return "Devices/irda"; } | 18 | { return "Devices/irda"; } |
19 | 19 | ||
20 | virtual const QString nodeDescription() ; | 20 | virtual const QString nodeDescription() ; |
21 | 21 | virtual ANetNodeInstance * createInstance( void ); | |
22 | virtual ANetNodeInstance * createInstance( void ); | 22 | virtual const char ** needs( void ); |
23 | 23 | virtual const char * provides( 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 & ) | ||
29 | { return 0; } | ||
30 | virtual bool generateDeviceDataForCommonFile( | ||
31 | SystemFile & SF, long DevNr ); | ||
32 | 24 | ||
33 | private: | 25 | private: |
34 | 26 | ||
35 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); | 27 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); |
36 | virtual void saveSpecificAttribute( QTextStream & TS ); | 28 | virtual void saveSpecificAttribute( QTextStream & TS ); |
37 | }; | 29 | }; |
38 | 30 | ||
39 | extern "C" | 31 | extern "C" |
40 | { | 32 | { |
41 | void create_plugin( QList<ANetNode> & PNN ); | 33 | void create_plugin( QList<ANetNode> & PNN ); |
42 | }; | 34 | }; |
43 | 35 | ||
44 | #endif | 36 | #endif |
diff --git a/noncore/settings/networksettings2/irda/irda_NNI.cpp b/noncore/settings/networksettings2/irda/irda_NNI.cpp index f00a1d5..9cf443b 100644 --- a/noncore/settings/networksettings2/irda/irda_NNI.cpp +++ b/noncore/settings/networksettings2/irda/irda_NNI.cpp | |||
@@ -8,30 +8,24 @@ AIRDA::AIRDA( IRDANetNode * PNN ) : ANetNodeInstance( PNN ) { | |||
8 | RT = 0; | 8 | RT = 0; |
9 | } | 9 | } |
10 | 10 | ||
11 | void AIRDA::setSpecificAttribute( QString & , QString & ) { | 11 | void AIRDA::setSpecificAttribute( QString & , QString & ) { |
12 | } | 12 | } |
13 | 13 | ||
14 | void AIRDA::saveSpecificAttribute( QTextStream & ) { | 14 | void AIRDA::saveSpecificAttribute( QTextStream & ) { |
15 | } | 15 | } |
16 | 16 | ||
17 | QWidget * AIRDA::edit( QWidget * parent ) { | 17 | QWidget * AIRDA::edit( QWidget * parent ) { |
18 | GUI = new IRDAEdit( parent ); | 18 | GUI = new IRDAEdit( parent ); |
19 | GUI->showData( Data ); | 19 | GUI->showData( Data ); |
20 | return GUI; | 20 | return GUI; |
21 | } | 21 | } |
22 | 22 | ||
23 | QString AIRDA::acceptable( void ) { | 23 | QString AIRDA::acceptable( void ) { |
24 | return ( GUI ) ? GUI->acceptable( ) : QString(); | 24 | return ( GUI ) ? GUI->acceptable( ) : QString(); |
25 | } | 25 | } |
26 | 26 | ||
27 | void AIRDA::commit( void ) { | 27 | void AIRDA::commit( void ) { |
28 | if( GUI && GUI->commit( Data ) ) | 28 | if( GUI && GUI->commit( Data ) ) |
29 | setModified( 1 ); | 29 | setModified( 1 ); |
30 | } | 30 | } |
31 | 31 | ||
32 | bool AIRDA::generateDataForCommonFile( | ||
33 | SystemFile & , | ||
34 | long ) { | ||
35 | return 1; | ||
36 | } | ||
37 | |||
diff --git a/noncore/settings/networksettings2/irda/irda_NNI.h b/noncore/settings/networksettings2/irda/irda_NNI.h index 210d87d..e21b68f 100644 --- a/noncore/settings/networksettings2/irda/irda_NNI.h +++ b/noncore/settings/networksettings2/irda/irda_NNI.h | |||
@@ -1,48 +1,42 @@ | |||
1 | #ifndef IRDA_H | 1 | #ifndef IRDA_H |
2 | #define IRDA_H | 2 | #define IRDA_H |
3 | 3 | ||
4 | #include <netnode.h> | 4 | #include <netnode.h> |
5 | #include "irdadata.h" | 5 | #include "irdadata.h" |
6 | #include "irdarun.h" | 6 | #include "irdarun.h" |
7 | 7 | ||
8 | class IRDANetNode; | 8 | class IRDANetNode; |
9 | class IRDAEdit; | 9 | class IRDAEdit; |
10 | 10 | ||
11 | class AIRDA : public ANetNodeInstance { | 11 | class AIRDA : public ANetNodeInstance { |
12 | 12 | ||
13 | public : | 13 | public : |
14 | 14 | ||
15 | AIRDA( IRDANetNode * PNN ); | 15 | AIRDA( IRDANetNode * PNN ); |
16 | 16 | ||
17 | RuntimeInfo * runtime( void ) | ||
18 | { return | ||
19 | ( RT ) ? RT : ( RT = new IRDARun( 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 IRDARun( 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 & ) | ||
31 | { return 0; } | ||
32 | virtual bool generateDataForCommonFile( | ||
33 | SystemFile & SF, long DevNr ); | ||
34 | |||
35 | protected : | 29 | protected : |
36 | 30 | ||
37 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); | 31 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); |
38 | virtual void saveSpecificAttribute( QTextStream & TS ); | 32 | virtual void saveSpecificAttribute( QTextStream & TS ); |
39 | 33 | ||
40 | private : | 34 | private : |
41 | 35 | ||
42 | IRDAEdit * GUI; | 36 | IRDAEdit * GUI; |
43 | IRDAData Data; | 37 | IRDAData Data; |
44 | IRDARun * RT; | 38 | IRDARun * RT; |
45 | 39 | ||
46 | }; | 40 | }; |
47 | 41 | ||
48 | #endif | 42 | #endif |
diff --git a/noncore/settings/networksettings2/irda/irdarun.h b/noncore/settings/networksettings2/irda/irdarun.h index 4c903cc..4258aff 100644 --- a/noncore/settings/networksettings2/irda/irdarun.h +++ b/noncore/settings/networksettings2/irda/irdarun.h | |||
@@ -1,25 +1,28 @@ | |||
1 | #include <asline.h> | 1 | #include <asline.h> |
2 | #include "irdadata.h" | 2 | #include "irdadata.h" |
3 | 3 | ||
4 | class IRDARun : public AsLine { | 4 | class IRDARun : public AsLine { |
5 | 5 | ||
6 | public : | 6 | public : |
7 | 7 | ||
8 | IRDARun( ANetNodeInstance * NNI, | 8 | IRDARun( ANetNodeInstance * NNI, |
9 | IRDAData & Data ) : AsLine( NNI ) | 9 | IRDAData & 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/irda" ); } | ||
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 | }; |