Diffstat (limited to 'noncore/settings/networksettings2/profile/profileedit.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/profile/profileedit.cpp | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/noncore/settings/networksettings2/profile/profileedit.cpp b/noncore/settings/networksettings2/profile/profileedit.cpp index ad943fe..1713f0c 100644 --- a/noncore/settings/networksettings2/profile/profileedit.cpp +++ b/noncore/settings/networksettings2/profile/profileedit.cpp | |||
@@ -1,7 +1,9 @@ | |||
1 | #include <qlabel.h> | 1 | #include <qlabel.h> |
2 | #include <qgroupbox.h> | ||
3 | #include <qpushbutton.h> | ||
2 | #include <qframe.h> | 4 | #include <qframe.h> |
3 | #include <qcheckbox.h> | 5 | #include <qcheckbox.h> |
4 | #include <qmultilineedit.h> | 6 | #include <qmultilineedit.h> |
5 | #include <qcheckbox.h> | 7 | #include <qcheckbox.h> |
6 | 8 | ||
7 | #include <GUIUtils.h> | 9 | #include <GUIUtils.h> |
@@ -20,19 +22,23 @@ ProfileEdit::ProfileEdit( QWidget * Parent, ANetNodeInstance * TNNI ) : | |||
20 | 22 | ||
21 | NNI = TNNI; | 23 | NNI = TNNI; |
22 | Dev = NNI->runtime()->device(); | 24 | Dev = NNI->runtime()->device(); |
23 | if( ( II = NNI->networkSetup()->assignedInterface() ) ) { | 25 | if( ( II = NNI->networkSetup()->assignedInterface() ) ) { |
24 | 26 | ||
25 | Refresh_CB->setEnabled( TRUE ); | 27 | Refresh_CB->setEnabled( TRUE ); |
26 | Snd_GB->setEnabled( TRUE ); | 28 | ResetODO_But->setEnabled( TRUE ); |
27 | Rcv_GB->setEnabled( TRUE ); | 29 | Sending_GB->setEnabled( TRUE ); |
28 | Collisions_FRM->setEnabled( TRUE ); | 30 | Receiving_GB->setEnabled( TRUE ); |
31 | Misc_GB->setEnabled( TRUE ); | ||
29 | 32 | ||
30 | // show current content | 33 | // show current content |
31 | SLOT_Refresh(); | 34 | SLOT_Refresh(); |
32 | 35 | ||
36 | // initialize ODO | ||
37 | SLOT_ResetODO(); | ||
38 | |||
33 | // fill in static data | 39 | // fill in static data |
34 | InterfaceName_LBL->setText( II->Name ); | 40 | InterfaceName_LBL->setText( II->Name ); |
35 | IPAddress_LBL->setText( II->Address ); | 41 | IPAddress_LBL->setText( II->Address ); |
36 | SubnetMask_LBL->setText( II->Netmask ); | 42 | SubnetMask_LBL->setText( II->Netmask ); |
37 | Broadcast_LBL->setText( II->BCastAddress ); | 43 | Broadcast_LBL->setText( II->BCastAddress ); |
38 | MACAddress_LBL->setText( II->MACAddress ); | 44 | MACAddress_LBL->setText( II->MACAddress ); |
@@ -79,24 +85,41 @@ bool ProfileEdit::commit( ProfileData & Data ) { | |||
79 | 85 | ||
80 | return SM; | 86 | return SM; |
81 | } | 87 | } |
82 | 88 | ||
83 | void ProfileEdit::SLOT_Refresh( void ) { | 89 | void ProfileEdit::SLOT_Refresh( void ) { |
84 | InterfaceInfo * II = NNI->networkSetup()->assignedInterface(); | 90 | InterfaceInfo * II = NNI->networkSetup()->assignedInterface(); |
91 | QString S; | ||
85 | NSResources->system().refreshStatistics( *II ); | 92 | NSResources->system().refreshStatistics( *II ); |
93 | |||
86 | RcvBytes_LBL->setText( II->RcvBytes ); | 94 | RcvBytes_LBL->setText( II->RcvBytes ); |
87 | SndBytes_LBL->setText( II->SndBytes ); | 95 | RcvPackets_LBL->setText( II->RcvPackets ); |
88 | RcvErrors_LBL->setText( II->RcvErrors ); | 96 | RcvErrors_LBL->setText( II->RcvErrors ); |
89 | SndErrors_LBL->setText( II->SndErrors ); | ||
90 | RcvDropped_LBL->setText( II->RcvDropped ); | 97 | RcvDropped_LBL->setText( II->RcvDropped ); |
98 | S.setNum( II->RcvBytes.toLong() - RcvODO ); | ||
99 | RcvODO_LBL->setText( S ); | ||
100 | |||
101 | SndBytes_LBL->setText( II->SndBytes ); | ||
102 | SndPackets_LBL->setText( II->SndPackets ); | ||
103 | SndErrors_LBL->setText( II->SndErrors ); | ||
91 | SndDropped_LBL->setText( II->SndDropped ); | 104 | SndDropped_LBL->setText( II->SndDropped ); |
105 | S.setNum( II->SndBytes.toLong() - SndODO ); | ||
106 | SndODO_LBL->setText( S ); | ||
107 | |||
92 | Collisions_LBL->setText( II->Collisions ); | 108 | Collisions_LBL->setText( II->Collisions ); |
93 | } | 109 | } |
94 | 110 | ||
95 | void ProfileEdit::SLOT_AutoRefresh( bool ar ) { | 111 | void ProfileEdit::SLOT_AutoRefresh( bool ar ) { |
96 | if( ar ) { | 112 | if( ar ) { |
97 | RefreshTimer.start( 1000 ); | 113 | RefreshTimer.start( 1000 ); |
98 | SLOT_Refresh(); | 114 | SLOT_Refresh(); |
99 | } else { | 115 | } else { |
100 | RefreshTimer.stop(); | 116 | RefreshTimer.stop(); |
101 | } | 117 | } |
102 | } | 118 | } |
119 | |||
120 | void ProfileEdit::SLOT_ResetODO( void ) { | ||
121 | InterfaceInfo * II = NNI->networkSetup()->assignedInterface(); | ||
122 | RcvODO = II->RcvBytes.toLong(); | ||
123 | SndODO = II->SndBytes.toLong(); | ||
124 | SLOT_Refresh(); | ||
125 | } | ||