From 4b1d4fc9f4170ec22d196dd352cae5d9c1ecb232 Mon Sep 17 00:00:00 2001 From: wimpie Date: Wed, 12 Jan 2005 00:09:13 +0000 Subject: GUI changes to profileedit --- (limited to 'noncore/settings') diff --git a/noncore/settings/networksettings2/networksettings2/resources.cpp b/noncore/settings/networksettings2/networksettings2/resources.cpp index 2dd91f8..4d46778 100644 --- a/noncore/settings/networksettings2/networksettings2/resources.cpp +++ b/noncore/settings/networksettings2/networksettings2/resources.cpp @@ -80,12 +80,12 @@ TheNSResources::TheNSResources( void ) : NodeTypeNameMap(), tr( "

Devices that can handle IP packets

" ) ); addNodeType( "line", tr( "Character device" ), tr( "

Devices that can handle single bytes

" ) ); - addNodeType( "NetworkSetup", tr( "IP NetworkSetup" ), - tr( "

Nodes that provide working IP NetworkSetups

" ) ); - addNodeType( "fullsetup", tr( "NetworkSetup Profile" ), - tr( "

Fully configured NetworkSetup profile

" ) ); - addNodeType( "GPRS", tr( "NetworkSetup to GPRS device" ), - tr( "

NetworkSetup to a GPRS capable device

" ) ); + addNodeType( "connection", tr( "IP Connection" ), + tr( "

Nodes that provide working IP connection

" ) ); + addNodeType( "fullsetup", tr( "Connection Profile" ), + tr( "

Fully configured network profile

" ) ); + addNodeType( "GPRS", tr( "Connection to GPRS device" ), + tr( "

Connection to a GPRS capable device

" ) ); // get access to the system TheSystem = new System(); diff --git a/noncore/settings/networksettings2/networksettings2/system.cpp b/noncore/settings/networksettings2/networksettings2/system.cpp index 33cc5bd..82f5c43 100644 --- a/noncore/settings/networksettings2/networksettings2/system.cpp +++ b/noncore/settings/networksettings2/networksettings2/system.cpp @@ -218,36 +218,48 @@ void System::refreshStatistics( InterfaceInfo & I ) { continue; // tokenize - SL = QStringList::split( ' ', line, FALSE ); + SL = QStringList::split( ' ', line.mid(loc+1), FALSE ); // update data switch( version ) { case 1 : - I.RcvBytes = SL[1]; - I.RcvErrors = SL[3]; - I.RcvDropped = SL[4]; + I.RcvBytes = ""; + I.RcvPackets = SL[0]; + I.RcvErrors = SL[1]; + I.RcvDropped = SL[2]; + + I.SndBytes = ""; + I.SndPackets = SL[5]; + I.SndErrors = SL[6]; + I.SndDropped = SL[7]; + + I.Collisions = SL[9]; + break; + case 2 : + I.RcvBytes = SL[0]; + I.RcvPackets = SL[1]; + I.RcvErrors = SL[2]; + I.RcvDropped = SL[3]; + I.SndBytes = SL[6]; + I.SndPackets = SL[7]; I.SndErrors = SL[8]; I.SndDropped = SL[9]; + I.Collisions = SL[11]; break; - case 2 : - I.RcvBytes = SL[1]; - I.RcvErrors = SL[3]; - I.RcvDropped = SL[4]; - I.SndBytes = SL[7]; - I.SndErrors = SL[9]; - I.SndDropped = SL[10]; - I.Collisions = SL[12]; - break; case 3 : - I.RcvBytes = SL[1]; - I.RcvErrors = SL[3]; - I.RcvDropped = SL[4]; - I.SndBytes = SL[9]; - I.SndErrors = SL[11]; - I.SndDropped = SL[12]; - I.Collisions = SL[14]; + I.RcvBytes = SL[0]; + I.RcvPackets = SL[1]; + I.RcvErrors = SL[2]; + I.RcvDropped = SL[3]; + + I.SndBytes = SL[8]; + I.SndPackets = SL[9]; + I.SndErrors = SL[10]; + I.SndDropped = SL[11]; + + I.Collisions = SL[13]; break; } break; diff --git a/noncore/settings/networksettings2/networksettings2/system.h b/noncore/settings/networksettings2/networksettings2/system.h index 794b868..52613d8 100644 --- a/noncore/settings/networksettings2/networksettings2/system.h +++ b/noncore/settings/networksettings2/networksettings2/system.h @@ -85,10 +85,13 @@ public : bool IsPointToPoint; // IsPointToPoint card QString RcvBytes; - QString SndBytes; QString RcvErrors; - QString SndErrors; + QString RcvPackets; QString RcvDropped; + + QString SndBytes; + QString SndErrors; + QString SndPackets; QString SndDropped; QString Collisions; }; diff --git a/noncore/settings/networksettings2/profile/profileGUI.ui b/noncore/settings/networksettings2/profile/profileGUI.ui index 5bf9a9c..8b421e8 100644 --- a/noncore/settings/networksettings2/profile/profileGUI.ui +++ b/noncore/settings/networksettings2/profile/profileGUI.ui @@ -11,8 +11,8 @@ 0 0 - 276 - 231 + 551 + 547 @@ -28,11 +28,11 @@ margin - 0 + 1 spacing - 0 + 3 QTabWidget @@ -948,66 +948,18 @@ 0 - QLayoutWidget + QGroupBox name - Layout5 + Receiving_GB - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - TextLabel1_2 - - - sizePolicy - - 0 - 1 - - - - text - Receiving - - - - - name - Spacer17_2 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - - - QLayoutWidget - name - Layout43 + enabled + false + + + title + Receiving layoutMargin @@ -1015,103 +967,82 @@ layoutSpacing - + margin - 2 + 4 spacing - 0 + 2 - QFrame + QLayoutWidget name - Frame114 - - - sizePolicy - - 0 - 5 - - - - minimumSize - - 5 - 0 - - - - maximumSize - - 5 - 32767 - - - - frameShape - NoFrame - - - frameShadow - Raised - - - - QFrame - - name - Rcv_GB - - - enabled - false - - - sizePolicy - - 7 - 5 - - - - frameShape - NoFrame - - - frameShadow - Raised - - - layoutMargin + Layout11 layoutSpacing - + margin 0 spacing - 1 + 2 - + QLabel name - TextLabel1_5_9 + xxxxxxxxxxxxx text - Errors + Pkt - + + QLabel + + name + RcvPackets_LBL + + + sizePolicy + + 7 + 1 + + + + frameShape + Panel + + + frameShadow + Sunken + + + indent + 0 + + + + QLabel + + name + TextLabel1_5_3_4 + + + text + Bytes + + + QLabel name @@ -1137,11 +1068,22 @@ 0 - + QLabel name - RcvDropped_LBL + TextLabel1_5_3_4_2 + + + text + ODO + + + + QLabel + + name + RcvODO_LBL sizePolicy @@ -1163,7 +1105,38 @@ 0 - + + + + QLayoutWidget + + name + Layout12 + + + layoutSpacing + + + + margin + 0 + + + spacing + 2 + + + QLabel + + name + TextLabel1_5_9 + + + text + Errors + + + QLabel name @@ -1189,7 +1162,7 @@ 0 - + QLabel name @@ -1200,82 +1173,121 @@ Dropped - + QLabel name - TextLabel1_5_3 + RcvDropped_LBL - text - Bytes + sizePolicy + + 7 + 1 + + + + frameShape + Panel + + + frameShadow + Sunken + + + indent + 0 - + - + - QLayoutWidget + QFrame name - Layout6 + Frame114 + + + sizePolicy + + 0 + 5 + + + + minimumSize + + 5 + 0 + + + + maximumSize + + 5 + 32767 + + + + frameShape + NoFrame + + + frameShadow + Raised - - - margin - 0 - - - spacing - 6 - - - QLabel - - name - TextLabel1 - - - sizePolicy - - 0 - 1 - - - - text - Transmitting - - - - - name - Spacer18_2 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - QLayoutWidget + QFrame name - Layout44 + Frame115 + + + sizePolicy + + 0 + 5 + + + + minimumSize + + 5 + 0 + + + + maximumSize + + 5 + 32767 + + + + frameShape + NoFrame + + + frameShadow + Plain + + + + QGroupBox + + name + Sending_GB + + + enabled + false + + + title + Sending layoutMargin @@ -1283,129 +1295,123 @@ layoutSpacing - + margin - 2 + 4 spacing - 0 + 2 - QFrame + QLayoutWidget name - Frame115 - - - sizePolicy - - 0 - 5 - - - - minimumSize - - 5 - 0 - - - - maximumSize - - 5 - 32767 - - - - frameShape - NoFrame - - - frameShadow - Plain - - - - QFrame - - name - Snd_GB - - - enabled - false - - - sizePolicy - - 7 - 5 - - - - frameShape - NoFrame - - - frameShadow - Raised - - - layoutMargin + Layout13 layoutSpacing - + margin 0 spacing - 1 + 2 - + QLabel name - TextLabel1_5_9_2 + dfsfadf text - Errors + Pkt - + QLabel name - TextLabel1_5_4_2 + SndPackets_LBL - text - Dropped + sizePolicy + + 7 + 1 + + + + frameShape + Panel + + + frameShadow + Sunken + + + indent + 0 - + QLabel name - TextLabel1_5_3_2 + TextLabel1_5_3_4_4 text Bytes - + QLabel name - SndDropped_LBL + SndBytes_LBL + + + sizePolicy + + 7 + 1 + + + + frameShape + Panel + + + frameShadow + Sunken + + + indent + 0 + + + + QLabel + + name + TextLabel1_5_3_4_2_3 + + + text + ODO + + + + QLabel + + name + SndODO_LBL sizePolicy @@ -1427,7 +1433,38 @@ 0 - + + + + QLayoutWidget + + name + Layout14 + + + layoutSpacing + + + + margin + 0 + + + spacing + 2 + + + QLabel + + name + TextLabel1_5_9_3 + + + text + Errors + + + QLabel name @@ -1453,11 +1490,22 @@ 0 - + QLabel name - SndBytes_LBL + TextLabel1_5_4_3 + + + text + Dropped + + + + QLabel + + name + SndDropped_LBL sizePolicy @@ -1479,47 +1527,80 @@ 0 - + - + - QLayoutWidget + QGroupBox name - Layout7 + Misc_GB + + + enabled + false + + + title + Miscellaneous + + + layoutMargin + + + layoutSpacing margin - 0 + 4 spacing - 6 + 2 QLabel name - TextLabel1_3 + TextLabel1_5_3_3 + + + text + Collisions + + + + QLabel + + name + Collisions_LBL sizePolicy - 0 + 7 1 - text - Others + frameShape + Panel + + + frameShadow + Sunken + + + indent + 0 name - Spacer19 + Spacer10 orientation @@ -1537,165 +1618,27 @@ - - - - QLayoutWidget - - name - Layout45 - - - layoutMargin - - - layoutSpacing - - - - margin - 2 - - - spacing - 0 - - - QFrame - + + name - Frame116 + Spacer13 - sizePolicy - - 0 - 5 - + orientation + Horizontal - minimumSize - - 5 - 0 - + sizeType + Expanding - - maximumSize + + sizeHint - 5 - 32767 + 20 + 20 - - frameShape - NoFrame - - - frameShadow - Raised - - - - QFrame - - name - Collisions_FRM - - - enabled - false - - - sizePolicy - - 7 - 5 - - - - frameShape - NoFrame - - - frameShadow - Raised - - - layoutMargin - - - layoutSpacing - - - - margin - 0 - - - spacing - 2 - - - QLabel - - name - TextLabel1_5_3_3 - - - text - Collisions - - - - QLabel - - name - Collisions_LBL - - - sizePolicy - - 7 - 1 - - - - frameShape - Panel - - - frameShadow - Sunken - - - indent - 0 - - - - - name - Spacer18 - - - orientation - Horizontal - - - sizeType - Expanding - - - sizeHint - - 20 - 20 - - - - - + @@ -1723,7 +1666,7 @@ QLayoutWidget name - Layout17 + Layout10 @@ -1741,6 +1684,10 @@ Refresh_CB + enabled + false + + text Live feed @@ -1766,6 +1713,21 @@ + + QPushButton + + name + ResetODO_But + + + enabled + false + + + text + Reset ODO + + @@ -1780,6 +1742,13 @@ Profile_FRM SLOT_AutoRefresh(bool) + + ResetODO_But + clicked() + Profile_FRM + SLOT_ResetODO() + SLOT_AutoRefresh(bool) + SLOT_ResetODO() 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,4 +1,6 @@ #include +#include +#include #include #include #include @@ -23,13 +25,17 @@ ProfileEdit::ProfileEdit( QWidget * Parent, ANetNodeInstance * TNNI ) : if( ( II = NNI->networkSetup()->assignedInterface() ) ) { Refresh_CB->setEnabled( TRUE ); - Snd_GB->setEnabled( TRUE ); - Rcv_GB->setEnabled( TRUE ); - Collisions_FRM->setEnabled( TRUE ); + ResetODO_But->setEnabled( TRUE ); + Sending_GB->setEnabled( TRUE ); + Receiving_GB->setEnabled( TRUE ); + Misc_GB->setEnabled( TRUE ); // show current content SLOT_Refresh(); + // initialize ODO + SLOT_ResetODO(); + // fill in static data InterfaceName_LBL->setText( II->Name ); IPAddress_LBL->setText( II->Address ); @@ -82,13 +88,23 @@ bool ProfileEdit::commit( ProfileData & Data ) { void ProfileEdit::SLOT_Refresh( void ) { InterfaceInfo * II = NNI->networkSetup()->assignedInterface(); + QString S; NSResources->system().refreshStatistics( *II ); + RcvBytes_LBL->setText( II->RcvBytes ); - SndBytes_LBL->setText( II->SndBytes ); + RcvPackets_LBL->setText( II->RcvPackets ); RcvErrors_LBL->setText( II->RcvErrors ); - SndErrors_LBL->setText( II->SndErrors ); RcvDropped_LBL->setText( II->RcvDropped ); + S.setNum( II->RcvBytes.toLong() - RcvODO ); + RcvODO_LBL->setText( S ); + + SndBytes_LBL->setText( II->SndBytes ); + SndPackets_LBL->setText( II->SndPackets ); + SndErrors_LBL->setText( II->SndErrors ); SndDropped_LBL->setText( II->SndDropped ); + S.setNum( II->SndBytes.toLong() - SndODO ); + SndODO_LBL->setText( S ); + Collisions_LBL->setText( II->Collisions ); } @@ -100,3 +116,10 @@ void ProfileEdit::SLOT_AutoRefresh( bool ar ) { RefreshTimer.stop(); } } + +void ProfileEdit::SLOT_ResetODO( void ) { + InterfaceInfo * II = NNI->networkSetup()->assignedInterface(); + RcvODO = II->RcvBytes.toLong(); + SndODO = II->SndBytes.toLong(); + SLOT_Refresh(); +} diff --git a/noncore/settings/networksettings2/profile/profileedit.h b/noncore/settings/networksettings2/profile/profileedit.h index 9cde845..56bd15d 100644 --- a/noncore/settings/networksettings2/profile/profileedit.h +++ b/noncore/settings/networksettings2/profile/profileedit.h @@ -20,10 +20,13 @@ public slots : void SLOT_AutoRefresh( bool ); void SLOT_Refresh( void ); + void SLOT_ResetODO( void ); private : QTimer RefreshTimer; ANetNodeInstance * NNI; RuntimeInfo * Dev; + long RcvODO; + long SndODO; }; -- cgit v0.9.0.2