Merge lp:~donadigo/wingpanel-indicator-bluetooth/use-appinfo into lp:~wingpanel-devs/wingpanel-indicator-bluetooth/trunk

Proposed by Adam Bieńkowski
Status: Merged
Approved by: Felipe Escoto
Approved revision: 36
Merged at revision: 35
Proposed branch: lp:~donadigo/wingpanel-indicator-bluetooth/use-appinfo
Merge into: lp:~wingpanel-devs/wingpanel-indicator-bluetooth/trunk
Diff against target: 45 lines (+16/-6)
1 file modified
src/Widgets/Views/MainView.vala (+16/-6)
To merge this branch: bzr merge lp:~donadigo/wingpanel-indicator-bluetooth/use-appinfo
Reviewer Review Type Date Requested Status
WingPanel Devs Pending
Review via email: mp+293789@code.launchpad.net

Commit message

* Fix bug #1575376: "Use GLib.AppInfo.launch instead of granite simple command to open system settings".

Description of the change

Fixes bug #1575376: "Use GLib.AppInfo.launch instead of granite simple command to open system settings".

Use AppInfo instead of SimpleCommand to launch Switchboard.

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

Remove unused variable; use appinfo for bluetooth wizard

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Widgets/Views/MainView.vala'
--- src/Widgets/Views/MainView.vala 2016-05-01 00:07:29 +0000
+++ src/Widgets/Views/MainView.vala 2016-05-04 14:44:43 +0000
@@ -20,8 +20,6 @@
20 public signal void device_requested (Bluetooth.Services.Device device);20 public signal void device_requested (Bluetooth.Services.Device device);
21 public signal void discovery_requested ();21 public signal void discovery_requested ();
2222
23 private const string SETTINGS_EXEC = "switchboard bluetooth";
24
25 private Wingpanel.Widgets.Button show_settings_button;23 private Wingpanel.Widgets.Button show_settings_button;
26 private Wingpanel.Widgets.Button discovery_button;24 private Wingpanel.Widgets.Button discovery_button;
27 private Wingpanel.Widgets.Switch main_switch;25 private Wingpanel.Widgets.Switch main_switch;
@@ -59,8 +57,13 @@
5957
60 discovery_button.clicked.connect (() => {58 discovery_button.clicked.connect (() => {
61 request_close ();59 request_close ();
62 var cmd = new Granite.Services.SimpleCommand ("/usr/bin", "bluetooth-wizard");60
63 cmd.run ();61 try {
62 var appinfo = AppInfo.create_from_commandline ("bluetooth-wizard", null, AppInfoCreateFlags.SUPPORTS_URIS);
63 appinfo.launch_uris (null, null);
64 } catch (Error e) {
65 warning ("%s\n", e.message);
66 }
64 });67 });
6568
66 //Adapter's Connections69 //Adapter's Connections
@@ -110,7 +113,14 @@
110 }113 }
111114
112 private void show_settings () {115 private void show_settings () {
113 var cmd = new Granite.Services.SimpleCommand ("/usr/bin", SETTINGS_EXEC);116 var list = new List<string> ();
114 cmd.run ();117 list.append ("bluetooth");
118
119 try {
120 var appinfo = AppInfo.create_from_commandline ("switchboard", null, AppInfoCreateFlags.SUPPORTS_URIS);
121 appinfo.launch_uris (list, null);
122 } catch (Error e) {
123 warning ("%s\n", e.message);
124 }
115 }125 }
116}126}

Subscribers

People subscribed via source and target branches