Diffstat (limited to 'noncore/settings/networksettings2/cable') (more/less context) (ignore whitespace changes)
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 | |||
@@ -6,4 +6,9 @@ static const char * CableNeeds[] = | |||
6 | }; | 6 | }; |
7 | 7 | ||
8 | static 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 |
@@ -33,6 +38,6 @@ const char ** CableNetNode::needs( void ) { | |||
33 | } | 38 | } |
34 | 39 | ||
35 | const char * CableNetNode::provides( void ) { | 40 | const char ** CableNetNode::provides( void ) { |
36 | return "line"; | 41 | return CableProvides; |
37 | } | 42 | } |
38 | 43 | ||
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 | |||
@@ -21,5 +21,5 @@ public: | |||
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 | ||
25 | private: | 25 | private: |
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 | |||
@@ -50,17 +50,15 @@ void ACable::saveSpecificAttribute( QTextStream & TS ) { | |||
50 | } | 50 | } |
51 | 51 | ||
52 | short ACable::generateFileEmbedded( const QString & ID, | 52 | short 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; |
@@ -68,5 +66,5 @@ short ACable::generateFileEmbedded( const QString & ID, | |||
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; |
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 | |||
@@ -27,7 +27,5 @@ public : | |||
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 ); |
33 | protected : | 31 | protected : |
@@ -39,5 +37,5 @@ private : | |||
39 | 37 | ||
40 | CableEdit * GUI; | 38 | CableEdit * GUI; |
41 | CableData_t Data; | 39 | CableData Data; |
42 | CableRun * RT; | 40 | CableRun * RT; |
43 | 41 | ||
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 | |||
@@ -4,5 +4,8 @@ | |||
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | 5 | ||
6 | typedef struct CableData { | 6 | class CableData { |
7 | |||
8 | public : | ||
9 | |||
7 | QString Device; | 10 | QString Device; |
8 | QString LockFile; | 11 | QString LockFile; |
@@ -14,5 +17,5 @@ typedef struct CableData { | |||
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 | |||
@@ -18,5 +18,5 @@ CableEdit::CableEdit( QWidget * Parent ) : CableGUI( Parent ) { | |||
18 | } | 18 | } |
19 | 19 | ||
20 | void CableEdit::showData( CableData_t & D ) { | 20 | void 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 ); |
@@ -41,5 +41,5 @@ QString CableEdit::acceptable( void ) { | |||
41 | } | 41 | } |
42 | 42 | ||
43 | bool CableEdit::commit( CableData_t & D ) { | 43 | bool CableEdit::commit( CableData & D ) { |
44 | bool SM = 0; | 44 | bool SM = 0; |
45 | 45 | ||
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 | |||
@@ -8,5 +8,5 @@ public : | |||
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 | |||
@@ -3,25 +3,17 @@ | |||
3 | #include "cablerun.h" | 3 | #include "cablerun.h" |
4 | 4 | ||
5 | void CableRun::detectState( NodeCollection * NC ) { | 5 | State_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 | ||
16 | bool CableRun::setState( NodeCollection * NC, Action_t A, bool ) { | 16 | QString 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 | |||
24 | bool CableRun::canSetState( State_t , Action_t ) { | ||
25 | return 1; | ||
26 | } | 18 | } |
27 | 19 | ||
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 | ||
4 | class CableRun : public AsLine { | 4 | class CableRun : public RuntimeInfo { |
5 | 5 | ||
6 | public : | 6 | public : |
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 | |||
17 | protected : | 19 | protected : |
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 | ||
23 | private : | 23 | private : |
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,3 +1,3 @@ | |||
1 | Package: opie-networksettingsplugin2-bluetooth | 1 | Package: opie-networksettings2plugin-cable |
2 | Files: plugins/networksettings2/libcable.so* | 2 | Files: plugins/networksettings2/libcable.so* |
3 | Priority: optional | 3 | Priority: optional |