Merge lp:~donadigo/switchboard-plug-networking/fix-vpn-popover into lp:~elementary-pantheon/switchboard-plug-networking/trunk

Proposed by Adam Bieńkowski
Status: Merged
Approved by: Cody Garver
Approved revision: 284
Merged at revision: 286
Proposed branch: lp:~donadigo/switchboard-plug-networking/fix-vpn-popover
Merge into: lp:~elementary-pantheon/switchboard-plug-networking/trunk
Diff against target: 108 lines (+22/-16)
1 file modified
src/Widgets/VPNPage.vala (+22/-16)
To merge this branch: bzr merge lp:~donadigo/switchboard-plug-networking/fix-vpn-popover
Reviewer Review Type Date Requested Status
elementary Pantheon team Pending
Review via email: mp+301580@code.launchpad.net

Commit message

Fix VPN Info popover not showing.

Description of the change

Fix VPN Info popover not showing and also add missing margin.

To post a comment you must log in.
284. By Adam Bieńkowski

More fixes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Widgets/VPNPage.vala'
--- src/Widgets/VPNPage.vala 2016-07-30 15:43:10 +0000
+++ src/Widgets/VPNPage.vala 2016-07-30 21:31:05 +0000
@@ -48,6 +48,7 @@
48 control_box.margin_bottom = 12;48 control_box.margin_bottom = 12;
4949
50 vpn_info_box = new VPNInfoBox ();50 vpn_info_box = new VPNInfoBox ();
51 vpn_info_box.margin = 12;
5152
52 popover = new Gtk.Popover (info_btn);53 popover = new Gtk.Popover (info_btn);
53 popover.position = Gtk.PositionType.BOTTOM;54 popover.position = Gtk.PositionType.BOTTOM;
@@ -161,7 +162,6 @@
161 case NM.VPNConnectionState.CONNECT:162 case NM.VPNConnectionState.CONNECT:
162 state = State.CONNECTING_VPN;163 state = State.CONNECTING_VPN;
163 item = get_item_by_uuid (active_connection.get_uuid ());164 item = get_item_by_uuid (active_connection.get_uuid ());
164 item.state = state;
165 break;165 break;
166 case NM.VPNConnectionState.FAILED:166 case NM.VPNConnectionState.FAILED:
167 state = State.FAILED_VPN;167 state = State.FAILED_VPN;
@@ -169,7 +169,6 @@
169 case NM.VPNConnectionState.ACTIVATED:169 case NM.VPNConnectionState.ACTIVATED:
170 state = State.CONNECTED_VPN;170 state = State.CONNECTED_VPN;
171 item = get_item_by_uuid (active_connection.get_uuid ());171 item = get_item_by_uuid (active_connection.get_uuid ());
172 item.state = state;
173 sensitive = true;172 sensitive = true;
174 break;173 break;
175 }174 }
@@ -177,6 +176,18 @@
177 state = State.DISCONNECTED;176 state = State.DISCONNECTED;
178 }177 }
179178
179 if (disconnect_btn != null) {
180 disconnect_btn.sensitive = sensitive;
181 }
182
183 if (settings_btn != null) {
184 settings_btn.sensitive = sensitive;
185 }
186
187 if (info_btn != null) {
188 info_btn.sensitive = sensitive;
189 }
190
180 if (item == null) {191 if (item == null) {
181 top_revealer.set_reveal_child (false);192 top_revealer.set_reveal_child (false);
182 blank_item.set_active (true);193 blank_item.set_active (true);
@@ -185,7 +196,11 @@
185 active_vpn_item.no_show_all = false;196 active_vpn_item.no_show_all = false;
186 active_vpn_item.visible = true;197 active_vpn_item.visible = true;
187 active_vpn_item.state = state;198 active_vpn_item.state = state;
188 }199
200 if (connected_frame != null && connected_frame.get_child () != null) {
201 connected_frame.get_child ().destroy ();
202 }
203 }
189 } else {204 } else {
190 top_revealer.set_reveal_child (true);205 top_revealer.set_reveal_child (true);
191 if (connected_frame != null && connected_frame.get_child () != null) {206 if (connected_frame != null && connected_frame.get_child () != null) {
@@ -193,6 +208,7 @@
193 }208 }
194209
195 connected_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);210 connected_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
211 item.state = state;
196 item.no_show_all = true;212 item.no_show_all = true;
197 item.visible = false;213 item.visible = false;
198214
@@ -213,11 +229,12 @@
213 info_btn.image = new Gtk.Image.from_icon_name ("view-more-symbolic", Gtk.IconSize.SMALL_TOOLBAR);229 info_btn.image = new Gtk.Image.from_icon_name ("view-more-symbolic", Gtk.IconSize.SMALL_TOOLBAR);
214230
215 vpn_info_box.set_connection (item.connection);231 vpn_info_box.set_connection (item.connection);
232 vpn_info_box.show_all ();
216233
217 popover.relative_to = info_btn;234 popover.relative_to = info_btn;
218235
219 info_btn.toggled.connect (() => {236 info_btn.toggled.connect (() => {
220 popover.visible = info_btn.get_active ();237 popover.visible = popover.sensitive = info_btn.get_active ();
221 });238 });
222239
223 var button_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);240 var button_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
@@ -233,18 +250,6 @@
233250
234 connected_box.show_all ();251 connected_box.show_all ();
235 connected_frame.show_all ();252 connected_frame.show_all ();
236
237 if (disconnect_btn != null) {
238 disconnect_btn.sensitive = sensitive;
239 }
240
241 if (settings_btn != null) {
242 settings_btn.sensitive = sensitive;
243 }
244
245 if (info_btn != null) {
246 info_btn.sensitive = sensitive;
247 }
248 }253 }
249254
250 owner.switch_status (Utils.CustomMode.INVALID, state);255 owner.switch_status (Utils.CustomMode.INVALID, state);
@@ -321,6 +326,7 @@
321 return;326 return;
322 }327 }
323328
329 update ();
324 client.deactivate_connection (active_connection);330 client.deactivate_connection (active_connection);
325 }331 }
326 }332 }

Subscribers

People subscribed via source and target branches

to all changes: