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 | |||
@@ -7,2 +7,7 @@ static const char * CableNeeds[] = | |||
7 | 7 | ||
8 | static const char * CableProvides[] = | ||
9 | { "line", | ||
10 | 0 | ||
11 | }; | ||
12 | |||
8 | /** | 13 | /** |
@@ -34,4 +39,4 @@ const char ** CableNetNode::needs( void ) { | |||
34 | 39 | ||
35 | const char * CableNetNode::provides( void ) { | 40 | const char ** CableNetNode::provides( void ) { |
36 | return "line"; | 41 | return CableProvides; |
37 | } | 42 | } |
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 | |||
@@ -22,3 +22,3 @@ public: | |||
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 | ||
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 | |||
@@ -51,5 +51,3 @@ void ACable::saveSpecificAttribute( QTextStream & TS ) { | |||
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 ) { |
@@ -58,8 +56,8 @@ short ACable::generateFileEmbedded( const QString & ID, | |||
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 |
@@ -69,3 +67,3 @@ short ACable::generateFileEmbedded( const QString & ID, | |||
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 : |
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 | |||
@@ -28,5 +28,3 @@ public : | |||
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 ); |
@@ -40,3 +38,3 @@ private : | |||
40 | CableEdit * GUI; | 38 | CableEdit * GUI; |
41 | CableData_t Data; | 39 | CableData Data; |
42 | CableRun * RT; | 40 | CableRun * RT; |
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 | |||
@@ -5,3 +5,6 @@ | |||
5 | 5 | ||
6 | typedef struct CableData { | 6 | class CableData { |
7 | |||
8 | public : | ||
9 | |||
7 | QString Device; | 10 | QString Device; |
@@ -15,3 +18,3 @@ typedef struct CableData { | |||
15 | 18 | ||
16 | } CableData_t; | 19 | }; |
17 | 20 | ||
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 | |||
@@ -19,3 +19,3 @@ CableEdit::CableEdit( QWidget * Parent ) : CableGUI( Parent ) { | |||
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 ); |
@@ -42,3 +42,3 @@ QString CableEdit::acceptable( void ) { | |||
42 | 42 | ||
43 | bool CableEdit::commit( CableData_t & D ) { | 43 | bool CableEdit::commit( CableData & D ) { |
44 | bool SM = 0; | 44 | bool SM = 0; |
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 | |||
@@ -9,4 +9,4 @@ public : | |||
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 | |||
@@ -4,3 +4,3 @@ | |||
4 | 4 | ||
5 | void CableRun::detectState( NodeCollection * NC ) { | 5 | State_t CableRun::detectState( void ) { |
6 | 6 | ||
@@ -9,18 +9,10 @@ void CableRun::detectState( NodeCollection * NC ) { | |||
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 | } |
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,5 +1,5 @@ | |||
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 | ||
@@ -8,7 +8,7 @@ public : | |||
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 | ||
@@ -16,7 +16,7 @@ public : | |||
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 | ||
@@ -24,3 +24,3 @@ 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,2 +1,2 @@ | |||
1 | Package: opie-networksettingsplugin2-bluetooth | 1 | Package: opie-networksettings2plugin-cable |
2 | Files: plugins/networksettings2/libcable.so* | 2 | Files: plugins/networksettings2/libcable.so* |