20
20
namespace Network.Widgets {
21
21
public class SettingsButton : Gtk.Button {
22
private string? uuid = null;
25
clicked.connect (() => {
27
new Granite.Services.SimpleCommand ("/usr/bin",
28
"nm-connection-editor --edit=%s".printf (uuid)).run ();
30
new Granite.Services.SimpleCommand ("/usr/bin",
31
"nm-connection-editor").run ();
36
22
public SettingsButton () {
37
23
label = _("Edit Connections…");
24
clicked.connect (() => {
25
new Granite.Services.SimpleCommand ("/usr/bin",
26
"nm-connection-editor").run ();
40
30
public SettingsButton.from_device (NM.Device device, string title = _("Advanced Settings…")) {
42
uuid = device.get_active_connection ().get_uuid ();
32
clicked.connect (() => {
34
var active_connection = device.get_active_connection ();
35
if (active_connection != null) {
36
uuid = device.get_active_connection ().get_uuid ();
38
var available_connections = device.get_available_connections ();
39
if (available_connections.length > 0) {
40
uuid = available_connections[0].get_uuid ();
44
new Granite.Services.SimpleCommand ("/usr/bin",
45
"nm-connection-editor --edit=%s".printf (uuid)).run ();
45
49
public SettingsButton.from_connection (NM.Connection connection, string title = _("Advanced Settings…")) {
47
uuid = connection.get_uuid ();
51
clicked.connect (() => {
52
new Granite.Services.SimpleCommand ("/usr/bin",
53
"nm-connection-editor --edit=%s".printf (connection.get_uuid ())).run ();
b'\\ No newline at end of file'