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
1=== modified file 'src/Widgets/VPNPage.vala'
2--- src/Widgets/VPNPage.vala 2016-07-30 15:43:10 +0000
3+++ src/Widgets/VPNPage.vala 2016-07-30 21:31:05 +0000
4@@ -48,6 +48,7 @@
5 control_box.margin_bottom = 12;
6
7 vpn_info_box = new VPNInfoBox ();
8+ vpn_info_box.margin = 12;
9
10 popover = new Gtk.Popover (info_btn);
11 popover.position = Gtk.PositionType.BOTTOM;
12@@ -161,7 +162,6 @@
13 case NM.VPNConnectionState.CONNECT:
14 state = State.CONNECTING_VPN;
15 item = get_item_by_uuid (active_connection.get_uuid ());
16- item.state = state;
17 break;
18 case NM.VPNConnectionState.FAILED:
19 state = State.FAILED_VPN;
20@@ -169,7 +169,6 @@
21 case NM.VPNConnectionState.ACTIVATED:
22 state = State.CONNECTED_VPN;
23 item = get_item_by_uuid (active_connection.get_uuid ());
24- item.state = state;
25 sensitive = true;
26 break;
27 }
28@@ -177,6 +176,18 @@
29 state = State.DISCONNECTED;
30 }
31
32+ if (disconnect_btn != null) {
33+ disconnect_btn.sensitive = sensitive;
34+ }
35+
36+ if (settings_btn != null) {
37+ settings_btn.sensitive = sensitive;
38+ }
39+
40+ if (info_btn != null) {
41+ info_btn.sensitive = sensitive;
42+ }
43+
44 if (item == null) {
45 top_revealer.set_reveal_child (false);
46 blank_item.set_active (true);
47@@ -185,7 +196,11 @@
48 active_vpn_item.no_show_all = false;
49 active_vpn_item.visible = true;
50 active_vpn_item.state = state;
51- }
52+
53+ if (connected_frame != null && connected_frame.get_child () != null) {
54+ connected_frame.get_child ().destroy ();
55+ }
56+ }
57 } else {
58 top_revealer.set_reveal_child (true);
59 if (connected_frame != null && connected_frame.get_child () != null) {
60@@ -193,6 +208,7 @@
61 }
62
63 connected_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
64+ item.state = state;
65 item.no_show_all = true;
66 item.visible = false;
67
68@@ -213,11 +229,12 @@
69 info_btn.image = new Gtk.Image.from_icon_name ("view-more-symbolic", Gtk.IconSize.SMALL_TOOLBAR);
70
71 vpn_info_box.set_connection (item.connection);
72+ vpn_info_box.show_all ();
73
74 popover.relative_to = info_btn;
75
76 info_btn.toggled.connect (() => {
77- popover.visible = info_btn.get_active ();
78+ popover.visible = popover.sensitive = info_btn.get_active ();
79 });
80
81 var button_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
82@@ -233,18 +250,6 @@
83
84 connected_box.show_all ();
85 connected_frame.show_all ();
86-
87- if (disconnect_btn != null) {
88- disconnect_btn.sensitive = sensitive;
89- }
90-
91- if (settings_btn != null) {
92- settings_btn.sensitive = sensitive;
93- }
94-
95- if (info_btn != null) {
96- info_btn.sensitive = sensitive;
97- }
98 }
99
100 owner.switch_status (Utils.CustomMode.INVALID, state);
101@@ -321,6 +326,7 @@
102 return;
103 }
104
105+ update ();
106 client.deactivate_connection (active_connection);
107 }
108 }

Subscribers

People subscribed via source and target branches

to all changes: