Diffstat (limited to 'noncore/settings/networksettings2/profile/profileedit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/profile/profileedit.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/noncore/settings/networksettings2/profile/profileedit.cpp b/noncore/settings/networksettings2/profile/profileedit.cpp index 88aab15..ad943fe 100644 --- a/noncore/settings/networksettings2/profile/profileedit.cpp +++ b/noncore/settings/networksettings2/profile/profileedit.cpp | |||
@@ -1,35 +1,39 @@ | |||
1 | #include <qlabel.h> | 1 | #include <qlabel.h> |
2 | #include <qframe.h> | 2 | #include <qframe.h> |
3 | #include <qcheckbox.h> | 3 | #include <qcheckbox.h> |
4 | #include <qmultilineedit.h> | 4 | #include <qmultilineedit.h> |
5 | #include <qcheckbox.h> | 5 | #include <qcheckbox.h> |
6 | 6 | ||
7 | #include <GUIUtils.h> | 7 | #include <GUIUtils.h> |
8 | #include <netnode.h> | 8 | #include <netnode.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 ), RefreshTimer(this) { | 14 | ProfileGUI( Parent ), RefreshTimer(this) { |
15 | InterfaceInfo * II; | 15 | InterfaceInfo * II; |
16 | 16 | ||
17 | II = TNNI->networkSetup()->assignedInterface(); | ||
18 | Log(( "Interface %p %p %p: %d\n", II, | ||
19 | TNNI, TNNI->networkSetup(), (II) ? II->IsUp : 0 )); | ||
20 | |||
17 | NNI = TNNI; | 21 | NNI = TNNI; |
18 | Dev = NNI->runtime()->device(); | 22 | Dev = NNI->runtime()->device(); |
19 | if( ( II = NNI->connection()->assignedInterface() ) ) { | 23 | if( ( II = NNI->networkSetup()->assignedInterface() ) ) { |
20 | 24 | ||
21 | Refresh_CB->setEnabled( TRUE ); | 25 | Refresh_CB->setEnabled( TRUE ); |
22 | Snd_GB->setEnabled( TRUE ); | 26 | Snd_GB->setEnabled( TRUE ); |
23 | Rcv_GB->setEnabled( TRUE ); | 27 | Rcv_GB->setEnabled( TRUE ); |
24 | Collisions_FRM->setEnabled( TRUE ); | 28 | Collisions_FRM->setEnabled( TRUE ); |
25 | 29 | ||
26 | // show current content | 30 | // show current content |
27 | SLOT_Refresh(); | 31 | SLOT_Refresh(); |
28 | 32 | ||
29 | // fill in static data | 33 | // fill in static data |
30 | InterfaceName_LBL->setText( II->Name ); | 34 | InterfaceName_LBL->setText( II->Name ); |
31 | IPAddress_LBL->setText( II->Address ); | 35 | IPAddress_LBL->setText( II->Address ); |
32 | SubnetMask_LBL->setText( II->Netmask ); | 36 | SubnetMask_LBL->setText( II->Netmask ); |
33 | Broadcast_LBL->setText( II->BCastAddress ); | 37 | Broadcast_LBL->setText( II->BCastAddress ); |
34 | MACAddress_LBL->setText( II->MACAddress ); | 38 | MACAddress_LBL->setText( II->MACAddress ); |
35 | if( II->IsPointToPoint ) { | 39 | if( II->IsPointToPoint ) { |
@@ -64,33 +68,33 @@ void ProfileEdit::showData( ProfileData & Data ) { | |||
64 | } | 68 | } |
65 | 69 | ||
66 | 70 | ||
67 | bool ProfileEdit::commit( ProfileData & Data ) { | 71 | bool ProfileEdit::commit( ProfileData & Data ) { |
68 | bool SM = 0; | 72 | bool SM = 0; |
69 | TXTM( Data.Description, Description_LE, SM ); | 73 | TXTM( Data.Description, Description_LE, SM ); |
70 | 74 | ||
71 | CBM( Data.Automatic, Automatic_CB, SM ); | 75 | CBM( Data.Automatic, Automatic_CB, SM ); |
72 | CBM( Data.TriggerVPN, TriggersVPN_CB, SM ); | 76 | CBM( Data.TriggerVPN, TriggersVPN_CB, SM ); |
73 | CBM( Data.Disabled, Disabled_CB, SM ); | 77 | CBM( Data.Disabled, Disabled_CB, SM ); |
74 | CBM( Data.Confirm, Confirm_CB, SM ); | 78 | CBM( Data.Confirm, Confirm_CB, SM ); |
75 | 79 | ||
76 | return SM; | 80 | return SM; |
77 | } | 81 | } |
78 | 82 | ||
79 | void ProfileEdit::SLOT_Refresh( void ) { | 83 | void ProfileEdit::SLOT_Refresh( void ) { |
80 | InterfaceInfo * II = NNI->connection()->assignedInterface(); | 84 | InterfaceInfo * II = NNI->networkSetup()->assignedInterface(); |
81 | NSResources->system().refreshStatistics( *II ); | 85 | NSResources->system().refreshStatistics( *II ); |
82 | RcvBytes_LBL->setText( II->RcvBytes ); | 86 | RcvBytes_LBL->setText( II->RcvBytes ); |
83 | SndBytes_LBL->setText( II->SndBytes ); | 87 | SndBytes_LBL->setText( II->SndBytes ); |
84 | RcvErrors_LBL->setText( II->RcvErrors ); | 88 | RcvErrors_LBL->setText( II->RcvErrors ); |
85 | SndErrors_LBL->setText( II->SndErrors ); | 89 | SndErrors_LBL->setText( II->SndErrors ); |
86 | RcvDropped_LBL->setText( II->RcvDropped ); | 90 | RcvDropped_LBL->setText( II->RcvDropped ); |
87 | SndDropped_LBL->setText( II->SndDropped ); | 91 | SndDropped_LBL->setText( II->SndDropped ); |
88 | Collisions_LBL->setText( II->Collisions ); | 92 | Collisions_LBL->setText( II->Collisions ); |
89 | } | 93 | } |
90 | 94 | ||
91 | void ProfileEdit::SLOT_AutoRefresh( bool ar ) { | 95 | void ProfileEdit::SLOT_AutoRefresh( bool ar ) { |
92 | if( ar ) { | 96 | if( ar ) { |
93 | RefreshTimer.start( 1000 ); | 97 | RefreshTimer.start( 1000 ); |
94 | SLOT_Refresh(); | 98 | SLOT_Refresh(); |
95 | } else { | 99 | } else { |
96 | RefreshTimer.stop(); | 100 | RefreshTimer.stop(); |