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
1=== modified file 'src/Widgets/EtherInterface.vala'
2--- src/Widgets/EtherInterface.vala 2016-07-29 21:11:33 +0000
3+++ src/Widgets/EtherInterface.vala 2016-08-09 12:41:24 +0000
4@@ -33,10 +33,7 @@
5 top_revealer.transition_type = Gtk.RevealerTransitionType.SLIDE_DOWN;
6 top_revealer.add (info_box);
7
8- var button_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
9- button_box.pack_end (new SettingsButton.from_device (device), false, false, 0);
10-
11- bottom_box.add (button_box);
12+ bottom_box.pack_start (new SettingsButton.from_device (device), false, false, 0);
13
14 add (top_revealer);
15 add (bottom_revealer);
16
17=== modified file 'src/Widgets/Page.vala'
18--- src/Widgets/Page.vala 2016-07-29 21:11:33 +0000
19+++ src/Widgets/Page.vala 2016-08-09 12:41:24 +0000
20@@ -63,7 +63,9 @@
21
22 bottom_revealer = new Gtk.Revealer ();
23 bottom_revealer.transition_type = Gtk.RevealerTransitionType.SLIDE_UP;
24- bottom_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 12);
25+
26+ bottom_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
27+ bottom_box.pack_start (new SettingsButton (), false, false, 0);
28
29 bottom_revealer.add (bottom_box);
30 }
31
32=== modified file 'src/Widgets/SettingsButton.vala'
33--- src/Widgets/SettingsButton.vala 2016-07-22 16:01:12 +0000
34+++ src/Widgets/SettingsButton.vala 2016-08-09 12:41:24 +0000
35@@ -19,15 +19,24 @@
36
37 namespace Network.Widgets {
38 public class SettingsButton : Gtk.Button {
39- private string uuid = "";
40+ private string? uuid = null;
41
42 construct {
43 clicked.connect (() => {
44- new Granite.Services.SimpleCommand ("/usr/bin",
45- "nm-connection-editor --edit=%s".printf (uuid)).run ();
46+ if (uuid != null) {
47+ new Granite.Services.SimpleCommand ("/usr/bin",
48+ "nm-connection-editor --edit=%s".printf (uuid)).run ();
49+ } else {
50+ new Granite.Services.SimpleCommand ("/usr/bin",
51+ "nm-connection-editor").run ();
52+ }
53 });
54 }
55
56+ public SettingsButton () {
57+ label = _("Edit Connections…");
58+ }
59+
60 public SettingsButton.from_device (NM.Device device, string title = _("Advanced Settings…")) {
61 label = title;
62 uuid = device.get_active_connection ().get_uuid ();
63
64=== modified file 'src/Widgets/VPNPage.vala'
65--- src/Widgets/VPNPage.vala 2016-07-30 21:30:37 +0000
66+++ src/Widgets/VPNPage.vala 2016-08-09 12:41:24 +0000
67@@ -137,6 +137,8 @@
68 control_switch.no_show_all = true;
69 control_switch.visible = false;
70
71+ bottom_revealer.set_reveal_child (true);
72+
73 this.add (top_revealer);
74 this.add (main_frame);
75 this.add (bottom_revealer);
76
77=== modified file 'src/Widgets/WifiInterface.vala'
78--- src/Widgets/WifiInterface.vala 2016-07-29 19:49:28 +0000
79+++ src/Widgets/WifiInterface.vala 2016-08-09 12:41:24 +0000
80@@ -89,14 +89,10 @@
81
82 main_frame.add (list_stack);
83
84- var button_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
85-
86 hidden_btn = new Gtk.Button.with_label (_("Connect to Hidden Network…"));
87 hidden_btn.clicked.connect (connect_to_hidden);
88
89- button_box.pack_start (hidden_btn, false, false, 0);
90-
91- bottom_box.add (button_box);
92+ bottom_box.pack_start (hidden_btn, false, false, 0);
93
94 this.add (top_revealer);
95 this.add (main_frame);

Subscribers

People subscribed via source and target branches

to all changes: