summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/cable
authorwimpie <wimpie>2005-01-04 01:35:26 (UTC)
committer wimpie <wimpie>2005-01-04 01:35:26 (UTC)
commita9c188235c97e07b0eb96b13adbcdfd4bad64767 (patch) (unidiff)
tree13f6ae5c499dc0c1d1bd4b763a1973a0fa8635cf /noncore/settings/networksettings2/cable
parent48b6cd5966ec6cc0b968edf10ba1a1ad96ef165f (diff)
downloadopie-a9c188235c97e07b0eb96b13adbcdfd4bad64767.zip
opie-a9c188235c97e07b0eb96b13adbcdfd4bad64767.tar.gz
opie-a9c188235c97e07b0eb96b13adbcdfd4bad64767.tar.bz2
CONTROL files : changed version string
NS2 many changes and first release of OT2
Diffstat (limited to 'noncore/settings/networksettings2/cable') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/cable/cable_NN.cpp9
-rw-r--r--noncore/settings/networksettings2/cable/cable_NN.h2
-rw-r--r--noncore/settings/networksettings2/cable/cable_NNI.cpp14
-rw-r--r--noncore/settings/networksettings2/cable/cable_NNI.h6
-rw-r--r--noncore/settings/networksettings2/cable/cabledata.h7
-rw-r--r--noncore/settings/networksettings2/cable/cableedit.cpp4
-rw-r--r--noncore/settings/networksettings2/cable/cableedit.h4
-rw-r--r--noncore/settings/networksettings2/cable/cablerun.cpp18
-rw-r--r--noncore/settings/networksettings2/cable/cablerun.h18
-rw-r--r--noncore/settings/networksettings2/cable/opie-networksettings2plugin-cable.control2
10 files changed, 40 insertions, 44 deletions
diff --git a/noncore/settings/networksettings2/cable/cable_NN.cpp b/noncore/settings/networksettings2/cable/cable_NN.cpp
index 38568df..dc4205c 100644
--- a/noncore/settings/networksettings2/cable/cable_NN.cpp
+++ b/noncore/settings/networksettings2/cable/cable_NN.cpp
@@ -5,6 +5,11 @@ static const char * CableNeeds[] =
5 { 0 5 { 0
6 }; 6 };
7 7
8static const char * CableProvides[] =
9 { "line",
10 0
11 };
12
8/** 13/**
9 * Constructor, find all of the possible interfaces 14 * Constructor, find all of the possible interfaces
10 */ 15 */
@@ -32,8 +37,8 @@ const char ** CableNetNode::needs( void ) {
32 return CableNeeds; 37 return CableNeeds;
33} 38}
34 39
35const char * CableNetNode::provides( void ) { 40const char ** CableNetNode::provides( void ) {
36 return "line"; 41 return CableProvides;
37} 42}
38 43
39void CableNetNode::setSpecificAttribute( QString & , QString & ) { 44void CableNetNode::setSpecificAttribute( QString & , QString & ) {
diff --git a/noncore/settings/networksettings2/cable/cable_NN.h b/noncore/settings/networksettings2/cable/cable_NN.h
index 5cc2b2d..8d649cc 100644
--- a/noncore/settings/networksettings2/cable/cable_NN.h
+++ b/noncore/settings/networksettings2/cable/cable_NN.h
@@ -20,7 +20,7 @@ public:
20 virtual const QString nodeDescription() ; 20 virtual const QString nodeDescription() ;
21 virtual ANetNodeInstance * createInstance( void ); 21 virtual ANetNodeInstance * createInstance( void );
22 virtual const char ** needs( void ); 22 virtual const char ** needs( void );
23 virtual const char * provides( void ); 23 virtual const char ** provides( void );
24 24
25private: 25private:
26 26
diff --git a/noncore/settings/networksettings2/cable/cable_NNI.cpp b/noncore/settings/networksettings2/cable/cable_NNI.cpp
index 4bd9421..12a00a2 100644
--- a/noncore/settings/networksettings2/cable/cable_NNI.cpp
+++ b/noncore/settings/networksettings2/cable/cable_NNI.cpp
@@ -49,25 +49,23 @@ void ACable::saveSpecificAttribute( QTextStream & TS ) {
49 ((Data.SoftwareControl) ? "yes" : "no") << endl; 49 ((Data.SoftwareControl) ? "yes" : "no") << endl;
50} 50}
51 51
52short ACable::generateFileEmbedded( const QString & ID, 52short ACable::generateFileEmbedded( SystemFile & SF,
53 const QString & Path,
54 QTextStream & TS,
55 long DevNr ) { 53 long DevNr ) {
56 short rvl, rvd; 54 short rvl, rvd;
57 55
58 rvl = 1; 56 rvl = 1;
59 if( ID == "peers" ) { 57 if( SF.name() == "peers" ) {
60 TS << Data.Device 58 SF << Data.Device
61 << endl; 59 << endl;
62 TS << Data.Speed 60 SF << Data.Speed
63 << endl; 61 << endl;
64 TS << "lock " 62 SF << "lock "
65 << Data.LockFile 63 << Data.LockFile
66 << endl; 64 << endl;
67 rvl = 0; 65 rvl = 0;
68 } 66 }
69 67
70 rvd = ANetNodeInstance::generateFileEmbedded( ID, Path, TS, DevNr ); 68 rvd = ANetNodeInstance::generateFileEmbedded( SF, DevNr );
71 return (rvd == 2 || rvl == 2 ) ? 2 : 69 return (rvd == 2 || rvl == 2 ) ? 2 :
72 (rvd == 0 || rvl == 0 ) ? 0 : 1; 70 (rvd == 0 || rvl == 0 ) ? 0 : 1;
73} 71}
diff --git a/noncore/settings/networksettings2/cable/cable_NNI.h b/noncore/settings/networksettings2/cable/cable_NNI.h
index d06cbbe..18a52de 100644
--- a/noncore/settings/networksettings2/cable/cable_NNI.h
+++ b/noncore/settings/networksettings2/cable/cable_NNI.h
@@ -26,9 +26,7 @@ public :
26 virtual void * data( void ) 26 virtual void * data( void )
27 { return (void *)&Data; } 27 { return (void *)&Data; }
28 28
29 short generateFileEmbedded( const QString & ID, 29 short generateFileEmbedded( SystemFile & Sf,
30 const QString & Path,
31 QTextStream & TS,
32 long DevNr ); 30 long DevNr );
33protected : 31protected :
34 32
@@ -38,7 +36,7 @@ protected :
38private : 36private :
39 37
40 CableEdit * GUI; 38 CableEdit * GUI;
41 CableData_t Data; 39 CableData Data;
42 CableRun * RT; 40 CableRun * RT;
43 41
44}; 42};
diff --git a/noncore/settings/networksettings2/cable/cabledata.h b/noncore/settings/networksettings2/cable/cabledata.h
index c449d96..ea81f8d 100644
--- a/noncore/settings/networksettings2/cable/cabledata.h
+++ b/noncore/settings/networksettings2/cable/cabledata.h
@@ -3,7 +3,10 @@
3 3
4#include <qstring.h> 4#include <qstring.h>
5 5
6typedef struct CableData { 6class CableData {
7
8public :
9
7 QString Device; 10 QString Device;
8 QString LockFile; 11 QString LockFile;
9 long Speed; 12 long Speed;
@@ -13,6 +16,6 @@ typedef struct CableData {
13 bool HardwareControl; 16 bool HardwareControl;
14 bool SoftwareControl; 17 bool SoftwareControl;
15 18
16} CableData_t; 19};
17 20
18#endif 21#endif
diff --git a/noncore/settings/networksettings2/cable/cableedit.cpp b/noncore/settings/networksettings2/cable/cableedit.cpp
index 6e1a13b..4e57845 100644
--- a/noncore/settings/networksettings2/cable/cableedit.cpp
+++ b/noncore/settings/networksettings2/cable/cableedit.cpp
@@ -17,7 +17,7 @@ static long SpeedTable[] = {
17CableEdit::CableEdit( QWidget * Parent ) : CableGUI( Parent ) { 17CableEdit::CableEdit( QWidget * Parent ) : CableGUI( Parent ) {
18} 18}
19 19
20void CableEdit::showData( CableData_t & D ) { 20void CableEdit::showData( CableData & D ) {
21 DeviceFile_LE->setText( D.Device ); 21 DeviceFile_LE->setText( D.Device );
22 LockFile_LE->setText( D.LockFile ); 22 LockFile_LE->setText( D.LockFile );
23 for( long * Run = SpeedTable; *Run != -1; *Run ++ ) { 23 for( long * Run = SpeedTable; *Run != -1; *Run ++ ) {
@@ -40,7 +40,7 @@ QString CableEdit::acceptable( void ) {
40 return QString(); 40 return QString();
41} 41}
42 42
43bool CableEdit::commit( CableData_t & D ) { 43bool CableEdit::commit( CableData & D ) {
44 bool SM = 0; 44 bool SM = 0;
45 45
46 TXTM( D.Device, DeviceFile_LE, SM ); 46 TXTM( D.Device, DeviceFile_LE, SM );
diff --git a/noncore/settings/networksettings2/cable/cableedit.h b/noncore/settings/networksettings2/cable/cableedit.h
index ffacc61..ad1e832 100644
--- a/noncore/settings/networksettings2/cable/cableedit.h
+++ b/noncore/settings/networksettings2/cable/cableedit.h
@@ -7,6 +7,6 @@ public :
7 7
8 CableEdit( QWidget * parent ); 8 CableEdit( QWidget * parent );
9 QString acceptable( void ); 9 QString acceptable( void );
10 bool commit( CableData_t & D ); 10 bool commit( CableData & D );
11 void showData( CableData_t & D ); 11 void showData( CableData & D );
12}; 12};
diff --git a/noncore/settings/networksettings2/cable/cablerun.cpp b/noncore/settings/networksettings2/cable/cablerun.cpp
index 85660f6..7a8deb9 100644
--- a/noncore/settings/networksettings2/cable/cablerun.cpp
+++ b/noncore/settings/networksettings2/cable/cablerun.cpp
@@ -2,27 +2,19 @@
2#include <unistd.h> 2#include <unistd.h>
3#include "cablerun.h" 3#include "cablerun.h"
4 4
5void CableRun::detectState( NodeCollection * NC ) { 5State_t CableRun::detectState( void ) {
6 6
7 int fd = open( Data->Device.latin1(), O_RDWR ); 7 int fd = open( Data->Device.latin1(), O_RDWR );
8 8
9 if( fd < 0 ) { 9 if( fd < 0 ) {
10 NC->setCurrentState( Unavailable ); 10 return Unavailable;
11 } 11 }
12 close( fd ); 12 close( fd );
13 NC->setCurrentState( Available ); 13 return Available;
14} 14}
15 15
16bool CableRun::setState( NodeCollection * NC, Action_t A, bool ) { 16QString CableRun::setMyState( NodeCollection *, Action_t , bool ) {
17 if( A == Activate ) { 17 return QString();
18 detectState(NC);
19 return (NC->currentState() == Available);
20 }
21 return 1;
22}
23
24bool CableRun::canSetState( State_t , Action_t ) {
25 return 1;
26} 18}
27 19
28QString CableRun::deviceFile( void ) { 20QString CableRun::deviceFile( void ) {
diff --git a/noncore/settings/networksettings2/cable/cablerun.h b/noncore/settings/networksettings2/cable/cablerun.h
index 20608f6..41aea01 100644
--- a/noncore/settings/networksettings2/cable/cablerun.h
+++ b/noncore/settings/networksettings2/cable/cablerun.h
@@ -1,26 +1,26 @@
1#include <asline.h> 1#include <netnode.h>
2#include "cabledata.h" 2#include "cabledata.h"
3 3
4class CableRun : public AsLine { 4class CableRun : public RuntimeInfo {
5 5
6public : 6public :
7 7
8 CableRun( ANetNodeInstance * NNI, 8 CableRun( ANetNodeInstance * NNI,
9 CableData_t & D ) : AsLine( NNI ) 9 CableData & D ) : RuntimeInfo( NNI )
10 { Data = &D; } 10 { Data = &D; }
11 11
12 virtual AsLine * asLine( void ) 12 virtual RuntimeInfo * line( void )
13 { return (AsLine *)this; } 13 { return this; }
14 14
15 virtual QString deviceFile( void ); 15 virtual QString deviceFile( void );
16 16
17 State_t detectState( void );
18
17protected : 19protected :
18 20
19 void detectState( NodeCollection * NC ); 21 QString setMyState( NodeCollection * , Action_t, bool );
20 bool setState( NodeCollection * NC, Action_t A, bool Force );
21 bool canSetState( State_t Curr, Action_t A );
22 22
23private : 23private :
24 24
25 CableData_t * Data; 25 CableData * Data;
26}; 26};
diff --git a/noncore/settings/networksettings2/cable/opie-networksettings2plugin-cable.control b/noncore/settings/networksettings2/cable/opie-networksettings2plugin-cable.control
index 79520e2..dd08279 100644
--- a/noncore/settings/networksettings2/cable/opie-networksettings2plugin-cable.control
+++ b/noncore/settings/networksettings2/cable/opie-networksettings2plugin-cable.control
@@ -1,4 +1,4 @@
1Package: opie-networksettingsplugin2-bluetooth 1Package: opie-networksettings2plugin-cable
2Files: plugins/networksettings2/libcable.so* 2Files: plugins/networksettings2/libcable.so*
3Priority: optional 3Priority: optional
4Section: opie/settings 4Section: opie/settings