Diffstat (limited to 'noncore/settings/networksettings2/profile') (more/less context) (ignore whitespace changes)
4 files changed, 11 insertions, 8 deletions
diff --git a/noncore/settings/networksettings2/profile/profileedit.cpp b/noncore/settings/networksettings2/profile/profileedit.cpp index 3f72c52..c9fb650 100644 --- a/noncore/settings/networksettings2/profile/profileedit.cpp +++ b/noncore/settings/networksettings2/profile/profileedit.cpp | |||
@@ -8,22 +8,24 @@ | |||
8 | #include <asdevice.h> | 8 | #include <asdevice.h> |
9 | #include <resources.h> | 9 | #include <resources.h> |
10 | 10 | ||
11 | #include "profileedit.h" | 11 | #include "profileedit.h" |
12 | 12 | ||
13 | ProfileEdit::ProfileEdit( QWidget * Parent, ANetNodeInstance * TNNI ) : | 13 | ProfileEdit::ProfileEdit( QWidget * Parent, ANetNodeInstance * TNNI ) : |
14 | ProfileGUI( Parent ), TrafficRefresh(this) { | 14 | ProfileGUI( Parent ), RefreshTimer(this) { |
15 | InterfaceInfo * II; | 15 | InterfaceInfo * II; |
16 | 16 | ||
17 | NNI = TNNI; | 17 | NNI = TNNI; |
18 | Dev = NNI->runtime()->device(); | 18 | Dev = NNI->runtime()->device(); |
19 | if( ( II = Dev->assignedInterface() ) ) { | 19 | if( ( II = Dev->assignedInterface() ) ) { |
20 | |||
20 | Refresh_CB->setEnabled( TRUE ); | 21 | Refresh_CB->setEnabled( TRUE ); |
21 | Snd_GB->setEnabled( TRUE ); | 22 | Snd_GB->setEnabled( TRUE ); |
22 | Rcv_GB->setEnabled( TRUE ); | 23 | Rcv_GB->setEnabled( TRUE ); |
23 | Collisions_FRM->setEnabled( TRUE ); | 24 | Collisions_FRM->setEnabled( TRUE ); |
25 | |||
24 | // show current content | 26 | // show current content |
25 | SLOT_Refresh(); | 27 | SLOT_Refresh(); |
26 | 28 | ||
27 | // fill in static data | 29 | // fill in static data |
28 | InterfaceName_LBL->setText( II->Name ); | 30 | InterfaceName_LBL->setText( II->Name ); |
29 | IPAddress_LBL->setText( II->Address ); | 31 | IPAddress_LBL->setText( II->Address ); |
@@ -39,16 +41,17 @@ ProfileEdit::ProfileEdit( QWidget * Parent, ANetNodeInstance * TNNI ) : | |||
39 | S += "Multicast"; | 41 | S += "Multicast"; |
40 | } | 42 | } |
41 | if( ! S.isEmpty() ) { | 43 | if( ! S.isEmpty() ) { |
42 | S.prepend( " : " ); | 44 | S.prepend( " : " ); |
43 | } | 45 | } |
44 | InterfaceOptions_LBL->setText( S ); | 46 | InterfaceOptions_LBL->setText( S ); |
47 | |||
48 | connect( &RefreshTimer, SIGNAL( timeout() ), | ||
49 | this, SLOT( SLOT_Refresh() ) ); | ||
45 | } | 50 | } |
46 | 51 | ||
47 | connect( &TrafficRefresh, SIGNAL( timeout() ), | ||
48 | this, SLOT( SLOT_Refresh() ) ); | ||
49 | } | 52 | } |
50 | 53 | ||
51 | QString ProfileEdit::acceptable( void ) { | 54 | QString ProfileEdit::acceptable( void ) { |
52 | return QString(); | 55 | return QString(); |
53 | } | 56 | } |
54 | 57 | ||
@@ -82,12 +85,12 @@ void ProfileEdit::SLOT_Refresh( void ) { | |||
82 | SndDropped_LBL->setText( II->SndDropped ); | 85 | SndDropped_LBL->setText( II->SndDropped ); |
83 | Collisions_LBL->setText( II->Collisions ); | 86 | Collisions_LBL->setText( II->Collisions ); |
84 | } | 87 | } |
85 | 88 | ||
86 | void ProfileEdit::SLOT_AutoRefresh( bool ar ) { | 89 | void ProfileEdit::SLOT_AutoRefresh( bool ar ) { |
87 | if( ar ) { | 90 | if( ar ) { |
88 | TrafficRefresh.start( 1000 ); | 91 | RefreshTimer.start( 1000 ); |
89 | SLOT_Refresh(); | 92 | SLOT_Refresh(); |
90 | } else { | 93 | } else { |
91 | TrafficRefresh.stop(); | 94 | RefreshTimer.stop(); |
92 | } | 95 | } |
93 | } | 96 | } |
diff --git a/noncore/settings/networksettings2/profile/profileedit.h b/noncore/settings/networksettings2/profile/profileedit.h index 8ca34be..b186b58 100644 --- a/noncore/settings/networksettings2/profile/profileedit.h +++ b/noncore/settings/networksettings2/profile/profileedit.h | |||
@@ -20,10 +20,10 @@ public slots : | |||
20 | 20 | ||
21 | void SLOT_AutoRefresh( bool ); | 21 | void SLOT_AutoRefresh( bool ); |
22 | void SLOT_Refresh( void ); | 22 | void SLOT_Refresh( void ); |
23 | 23 | ||
24 | private : | 24 | private : |
25 | 25 | ||
26 | QTimer TrafficRefresh; | 26 | QTimer RefreshTimer; |
27 | ANetNodeInstance * NNI; | 27 | ANetNodeInstance * NNI; |
28 | AsDevice * Dev; | 28 | AsDevice * Dev; |
29 | }; | 29 | }; |
diff --git a/noncore/settings/networksettings2/profile/profilerun.cpp b/noncore/settings/networksettings2/profile/profilerun.cpp index feebf86..79bb93e 100644 --- a/noncore/settings/networksettings2/profile/profilerun.cpp +++ b/noncore/settings/networksettings2/profile/profilerun.cpp | |||
@@ -9,13 +9,13 @@ void ProfileRun::detectState( NodeCollection * NC ) { | |||
9 | // find next item in connection | 9 | // find next item in connection |
10 | // convert to runtime and ask to detect the state | 10 | // convert to runtime and ask to detect the state |
11 | netNode()->nextNode()->runtime()->detectState( NC ); | 11 | netNode()->nextNode()->runtime()->detectState( NC ); |
12 | } | 12 | } |
13 | } | 13 | } |
14 | 14 | ||
15 | bool ProfileRun::setState( NodeCollection * NC, Action_t A ) { | 15 | bool ProfileRun::setState( NodeCollection * NC, Action_t A, bool ) { |
16 | ANetNodeInstance * NNNI; | 16 | ANetNodeInstance * NNNI; |
17 | 17 | ||
18 | NNNI = netNode()->nextNode(); | 18 | NNNI = netNode()->nextNode(); |
19 | switch ( A ) { | 19 | switch ( A ) { |
20 | case Enable : | 20 | case Enable : |
21 | if( NC->currentState() == Disabled ) { | 21 | if( NC->currentState() == Disabled ) { |
diff --git a/noncore/settings/networksettings2/profile/profilerun.h b/noncore/settings/networksettings2/profile/profilerun.h index 6e8385c..c8ea063 100644 --- a/noncore/settings/networksettings2/profile/profilerun.h +++ b/noncore/settings/networksettings2/profile/profilerun.h | |||
@@ -10,13 +10,13 @@ public : | |||
10 | 10 | ||
11 | ProfileRun( ANetNodeInstance * NNI, ProfileData & D ) : | 11 | ProfileRun( ANetNodeInstance * NNI, ProfileData & D ) : |
12 | AsFullSetup( NNI ) | 12 | AsFullSetup( NNI ) |
13 | { Data = &D; } | 13 | { Data = &D; } |
14 | 14 | ||
15 | void detectState( NodeCollection * NC ); | 15 | void detectState( NodeCollection * NC ); |
16 | bool setState( NodeCollection * NC, Action_t A ); | 16 | bool setState( NodeCollection * NC, Action_t A, bool ); |
17 | bool canSetState( State_t Curr, Action_t A ); | 17 | bool canSetState( State_t Curr, Action_t A ); |
18 | 18 | ||
19 | bool handlesInterface( const QString & I ); | 19 | bool handlesInterface( const QString & I ); |
20 | 20 | ||
21 | virtual const QString & description( void ) | 21 | virtual const QString & description( void ) |
22 | { return Data->Description; } | 22 | { return Data->Description; } |