Diffstat (limited to 'noncore/settings/networksettings2/profile') (more/less context) (ignore whitespace changes)
5 files changed, 17 insertions, 9 deletions
diff --git a/noncore/settings/networksettings2/profile/profile_NN.cpp b/noncore/settings/networksettings2/profile/profile_NN.cpp index 1e6912e..007f4a5 100644 --- a/noncore/settings/networksettings2/profile/profile_NN.cpp +++ b/noncore/settings/networksettings2/profile/profile_NN.cpp | |||
@@ -1,47 +1,47 @@ | |||
1 | #include <resources.h> | 1 | #include <resources.h> |
2 | #include "profile_NN.h" | 2 | #include "profile_NN.h" |
3 | #include "profile_NNI.h" | 3 | #include "profile_NNI.h" |
4 | 4 | ||
5 | #include "netnodeinterface.h" | 5 | #include "netnodeinterface.h" |
6 | 6 | ||
7 | static const char * ProfileNeeds[] = | 7 | static const char * ProfileNeeds[] = |
8 | { "connection", | 8 | { "NetworkSetup", |
9 | 0 | 9 | 0 |
10 | }; | 10 | }; |
11 | static const char * ProfileProvides[] = | 11 | static const char * ProfileProvides[] = |
12 | { "fullsetup", | 12 | { "fullsetup", |
13 | 0 | 13 | 0 |
14 | }; | 14 | }; |
15 | 15 | ||
16 | /** | 16 | /** |
17 | * Constructor, find all of the possible interfaces | 17 | * Constructor, find all of the possible interfaces |
18 | */ | 18 | */ |
19 | ProfileNetNode::ProfileNetNode() : ANetNode( tr("Regular connection profile")) { | 19 | ProfileNetNode::ProfileNetNode() : ANetNode( tr("Regular NetworkSetup profile")) { |
20 | 20 | ||
21 | NSResources->addSystemFile( | 21 | NSResources->addSystemFile( |
22 | "interfaces", "/etc/network/interfaces", 1 ); | 22 | "interfaces", "/etc/network/interfaces", 1 ); |
23 | 23 | ||
24 | } | 24 | } |
25 | 25 | ||
26 | /** | 26 | /** |
27 | * Delete any interfaces that we own. | 27 | * Delete any interfaces that we own. |
28 | */ | 28 | */ |
29 | ProfileNetNode::~ProfileNetNode(){ | 29 | ProfileNetNode::~ProfileNetNode(){ |
30 | } | 30 | } |
31 | 31 | ||
32 | const QString ProfileNetNode::nodeDescription(){ | 32 | const QString ProfileNetNode::nodeDescription(){ |
33 | return tr("\ | 33 | return tr("\ |
34 | <p>Define use of an IP connection.</p>\ | 34 | <p>Define use of an IP NetworkSetup.</p>\ |
35 | <p>Configure if and when this connection needs to be established</p>\ | 35 | <p>Configure if and when this NetworkSetup needs to be established</p>\ |
36 | " | 36 | " |
37 | ); | 37 | ); |
38 | } | 38 | } |
39 | 39 | ||
40 | ANetNodeInstance * ProfileNetNode::createInstance( void ) { | 40 | ANetNodeInstance * ProfileNetNode::createInstance( void ) { |
41 | return new AProfile( this ); | 41 | return new AProfile( this ); |
42 | } | 42 | } |
43 | 43 | ||
44 | const char ** ProfileNetNode::needs( void ) { | 44 | const char ** ProfileNetNode::needs( void ) { |
45 | return ProfileNeeds; | 45 | return ProfileNeeds; |
46 | } | 46 | } |
47 | 47 | ||
diff --git a/noncore/settings/networksettings2/profile/profiledata.h b/noncore/settings/networksettings2/profile/profiledata.h index c9577e5..2f7060d 100644 --- a/noncore/settings/networksettings2/profile/profiledata.h +++ b/noncore/settings/networksettings2/profile/profiledata.h | |||
@@ -1,17 +1,17 @@ | |||
1 | #ifndef PROFILE_DATA_H | 1 | #ifndef PROFILE_DATA_H |
2 | #define PROFILE_DATA_H | 2 | #define PROFILE_DATA_H |
3 | 3 | ||
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | class ProfileData { | 5 | class ProfileData { |
6 | public : | 6 | public : |
7 | QString Description; | 7 | QString Description; |
8 | // start up automatically | 8 | // start up automatically |
9 | bool Automatic; | 9 | bool Automatic; |
10 | // if started up automatically, ask user for confirmation | 10 | // if started up automatically, ask user for confirmation |
11 | bool Confirm; | 11 | bool Confirm; |
12 | // Do not bring this connection up | 12 | // Do not bring this networkSetup up |
13 | bool Disabled; | 13 | bool Disabled; |
14 | bool TriggerVPN; | 14 | bool TriggerVPN; |
15 | } ; | 15 | } ; |
16 | 16 | ||
17 | #endif | 17 | #endif |
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 | |||
@@ -5,27 +5,31 @@ | |||
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 ); |
@@ -68,25 +72,25 @@ 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 ) { |
diff --git a/noncore/settings/networksettings2/profile/profilerun.cpp b/noncore/settings/networksettings2/profile/profilerun.cpp index acb67bd..48011ea 100644 --- a/noncore/settings/networksettings2/profile/profilerun.cpp +++ b/noncore/settings/networksettings2/profile/profilerun.cpp | |||
@@ -1,24 +1,28 @@ | |||
1 | #include <resources.h> | 1 | #include <resources.h> |
2 | 2 | ||
3 | #include "profilerun.h" | 3 | #include "profilerun.h" |
4 | 4 | ||
5 | State_t ProfileRun::detectState( void ) { | 5 | State_t ProfileRun::detectState( void ) { |
6 | InterfaceInfo * II = networkSetup()->assignedInterface(); | ||
7 | |||
8 | Log(( "Interface %p %p %p: %d\n", II, | ||
9 | netNode(), netNode()->networkSetup(), (II) ? II->IsUp : 0 )); | ||
6 | if( Data->Disabled ) { | 10 | if( Data->Disabled ) { |
7 | return Disabled; | 11 | return Disabled; |
8 | } | 12 | } |
9 | return Unknown; | 13 | return Unknown; |
10 | } | 14 | } |
11 | 15 | ||
12 | QString ProfileRun::setMyState( NodeCollection * NC, Action_t A, bool ) { | 16 | QString ProfileRun::setMyState( NetworkSetup * NC, Action_t A, bool ) { |
13 | odebug << "Profile " << Data->Disabled << oendl; | 17 | odebug << "Profile " << Data->Disabled << oendl; |
14 | if( A == Disable ) { | 18 | if( A == Disable ) { |
15 | if( ! Data->Disabled ) { | 19 | if( ! Data->Disabled ) { |
16 | Data->Disabled = 1; | 20 | Data->Disabled = 1; |
17 | NC->setModified( 1 ); | 21 | NC->setModified( 1 ); |
18 | } | 22 | } |
19 | } else if( A == Enable ) { | 23 | } else if( A == Enable ) { |
20 | if( Data->Disabled ) { | 24 | if( Data->Disabled ) { |
21 | Data->Disabled = 0; | 25 | Data->Disabled = 0; |
22 | NC->setModified( 1 ); | 26 | NC->setModified( 1 ); |
23 | } | 27 | } |
24 | } | 28 | } |
diff --git a/noncore/settings/networksettings2/profile/profilerun.h b/noncore/settings/networksettings2/profile/profilerun.h index 2d48b15..9470c0f 100644 --- a/noncore/settings/networksettings2/profile/profilerun.h +++ b/noncore/settings/networksettings2/profile/profilerun.h | |||
@@ -14,20 +14,20 @@ public : | |||
14 | 14 | ||
15 | virtual RuntimeInfo * fullSetup( void ) | 15 | virtual RuntimeInfo * fullSetup( void ) |
16 | { return this; } | 16 | { return this; } |
17 | virtual const QString & description( void ) | 17 | virtual const QString & description( void ) |
18 | { return Data->Description; } | 18 | { return Data->Description; } |
19 | virtual bool triggersVPN( void ) | 19 | virtual bool triggersVPN( void ) |
20 | { return Data->TriggerVPN; } | 20 | { return Data->TriggerVPN; } |
21 | 21 | ||
22 | State_t detectState( void ); | 22 | State_t detectState( void ); |
23 | 23 | ||
24 | protected : | 24 | protected : |
25 | 25 | ||
26 | QString setMyState( NodeCollection * , Action_t, bool ); | 26 | QString setMyState( NetworkSetup * , Action_t, bool ); |
27 | 27 | ||
28 | private : | 28 | private : |
29 | 29 | ||
30 | ProfileData * Data; | 30 | ProfileData * Data; |
31 | 31 | ||
32 | }; | 32 | }; |
33 | #endif | 33 | #endif |