Merge lp:~donadigo/switchboard-plug-networking/edit-connections-button into lp:~elementary-pantheon/switchboard-plug-networking/trunk

Proposed by Adam Bieńkowski
Status: Merged
Approved by: Danielle Foré
Approved revision: 289
Merged at revision: 294
Proposed branch: lp:~donadigo/switchboard-plug-networking/edit-connections-button
Merge into: lp:~elementary-pantheon/switchboard-plug-networking/trunk
Diff against target: 95 lines (+19/-13)
5 files modified
src/Widgets/EtherInterface.vala (+1/-4)
src/Widgets/Page.vala (+3/-1)
src/Widgets/SettingsButton.vala (+12/-3)
src/Widgets/VPNPage.vala (+2/-0)
src/Widgets/WifiInterface.vala (+1/-5)
To merge this branch: bzr merge lp:~donadigo/switchboard-plug-networking/edit-connections-button
Reviewer Review Type Date Requested Status
elementary Pantheon team Pending
Review via email: mp+302094@code.launchpad.net

Commit message

* Add an edit connections button to the toolbar.

Description of the change

This branch adds a simple edit connections button to the bottom of the sidebar. This temprarily fixes the current issue we have with settings button being not accessible when not connected. However the pages need to be redesigned anyway for future releases.

To post a comment you must log in.
Revision history for this message
Cody Garver (codygarver) wrote :

Should this instead be using AppInfo.create_from_commandline?

https://bugs.launchpad.net/wingpanel-indicator-network/+bug/1575376

Revision history for this message
Adam Bieńkowski (donadigo) wrote :

Cody: nm-connection-editor does not have any desktop file associated with it like switchboard and also, launching with AppInfo there is no way to determine when the command has ended so we can make the settings button sensitive again.

Revision history for this message
Adam Bieńkowski (donadigo) wrote :

Branch updated to comply to suggestions from Daniel and Felipe. The button should be on every page that features connections instead of in the sidebar.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Widgets/EtherInterface.vala'
--- src/Widgets/EtherInterface.vala 2016-07-29 21:11:33 +0000
+++ src/Widgets/EtherInterface.vala 2016-08-09 12:41:24 +0000
@@ -33,10 +33,7 @@
33 top_revealer.transition_type = Gtk.RevealerTransitionType.SLIDE_DOWN;33 top_revealer.transition_type = Gtk.RevealerTransitionType.SLIDE_DOWN;
34 top_revealer.add (info_box);34 top_revealer.add (info_box);
3535
36 var button_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);36 bottom_box.pack_start (new SettingsButton.from_device (device), false, false, 0);
37 button_box.pack_end (new SettingsButton.from_device (device), false, false, 0);
38
39 bottom_box.add (button_box);
4037
41 add (top_revealer);38 add (top_revealer);
42 add (bottom_revealer);39 add (bottom_revealer);
4340
=== modified file 'src/Widgets/Page.vala'
--- src/Widgets/Page.vala 2016-07-29 21:11:33 +0000
+++ src/Widgets/Page.vala 2016-08-09 12:41:24 +0000
@@ -63,7 +63,9 @@
6363
64 bottom_revealer = new Gtk.Revealer ();64 bottom_revealer = new Gtk.Revealer ();
65 bottom_revealer.transition_type = Gtk.RevealerTransitionType.SLIDE_UP;65 bottom_revealer.transition_type = Gtk.RevealerTransitionType.SLIDE_UP;
66 bottom_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 12);66
67 bottom_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
68 bottom_box.pack_start (new SettingsButton (), false, false, 0);
6769
68 bottom_revealer.add (bottom_box);70 bottom_revealer.add (bottom_box);
69 }71 }
7072
=== modified file 'src/Widgets/SettingsButton.vala'
--- src/Widgets/SettingsButton.vala 2016-07-22 16:01:12 +0000
+++ src/Widgets/SettingsButton.vala 2016-08-09 12:41:24 +0000
@@ -19,15 +19,24 @@
1919
20 namespace Network.Widgets {20 namespace Network.Widgets {
21 public class SettingsButton : Gtk.Button {21 public class SettingsButton : Gtk.Button {
22 private string uuid = "";22 private string? uuid = null;
2323
24 construct {24 construct {
25 clicked.connect (() => {25 clicked.connect (() => {
26 new Granite.Services.SimpleCommand ("/usr/bin",26 if (uuid != null) {
27 "nm-connection-editor --edit=%s".printf (uuid)).run ();27 new Granite.Services.SimpleCommand ("/usr/bin",
28 "nm-connection-editor --edit=%s".printf (uuid)).run ();
29 } else {
30 new Granite.Services.SimpleCommand ("/usr/bin",
31 "nm-connection-editor").run ();
32 }
28 }); 33 });
29 }34 }
3035
36 public SettingsButton () {
37 label = _("Edit Connections…");
38 }
39
31 public SettingsButton.from_device (NM.Device device, string title = _("Advanced Settings…")) {40 public SettingsButton.from_device (NM.Device device, string title = _("Advanced Settings…")) {
32 label = title;41 label = title;
33 uuid = device.get_active_connection ().get_uuid ();42 uuid = device.get_active_connection ().get_uuid ();
3443
=== modified file 'src/Widgets/VPNPage.vala'
--- src/Widgets/VPNPage.vala 2016-07-30 21:30:37 +0000
+++ src/Widgets/VPNPage.vala 2016-08-09 12:41:24 +0000
@@ -137,6 +137,8 @@
137 control_switch.no_show_all = true;137 control_switch.no_show_all = true;
138 control_switch.visible = false;138 control_switch.visible = false;
139139
140 bottom_revealer.set_reveal_child (true);
141
140 this.add (top_revealer);142 this.add (top_revealer);
141 this.add (main_frame);143 this.add (main_frame);
142 this.add (bottom_revealer);144 this.add (bottom_revealer);
143145
=== modified file 'src/Widgets/WifiInterface.vala'
--- src/Widgets/WifiInterface.vala 2016-07-29 19:49:28 +0000
+++ src/Widgets/WifiInterface.vala 2016-08-09 12:41:24 +0000
@@ -89,14 +89,10 @@
8989
90 main_frame.add (list_stack);90 main_frame.add (list_stack);
9191
92 var button_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
93
94 hidden_btn = new Gtk.Button.with_label (_("Connect to Hidden Network…"));92 hidden_btn = new Gtk.Button.with_label (_("Connect to Hidden Network…"));
95 hidden_btn.clicked.connect (connect_to_hidden);93 hidden_btn.clicked.connect (connect_to_hidden);
9694
97 button_box.pack_start (hidden_btn, false, false, 0);95 bottom_box.pack_start (hidden_btn, false, false, 0);
98
99 bottom_box.add (button_box);
10096
101 this.add (top_revealer);97 this.add (top_revealer);
102 this.add (main_frame);98 this.add (main_frame);

Subscribers

People subscribed via source and target branches

to all changes: