Diffstat (limited to 'noncore/settings/networksettings2/profile') (more/less context) (ignore whitespace changes)
6 files changed, 131 insertions, 48 deletions
diff --git a/noncore/settings/networksettings2/profile/profileGUI.ui b/noncore/settings/networksettings2/profile/profileGUI.ui index 365704b..5bf9a9c 100644 --- a/noncore/settings/networksettings2/profile/profileGUI.ui +++ b/noncore/settings/networksettings2/profile/profileGUI.ui | |||
@@ -10,10 +10,10 @@ | |||
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>225</width> | 14 | <width>276</width> |
15 | <height>301</height> | 15 | <height>231</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
19 | <name>caption</name> | 19 | <name>caption</name> |
@@ -58,60 +58,130 @@ | |||
58 | </attribute> | 58 | </attribute> |
59 | <vbox> | 59 | <vbox> |
60 | <property stdset="1"> | 60 | <property stdset="1"> |
61 | <name>margin</name> | 61 | <name>margin</name> |
62 | <number>2</number> | 62 | <number>1</number> |
63 | </property> | 63 | </property> |
64 | <property stdset="1"> | 64 | <property stdset="1"> |
65 | <name>spacing</name> | 65 | <name>spacing</name> |
66 | <number>0</number> | 66 | <number>2</number> |
67 | </property> | 67 | </property> |
68 | <widget> | 68 | <widget> |
69 | <class>QCheckBox</class> | 69 | <class>QLayoutWidget</class> |
70 | <property stdset="1"> | ||
71 | <name>name</name> | ||
72 | <cstring>Automatic_CB</cstring> | ||
73 | </property> | ||
74 | <property stdset="1"> | ||
75 | <name>text</name> | ||
76 | <string>Start automatically</string> | ||
77 | </property> | ||
78 | </widget> | ||
79 | <widget> | ||
80 | <class>QCheckBox</class> | ||
81 | <property stdset="1"> | ||
82 | <name>name</name> | ||
83 | <cstring>Confirm_CB</cstring> | ||
84 | </property> | ||
85 | <property stdset="1"> | ||
86 | <name>enabled</name> | ||
87 | <bool>true</bool> | ||
88 | </property> | ||
89 | <property stdset="1"> | ||
90 | <name>text</name> | ||
91 | <string>Confirm before start</string> | ||
92 | </property> | ||
93 | <property> | ||
94 | <name>layoutMargin</name> | ||
95 | </property> | ||
96 | </widget> | ||
97 | <widget> | ||
98 | <class>QCheckBox</class> | ||
99 | <property stdset="1"> | 70 | <property stdset="1"> |
100 | <name>name</name> | 71 | <name>name</name> |
101 | <cstring>Disabled_CB</cstring> | 72 | <cstring>Layout8</cstring> |
102 | </property> | ||
103 | <property stdset="1"> | ||
104 | <name>enabled</name> | ||
105 | <bool>true</bool> | ||
106 | </property> | ||
107 | <property stdset="1"> | ||
108 | <name>text</name> | ||
109 | <string>Disabled</string> | ||
110 | </property> | ||
111 | <property> | ||
112 | <name>layoutMargin</name> | ||
113 | </property> | 73 | </property> |
74 | <grid> | ||
75 | <property stdset="1"> | ||
76 | <name>margin</name> | ||
77 | <number>0</number> | ||
78 | </property> | ||
79 | <property stdset="1"> | ||
80 | <name>spacing</name> | ||
81 | <number>6</number> | ||
82 | </property> | ||
83 | <widget row="0" column="0" rowspan="2" colspan="1" > | ||
84 | <class>QGroupBox</class> | ||
85 | <property stdset="1"> | ||
86 | <name>name</name> | ||
87 | <cstring>GroupBox1</cstring> | ||
88 | </property> | ||
89 | <property stdset="1"> | ||
90 | <name>title</name> | ||
91 | <string>Start</string> | ||
92 | </property> | ||
93 | <vbox> | ||
94 | <property stdset="1"> | ||
95 | <name>margin</name> | ||
96 | <number>11</number> | ||
97 | </property> | ||
98 | <property stdset="1"> | ||
99 | <name>spacing</name> | ||
100 | <number>6</number> | ||
101 | </property> | ||
102 | <widget> | ||
103 | <class>QCheckBox</class> | ||
104 | <property stdset="1"> | ||
105 | <name>name</name> | ||
106 | <cstring>Automatic_CB</cstring> | ||
107 | </property> | ||
108 | <property stdset="1"> | ||
109 | <name>text</name> | ||
110 | <string>Automatically</string> | ||
111 | </property> | ||
112 | </widget> | ||
113 | <widget> | ||
114 | <class>QCheckBox</class> | ||
115 | <property stdset="1"> | ||
116 | <name>name</name> | ||
117 | <cstring>Confirm_CB</cstring> | ||
118 | </property> | ||
119 | <property stdset="1"> | ||
120 | <name>enabled</name> | ||
121 | <bool>true</bool> | ||
122 | </property> | ||
123 | <property stdset="1"> | ||
124 | <name>text</name> | ||
125 | <string>Ask</string> | ||
126 | </property> | ||
127 | <property> | ||
128 | <name>layoutMargin</name> | ||
129 | </property> | ||
130 | </widget> | ||
131 | <widget> | ||
132 | <class>QCheckBox</class> | ||
133 | <property stdset="1"> | ||
134 | <name>name</name> | ||
135 | <cstring>Disabled_CB</cstring> | ||
136 | </property> | ||
137 | <property stdset="1"> | ||
138 | <name>enabled</name> | ||
139 | <bool>true</bool> | ||
140 | </property> | ||
141 | <property stdset="1"> | ||
142 | <name>text</name> | ||
143 | <string>Disabled</string> | ||
144 | </property> | ||
145 | <property> | ||
146 | <name>layoutMargin</name> | ||
147 | </property> | ||
148 | </widget> | ||
149 | </vbox> | ||
150 | </widget> | ||
151 | <widget row="0" column="1" > | ||
152 | <class>QCheckBox</class> | ||
153 | <property stdset="1"> | ||
154 | <name>name</name> | ||
155 | <cstring>TriggersVPN_CB</cstring> | ||
156 | </property> | ||
157 | <property stdset="1"> | ||
158 | <name>text</name> | ||
159 | <string>Trigger VPN</string> | ||
160 | </property> | ||
161 | </widget> | ||
162 | <spacer row="1" column="1" > | ||
163 | <property> | ||
164 | <name>name</name> | ||
165 | <cstring>Spacer8</cstring> | ||
166 | </property> | ||
167 | <property stdset="1"> | ||
168 | <name>orientation</name> | ||
169 | <enum>Vertical</enum> | ||
170 | </property> | ||
171 | <property stdset="1"> | ||
172 | <name>sizeType</name> | ||
173 | <enum>Expanding</enum> | ||
174 | </property> | ||
175 | <property> | ||
176 | <name>sizeHint</name> | ||
177 | <size> | ||
178 | <width>20</width> | ||
179 | <height>20</height> | ||
180 | </size> | ||
181 | </property> | ||
182 | </spacer> | ||
183 | </grid> | ||
114 | </widget> | 184 | </widget> |
115 | <widget> | 185 | <widget> |
116 | <class>QLabel</class> | 186 | <class>QLabel</class> |
117 | <property stdset="1"> | 187 | <property stdset="1"> |
diff --git a/noncore/settings/networksettings2/profile/profile_NNI.cpp b/noncore/settings/networksettings2/profile/profile_NNI.cpp index 5b54aa4..cb52b2a 100644 --- a/noncore/settings/networksettings2/profile/profile_NNI.cpp +++ b/noncore/settings/networksettings2/profile/profile_NNI.cpp | |||
@@ -6,8 +6,9 @@ AProfile::AProfile( ProfileNetNode * PNN ) : ANetNodeInstance( PNN ) { | |||
6 | Data.Automatic = 1; | 6 | Data.Automatic = 1; |
7 | Data.Confirm = 0; | 7 | Data.Confirm = 0; |
8 | Data.Description = ""; | 8 | Data.Description = ""; |
9 | Data.Disabled = 0; | 9 | Data.Disabled = 0; |
10 | Data.TriggerVPN = 0; | ||
10 | GUI = 0; | 11 | GUI = 0; |
11 | RT = 0; | 12 | RT = 0; |
12 | } | 13 | } |
13 | 14 | ||
@@ -18,8 +19,10 @@ void AProfile::setSpecificAttribute( QString & Attr, QString & Value ) { | |||
18 | } else if ( Attr == "preconfirm" ) { | 19 | } else if ( Attr == "preconfirm" ) { |
19 | Data.Confirm = (Value=="yes"); | 20 | Data.Confirm = (Value=="yes"); |
20 | } else if ( Attr == "disabled" ) { | 21 | } else if ( Attr == "disabled" ) { |
21 | Data.Disabled = (Value=="yes"); | 22 | Data.Disabled = (Value=="yes"); |
23 | } else if ( Attr == "triggervpn" ) { | ||
24 | Data.TriggerVPN = (Value=="yes"); | ||
22 | } else if ( Attr == "description" ) { | 25 | } else if ( Attr == "description" ) { |
23 | Data.Description = Value; | 26 | Data.Description = Value; |
24 | } | 27 | } |
25 | } | 28 | } |
@@ -27,8 +30,9 @@ void AProfile::setSpecificAttribute( QString & Attr, QString & Value ) { | |||
27 | void AProfile::saveSpecificAttribute( QTextStream & TS ) { | 30 | void AProfile::saveSpecificAttribute( QTextStream & TS ) { |
28 | TS << "automatic=" << ((Data.Automatic) ? "yes" : "no") << endl; | 31 | TS << "automatic=" << ((Data.Automatic) ? "yes" : "no") << endl; |
29 | TS << "preconfirm=" << ((Data.Confirm) ? "yes" : "no") << endl; | 32 | TS << "preconfirm=" << ((Data.Confirm) ? "yes" : "no") << endl; |
30 | TS << "disabled=" << ((Data.Disabled) ? "yes" : "no") << endl; | 33 | TS << "disabled=" << ((Data.Disabled) ? "yes" : "no") << endl; |
34 | TS << "triggervpn=" << ((Data.TriggerVPN) ? "yes" : "no") << endl; | ||
31 | TS << "description=" << Data.Description << endl; | 35 | TS << "description=" << Data.Description << endl; |
32 | } | 36 | } |
33 | 37 | ||
34 | QWidget * AProfile::edit( QWidget * parent ) { | 38 | QWidget * AProfile::edit( QWidget * parent ) { |
diff --git a/noncore/settings/networksettings2/profile/profiledata.h b/noncore/settings/networksettings2/profile/profiledata.h index b4168e2..246d50c 100644 --- a/noncore/settings/networksettings2/profile/profiledata.h +++ b/noncore/settings/networksettings2/profile/profiledata.h | |||
@@ -9,7 +9,8 @@ typedef struct ProfileData { | |||
9 | // if started up automatically, ask user for confirmation | 9 | // if started up automatically, ask user for confirmation |
10 | bool Confirm; | 10 | bool Confirm; |
11 | // Do not bring this connection up | 11 | // Do not bring this connection up |
12 | bool Disabled; | 12 | bool Disabled; |
13 | bool TriggerVPN; | ||
13 | } ProfileData_t; | 14 | } ProfileData_t; |
14 | 15 | ||
15 | #endif | 16 | #endif |
diff --git a/noncore/settings/networksettings2/profile/profileedit.cpp b/noncore/settings/networksettings2/profile/profileedit.cpp index c9fb650..87e503e 100644 --- a/noncore/settings/networksettings2/profile/profileedit.cpp +++ b/noncore/settings/networksettings2/profile/profileedit.cpp | |||
@@ -57,8 +57,9 @@ QString ProfileEdit::acceptable( void ) { | |||
57 | 57 | ||
58 | void ProfileEdit::showData( ProfileData_t & Data ) { | 58 | void ProfileEdit::showData( ProfileData_t & Data ) { |
59 | Description_LE->setText( Data.Description ); | 59 | Description_LE->setText( Data.Description ); |
60 | Automatic_CB->setChecked( Data.Automatic ); | 60 | Automatic_CB->setChecked( Data.Automatic ); |
61 | TriggersVPN_CB->setChecked( Data.TriggerVPN ); | ||
61 | Confirm_CB->setChecked( Data.Confirm ); | 62 | Confirm_CB->setChecked( Data.Confirm ); |
62 | Disabled_CB->setChecked( Data.Disabled ); | 63 | Disabled_CB->setChecked( Data.Disabled ); |
63 | } | 64 | } |
64 | 65 | ||
@@ -67,8 +68,9 @@ bool ProfileEdit::commit( ProfileData_t & Data ) { | |||
67 | bool SM = 0; | 68 | bool SM = 0; |
68 | TXTM( Data.Description, Description_LE, SM ); | 69 | TXTM( Data.Description, Description_LE, SM ); |
69 | 70 | ||
70 | CBM( Data.Automatic, Automatic_CB, SM ); | 71 | CBM( Data.Automatic, Automatic_CB, SM ); |
72 | CBM( Data.TriggerVPN, TriggersVPN_CB, SM ); | ||
71 | CBM( Data.Disabled, Disabled_CB, SM ); | 73 | CBM( Data.Disabled, Disabled_CB, SM ); |
72 | CBM( Data.Confirm, Confirm_CB, SM ); | 74 | CBM( Data.Confirm, Confirm_CB, SM ); |
73 | 75 | ||
74 | return SM; | 76 | return SM; |
diff --git a/noncore/settings/networksettings2/profile/profilerun.cpp b/noncore/settings/networksettings2/profile/profilerun.cpp index 79bb93e..1a5b15b 100644 --- a/noncore/settings/networksettings2/profile/profilerun.cpp +++ b/noncore/settings/networksettings2/profile/profilerun.cpp | |||
@@ -3,17 +3,19 @@ | |||
3 | #include "profilerun.h" | 3 | #include "profilerun.h" |
4 | 4 | ||
5 | void ProfileRun::detectState( NodeCollection * NC ) { | 5 | void ProfileRun::detectState( NodeCollection * NC ) { |
6 | if( Data->Disabled ) { | 6 | if( Data->Disabled ) { |
7 | Log(( "%s disabled\n", NC->name().latin1() )); | ||
7 | NC->setCurrentState( Disabled ); | 8 | NC->setCurrentState( Disabled ); |
8 | } else { | 9 | } else { |
10 | Log(( "%s not disabled\n", NC->name().latin1() )); | ||
9 | // find next item in connection | 11 | // find next item in connection |
10 | // convert to runtime and ask to detect the state | 12 | // convert to runtime and ask to detect the state |
11 | netNode()->nextNode()->runtime()->detectState( NC ); | 13 | netNode()->nextNode()->runtime()->detectState( NC ); |
12 | } | 14 | } |
13 | } | 15 | } |
14 | 16 | ||
15 | bool ProfileRun::setState( NodeCollection * NC, Action_t A, bool ) { | 17 | bool ProfileRun::setState( NodeCollection * NC, Action_t A, bool F ) { |
16 | ANetNodeInstance * NNNI; | 18 | ANetNodeInstance * NNNI; |
17 | 19 | ||
18 | NNNI = netNode()->nextNode(); | 20 | NNNI = netNode()->nextNode(); |
19 | switch ( A ) { | 21 | switch ( A ) { |
@@ -40,9 +42,9 @@ bool ProfileRun::setState( NodeCollection * NC, Action_t A, bool ) { | |||
40 | return 1; | 42 | return 1; |
41 | default : | 43 | default : |
42 | break; | 44 | break; |
43 | } | 45 | } |
44 | return NNNI->runtime()->setState(NC, A); | 46 | return NNNI->runtime()->setState(NC, A, F ); |
45 | } | 47 | } |
46 | 48 | ||
47 | bool ProfileRun::canSetState( State_t Curr, Action_t A ) { | 49 | bool ProfileRun::canSetState( State_t Curr, Action_t A ) { |
48 | RuntimeInfo * RI; | 50 | RuntimeInfo * RI; |
diff --git a/noncore/settings/networksettings2/profile/profilerun.h b/noncore/settings/networksettings2/profile/profilerun.h index c8ea063..400b56c 100644 --- a/noncore/settings/networksettings2/profile/profilerun.h +++ b/noncore/settings/networksettings2/profile/profilerun.h | |||
@@ -22,8 +22,12 @@ public : | |||
22 | { return Data->Description; } | 22 | { return Data->Description; } |
23 | 23 | ||
24 | virtual AsFullSetup * asFullSetup( void ) | 24 | virtual AsFullSetup * asFullSetup( void ) |
25 | { return (AsFullSetup *)this; } | 25 | { return (AsFullSetup *)this; } |
26 | |||
27 | virtual bool triggersVPN( void ) | ||
28 | { return Data->TriggerVPN; } | ||
29 | |||
26 | private : | 30 | private : |
27 | 31 | ||
28 | ProfileData * Data; | 32 | ProfileData * Data; |
29 | 33 | ||