Merge lp:~tintou/wingpanel-indicator-bluetooth/async-creation into lp:~wingpanel-devs/wingpanel-indicator-bluetooth/trunk
- async-creation
- Merge into trunk
Proposed by
Corentin Noël
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Danielle Foré | ||||
Approved revision: | 34 | ||||
Merged at revision: | 34 | ||||
Proposed branch: | lp:~tintou/wingpanel-indicator-bluetooth/async-creation | ||||
Merge into: | lp:~wingpanel-devs/wingpanel-indicator-bluetooth/trunk | ||||
Diff against target: |
365 lines (+102/-83) 6 files modified
src/Indicator.vala (+11/-31) src/Services/Manager.vala (+83/-45) src/Widgets/DisplayWidget.vala (+1/-1) src/Widgets/PopoverWidget.vala (+3/-3) src/Widgets/Views/DiscoveryView.vala (+3/-2) src/Widgets/Views/MainView.vala (+1/-1) |
||||
To merge this branch: | bzr merge lp:~tintou/wingpanel-indicator-bluetooth/async-creation | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
WingPanel Devs | Pending | ||
Review via email: mp+293474@code.launchpad.net |
Commit message
Make the indicator asynchronous and showing only if an adapter is present.
Fixed some possible crash with threads
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/Indicator.vala' | |||
2 | --- src/Indicator.vala 2016-04-04 14:59:57 +0000 | |||
3 | +++ src/Indicator.vala 2016-05-01 00:09:35 +0000 | |||
4 | @@ -15,62 +15,44 @@ | |||
5 | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
6 | 16 | */ | 16 | */ |
7 | 17 | 17 | ||
8 | 18 | namespace Bluetooth { | ||
9 | 19 | public static Bluetooth.Services.ObjectManager object_manager; | ||
10 | 20 | public static Bluetooth.Indicator indicator; | ||
11 | 21 | } | ||
12 | 22 | |||
13 | 23 | public class Bluetooth.Indicator : Wingpanel.Indicator { | 18 | public class Bluetooth.Indicator : Wingpanel.Indicator { |
14 | 24 | private bool is_in_session = false; | 19 | private bool is_in_session = false; |
15 | 25 | private bool last_state_set = false; | ||
16 | 26 | 20 | ||
17 | 27 | private Bluetooth.Widgets.PopoverWidget popover_widget; | 21 | private Bluetooth.Widgets.PopoverWidget popover_widget; |
18 | 28 | private Bluetooth.Widgets.DisplayWidget dynamic_icon; | 22 | private Bluetooth.Widgets.DisplayWidget dynamic_icon; |
19 | 23 | private Bluetooth.Services.ObjectManager object_manager; | ||
20 | 29 | public Indicator (bool is_in_session) { | 24 | public Indicator (bool is_in_session) { |
21 | 30 | Object (code_name: Wingpanel.Indicator.BLUETOOTH, | 25 | Object (code_name: Wingpanel.Indicator.BLUETOOTH, |
22 | 31 | display_name: _("bluetooth"), | 26 | display_name: _("bluetooth"), |
23 | 32 | description:_("The bluetooth indicator")); | 27 | description:_("The bluetooth indicator")); |
24 | 28 | this.is_in_session = is_in_session; | ||
25 | 33 | object_manager = new Services.ObjectManager (); | 29 | object_manager = new Services.ObjectManager (); |
30 | 34 | 30 | object_manager.bind_property ("has-object", this, "visible", GLib.BindingFlags.SYNC_CREATE); | |
31 | 35 | this.visible = object_manager.has_object; | 31 | |
32 | 36 | 32 | if (object_manager.has_object) { | |
29 | 37 | if (this.visible) { | ||
33 | 38 | object_manager.set_last_state (); | 33 | object_manager.set_last_state (); |
34 | 39 | last_state_set = true; | ||
35 | 40 | } | 34 | } |
36 | 41 | 35 | ||
40 | 42 | object_manager.adapter_added.connect (() => { | 36 | object_manager.notify["has-object"].connect (() => { |
41 | 43 | visible = object_manager.has_object; | 37 | if (object_manager.has_object) { |
39 | 44 | if (!last_state_set) { | ||
42 | 45 | object_manager.set_last_state (); | 38 | object_manager.set_last_state (); |
43 | 46 | last_state_set = true; | ||
44 | 47 | } | 39 | } |
45 | 48 | }); | 40 | }); |
46 | 49 | 41 | ||
47 | 50 | object_manager.adapter_removed.connect (() => { | ||
48 | 51 | visible = object_manager.has_object; | ||
49 | 52 | }); | ||
50 | 53 | |||
51 | 54 | this.is_in_session = is_in_session; | ||
52 | 55 | |||
53 | 56 | debug ("Bluetooth Indicator started"); | 42 | debug ("Bluetooth Indicator started"); |
54 | 57 | } | 43 | } |
55 | 58 | 44 | ||
56 | 59 | public override Gtk.Widget get_display_widget () { | 45 | public override Gtk.Widget get_display_widget () { |
57 | 60 | if (dynamic_icon == null) { | 46 | if (dynamic_icon == null) { |
59 | 61 | dynamic_icon = new Bluetooth.Widgets.DisplayWidget (); | 47 | dynamic_icon = new Bluetooth.Widgets.DisplayWidget (object_manager); |
60 | 62 | } | 48 | } |
61 | 63 | 49 | ||
62 | 64 | return dynamic_icon; | 50 | return dynamic_icon; |
63 | 65 | } | 51 | } |
64 | 66 | 52 | ||
65 | 67 | public override Gtk.Widget? get_widget () { | 53 | public override Gtk.Widget? get_widget () { |
66 | 68 | if (object_manager.has_object == false) { | ||
67 | 69 | return null; | ||
68 | 70 | } | ||
69 | 71 | |||
70 | 72 | if (popover_widget == null) { | 54 | if (popover_widget == null) { |
72 | 73 | popover_widget = new Bluetooth.Widgets.PopoverWidget (is_in_session); | 55 | popover_widget = new Bluetooth.Widgets.PopoverWidget (object_manager, is_in_session); |
73 | 74 | popover_widget.request_close.connect (() => { | 56 | popover_widget.request_close.connect (() => { |
74 | 75 | close (); | 57 | close (); |
75 | 76 | }); | 58 | }); |
76 | @@ -89,9 +71,7 @@ | |||
77 | 89 | 71 | ||
78 | 90 | public Wingpanel.Indicator get_indicator (Module module, Wingpanel.IndicatorManager.ServerType server_type) { | 72 | public Wingpanel.Indicator get_indicator (Module module, Wingpanel.IndicatorManager.ServerType server_type) { |
79 | 91 | debug ("Activating Bluetooth Indicator"); | 73 | debug ("Activating Bluetooth Indicator"); |
83 | 92 | if (Bluetooth.indicator == null) { | 74 | var indicator = new Bluetooth.Indicator (server_type == Wingpanel.IndicatorManager.ServerType.SESSION); |
81 | 93 | Bluetooth.indicator = new Bluetooth.Indicator (server_type == Wingpanel.IndicatorManager.ServerType.SESSION); | ||
82 | 94 | } | ||
84 | 95 | 75 | ||
86 | 96 | return Bluetooth.indicator; | 76 | return indicator; |
87 | 97 | } | 77 | } |
88 | 98 | 78 | ||
89 | === modified file 'src/Services/Manager.vala' | |||
90 | --- src/Services/Manager.vala 2016-04-04 14:59:57 +0000 | |||
91 | +++ src/Services/Manager.vala 2016-05-01 00:09:35 +0000 | |||
92 | @@ -30,11 +30,7 @@ | |||
93 | 30 | public signal void device_added (Bluetooth.Services.Device adapter); | 30 | public signal void device_added (Bluetooth.Services.Device adapter); |
94 | 31 | public signal void device_removed (Bluetooth.Services.Device adapter); | 31 | public signal void device_removed (Bluetooth.Services.Device adapter); |
95 | 32 | 32 | ||
101 | 33 | public bool has_object { | 33 | public bool has_object { get; private set; default = false; } |
97 | 34 | get { | ||
98 | 35 | return !adapters.is_empty; | ||
99 | 36 | } | ||
100 | 37 | } | ||
102 | 38 | 34 | ||
103 | 39 | private Settings settings; | 35 | private Settings settings; |
104 | 40 | private Bluetooth.Services.DBusInterface object_interface; | 36 | private Bluetooth.Services.DBusInterface object_interface; |
105 | @@ -42,25 +38,35 @@ | |||
106 | 42 | private Gee.HashMap<string, Bluetooth.Services.Device> devices; | 38 | private Gee.HashMap<string, Bluetooth.Services.Device> devices; |
107 | 43 | 39 | ||
108 | 44 | public ObjectManager () { | 40 | public ObjectManager () { |
109 | 41 | |||
110 | 42 | } | ||
111 | 43 | |||
112 | 44 | construct { | ||
113 | 45 | adapters = new Gee.HashMap<string, Bluetooth.Services.Adapter> (null, null); | 45 | adapters = new Gee.HashMap<string, Bluetooth.Services.Adapter> (null, null); |
114 | 46 | devices = new Gee.HashMap<string, Bluetooth.Services.Device> (null, null); | 46 | devices = new Gee.HashMap<string, Bluetooth.Services.Device> (null, null); |
125 | 47 | try { | 47 | settings = new Settings ("org.pantheon.desktop.wingpanel.indicators.bluetooth"); |
126 | 48 | object_interface = Bus.get_proxy_sync (BusType.SYSTEM, "org.bluez", "/", DBusProxyFlags.NONE); | 48 | Bus.get_proxy.begin<Bluetooth.Services.DBusInterface> (BusType.SYSTEM, "org.bluez", "/", DBusProxyFlags.NONE, null, (obj, res) => { |
127 | 49 | var objects = object_interface.get_managed_objects (); | 49 | try { |
128 | 50 | objects.foreach ((path, param) => {add_path (path, param);}); | 50 | object_interface = Bus.get_proxy.end (res); |
129 | 51 | object_interface.interfaces_added.connect ((path, param) => {add_path (path, param);}); | 51 | object_interface.get_managed_objects ().foreach (add_path); |
130 | 52 | object_interface.interfaces_removed.connect ((path, array) => {remove_path (path);}); | 52 | object_interface.interfaces_added.connect (add_path); |
131 | 53 | settings = new Settings ("org.pantheon.desktop.wingpanel.indicators.bluetooth"); | 53 | object_interface.interfaces_removed.connect (remove_path); |
132 | 54 | } catch (Error e) { | 54 | } catch (Error e) { |
133 | 55 | critical (e.message); | 55 | critical (e.message); |
134 | 56 | } | 56 | } |
135 | 57 | }); | ||
136 | 57 | } | 58 | } |
137 | 58 | 59 | ||
138 | 60 | [CCode (instance_pos = -1)] | ||
139 | 59 | private void add_path (ObjectPath path, HashTable<string, HashTable<string, Variant>> param) { | 61 | private void add_path (ObjectPath path, HashTable<string, HashTable<string, Variant>> param) { |
140 | 60 | if ("org.bluez.Adapter1" in param) { | 62 | if ("org.bluez.Adapter1" in param) { |
141 | 61 | try { | 63 | try { |
142 | 62 | Bluetooth.Services.Adapter adapter = Bus.get_proxy_sync (BusType.SYSTEM, "org.bluez", path, DBusProxyFlags.GET_INVALIDATED_PROPERTIES); | 64 | Bluetooth.Services.Adapter adapter = Bus.get_proxy_sync (BusType.SYSTEM, "org.bluez", path, DBusProxyFlags.GET_INVALIDATED_PROPERTIES); |
144 | 63 | adapters.set (path, adapter); | 65 | lock (adapters) { |
145 | 66 | adapters.set (path, adapter); | ||
146 | 67 | } | ||
147 | 68 | has_object = true; | ||
148 | 69 | |||
149 | 64 | adapter_added (adapter); | 70 | adapter_added (adapter); |
150 | 65 | (adapter as DBusProxy).g_properties_changed.connect ((changed, invalid) => { | 71 | (adapter as DBusProxy).g_properties_changed.connect ((changed, invalid) => { |
151 | 66 | var powered = changed.lookup_value("Powered", new VariantType("b")); | 72 | var powered = changed.lookup_value("Powered", new VariantType("b")); |
152 | @@ -75,21 +81,32 @@ | |||
153 | 75 | try { | 81 | try { |
154 | 76 | Bluetooth.Services.Device device = Bus.get_proxy_sync (BusType.SYSTEM, "org.bluez", path, DBusProxyFlags.GET_INVALIDATED_PROPERTIES); | 82 | Bluetooth.Services.Device device = Bus.get_proxy_sync (BusType.SYSTEM, "org.bluez", path, DBusProxyFlags.GET_INVALIDATED_PROPERTIES); |
155 | 77 | if (device.paired) { | 83 | if (device.paired) { |
157 | 78 | devices.set (path, device); | 84 | lock (devices) { |
158 | 85 | devices.set (path, device); | ||
159 | 86 | } | ||
160 | 87 | |||
161 | 79 | device_added (device); | 88 | device_added (device); |
162 | 80 | } | 89 | } |
163 | 90 | |||
164 | 81 | (device as DBusProxy).g_properties_changed.connect ((changed, invalid) => { | 91 | (device as DBusProxy).g_properties_changed.connect ((changed, invalid) => { |
165 | 82 | var connected = changed.lookup_value("Connected", new VariantType("b")); | 92 | var connected = changed.lookup_value("Connected", new VariantType("b")); |
166 | 83 | if (connected != null) { | 93 | if (connected != null) { |
167 | 84 | check_global_state (); | 94 | check_global_state (); |
168 | 85 | } | 95 | } |
169 | 96 | |||
170 | 86 | var paired = changed.lookup_value("Paired", new VariantType("b")); | 97 | var paired = changed.lookup_value("Paired", new VariantType("b")); |
171 | 87 | if (paired != null) { | 98 | if (paired != null) { |
172 | 88 | if (device.paired) { | 99 | if (device.paired) { |
174 | 89 | devices.set (path, device); | 100 | lock (devices) { |
175 | 101 | devices.set (path, device); | ||
176 | 102 | } | ||
177 | 103 | |||
178 | 90 | device_added (device); | 104 | device_added (device); |
179 | 91 | } else { | 105 | } else { |
181 | 92 | devices.unset (path); | 106 | lock (devices) { |
182 | 107 | devices.unset (path); | ||
183 | 108 | } | ||
184 | 109 | |||
185 | 93 | device_removed (device); | 110 | device_removed (device); |
186 | 94 | } | 111 | } |
187 | 95 | } | 112 | } |
188 | @@ -100,31 +117,44 @@ | |||
189 | 100 | } | 117 | } |
190 | 101 | } | 118 | } |
191 | 102 | 119 | ||
192 | 120 | [CCode (instance_pos = -1)] | ||
193 | 103 | public void remove_path (ObjectPath path) { | 121 | public void remove_path (ObjectPath path) { |
199 | 104 | var adapter = adapters.get (path); | 122 | lock (adapters) { |
200 | 105 | if (adapter != null) { | 123 | var adapter = adapters.get (path); |
201 | 106 | adapters.unset (path); | 124 | if (adapter != null) { |
202 | 107 | adapter_removed (adapter); | 125 | adapters.unset (path); |
203 | 108 | return; | 126 | has_object = !adapters.is_empty; |
204 | 127 | |||
205 | 128 | adapter_removed (adapter); | ||
206 | 129 | return; | ||
207 | 130 | } | ||
208 | 109 | } | 131 | } |
209 | 110 | 132 | ||
214 | 111 | var device = devices.get (path); | 133 | lock (devices) { |
215 | 112 | if (device != null) { | 134 | var device = devices.get (path); |
216 | 113 | devices.unset (path); | 135 | if (device != null) { |
217 | 114 | device_removed (device); | 136 | devices.unset (path); |
218 | 137 | device_removed (device); | ||
219 | 138 | } | ||
220 | 115 | } | 139 | } |
221 | 116 | } | 140 | } |
222 | 117 | 141 | ||
223 | 118 | public Gee.Collection<Bluetooth.Services.Adapter> get_adapters () { | 142 | public Gee.Collection<Bluetooth.Services.Adapter> get_adapters () { |
225 | 119 | return adapters.values; | 143 | lock (adapters) { |
226 | 144 | return adapters.values; | ||
227 | 145 | } | ||
228 | 120 | } | 146 | } |
229 | 121 | 147 | ||
230 | 122 | public Gee.Collection<Bluetooth.Services.Device> get_devices () { | 148 | public Gee.Collection<Bluetooth.Services.Device> get_devices () { |
232 | 123 | return devices.values; | 149 | lock (devices) { |
233 | 150 | return devices.values; | ||
234 | 151 | } | ||
235 | 124 | } | 152 | } |
236 | 125 | 153 | ||
237 | 126 | public Bluetooth.Services.Adapter? get_adapter_from_path (string path) { | 154 | public Bluetooth.Services.Adapter? get_adapter_from_path (string path) { |
239 | 127 | return adapters.get (path); | 155 | lock (adapters) { |
240 | 156 | return adapters.get (path); | ||
241 | 157 | } | ||
242 | 128 | } | 158 | } |
243 | 129 | 159 | ||
244 | 130 | private void check_global_state () { | 160 | private void check_global_state () { |
245 | @@ -132,9 +162,11 @@ | |||
246 | 132 | } | 162 | } |
247 | 133 | 163 | ||
248 | 134 | public bool get_connected () { | 164 | public bool get_connected () { |
252 | 135 | foreach (var device in devices.values) { | 165 | lock (devices) { |
253 | 136 | if (device.connected) { | 166 | foreach (var device in devices.values) { |
254 | 137 | return true; | 167 | if (device.connected) { |
255 | 168 | return true; | ||
256 | 169 | } | ||
257 | 138 | } | 170 | } |
258 | 139 | } | 171 | } |
259 | 140 | 172 | ||
260 | @@ -142,9 +174,11 @@ | |||
261 | 142 | } | 174 | } |
262 | 143 | 175 | ||
263 | 144 | public bool get_global_state () { | 176 | public bool get_global_state () { |
267 | 145 | foreach (var adapter in adapters.values) { | 177 | lock (adapters) { |
268 | 146 | if (adapter.powered) { | 178 | foreach (var adapter in adapters.values) { |
269 | 147 | return true; | 179 | if (adapter.powered) { |
270 | 180 | return true; | ||
271 | 181 | } | ||
272 | 148 | } | 182 | } |
273 | 149 | } | 183 | } |
274 | 150 | 184 | ||
275 | @@ -153,18 +187,22 @@ | |||
276 | 153 | 187 | ||
277 | 154 | public void set_global_state (bool state) { | 188 | public void set_global_state (bool state) { |
278 | 155 | new Thread<void*> (null, () => { | 189 | new Thread<void*> (null, () => { |
285 | 156 | foreach (var device in devices.values) { | 190 | lock (devices) { |
286 | 157 | if (device.connected) { | 191 | foreach (var device in devices.values) { |
287 | 158 | try { | 192 | if (device.connected) { |
288 | 159 | device.disconnect (); | 193 | try { |
289 | 160 | } catch (Error e) { | 194 | device.disconnect (); |
290 | 161 | critical (e.message); | 195 | } catch (Error e) { |
291 | 196 | critical (e.message); | ||
292 | 197 | } | ||
293 | 162 | } | 198 | } |
294 | 163 | } | 199 | } |
295 | 164 | } | 200 | } |
296 | 165 | 201 | ||
299 | 166 | foreach (var adapter in adapters.values) { | 202 | lock (adapters) { |
300 | 167 | adapter.powered = state; | 203 | foreach (var adapter in adapters.values) { |
301 | 204 | adapter.powered = state; | ||
302 | 205 | } | ||
303 | 168 | } | 206 | } |
304 | 169 | 207 | ||
305 | 170 | settings.set_boolean ("bluetooth-enabled", state); | 208 | settings.set_boolean ("bluetooth-enabled", state); |
306 | 171 | 209 | ||
307 | === modified file 'src/Widgets/DisplayWidget.vala' | |||
308 | --- src/Widgets/DisplayWidget.vala 2015-11-15 15:51:29 +0000 | |||
309 | +++ src/Widgets/DisplayWidget.vala 2016-05-01 00:09:35 +0000 | |||
310 | @@ -16,7 +16,7 @@ | |||
311 | 16 | */ | 16 | */ |
312 | 17 | 17 | ||
313 | 18 | public class Bluetooth.Widgets.DisplayWidget : Gtk.Image { | 18 | public class Bluetooth.Widgets.DisplayWidget : Gtk.Image { |
315 | 19 | public DisplayWidget () { | 19 | public DisplayWidget (Bluetooth.Services.ObjectManager object_manager) { |
316 | 20 | icon_size = Gtk.IconSize.LARGE_TOOLBAR; | 20 | icon_size = Gtk.IconSize.LARGE_TOOLBAR; |
317 | 21 | set_icon (object_manager.get_global_state (), object_manager.get_connected ()); | 21 | set_icon (object_manager.get_global_state (), object_manager.get_connected ()); |
318 | 22 | 22 | ||
319 | 23 | 23 | ||
320 | === modified file 'src/Widgets/PopoverWidget.vala' | |||
321 | --- src/Widgets/PopoverWidget.vala 2016-02-15 02:04:56 +0000 | |||
322 | +++ src/Widgets/PopoverWidget.vala 2016-05-01 00:09:35 +0000 | |||
323 | @@ -20,10 +20,10 @@ | |||
324 | 20 | private Bluetooth.Widgets.MainView main_view; | 20 | private Bluetooth.Widgets.MainView main_view; |
325 | 21 | private Bluetooth.Widgets.DiscoveryView discovery_view; | 21 | private Bluetooth.Widgets.DiscoveryView discovery_view; |
326 | 22 | 22 | ||
328 | 23 | public PopoverWidget (bool is_in_session) { | 23 | public PopoverWidget (Bluetooth.Services.ObjectManager object_manager, bool is_in_session) { |
329 | 24 | transition_type = Gtk.StackTransitionType.SLIDE_LEFT_RIGHT; | 24 | transition_type = Gtk.StackTransitionType.SLIDE_LEFT_RIGHT; |
332 | 25 | main_view = new Bluetooth.Widgets.MainView (is_in_session); | 25 | main_view = new Bluetooth.Widgets.MainView (object_manager, is_in_session); |
333 | 26 | discovery_view = new Bluetooth.Widgets.DiscoveryView (); | 26 | discovery_view = new Bluetooth.Widgets.DiscoveryView (object_manager); |
334 | 27 | 27 | ||
335 | 28 | add (main_view); | 28 | add (main_view); |
336 | 29 | add (discovery_view); | 29 | add (discovery_view); |
337 | 30 | 30 | ||
338 | === modified file 'src/Widgets/Views/DiscoveryView.vala' | |||
339 | --- src/Widgets/Views/DiscoveryView.vala 2016-02-15 02:04:56 +0000 | |||
340 | +++ src/Widgets/Views/DiscoveryView.vala 2016-05-01 00:09:35 +0000 | |||
341 | @@ -19,8 +19,9 @@ | |||
342 | 19 | public Gtk.Button back_button; | 19 | public Gtk.Button back_button; |
343 | 20 | private Gtk.Grid device_grid; | 20 | private Gtk.Grid device_grid; |
344 | 21 | 21 | ||
347 | 22 | public DiscoveryView () { | 22 | unowned Bluetooth.Services.ObjectManager object_manager; |
348 | 23 | 23 | public DiscoveryView (Bluetooth.Services.ObjectManager object_manager) { | |
349 | 24 | this.object_manager = object_manager; | ||
350 | 24 | } | 25 | } |
351 | 25 | 26 | ||
352 | 26 | construct { | 27 | construct { |
353 | 27 | 28 | ||
354 | === modified file 'src/Widgets/Views/MainView.vala' | |||
355 | --- src/Widgets/Views/MainView.vala 2016-02-12 04:24:08 +0000 | |||
356 | +++ src/Widgets/Views/MainView.vala 2016-05-01 00:09:35 +0000 | |||
357 | @@ -27,7 +27,7 @@ | |||
358 | 27 | private Wingpanel.Widgets.Switch main_switch; | 27 | private Wingpanel.Widgets.Switch main_switch; |
359 | 28 | private Gtk.Box devices_box; | 28 | private Gtk.Box devices_box; |
360 | 29 | 29 | ||
362 | 30 | public MainView (bool is_in_session) { | 30 | public MainView (Bluetooth.Services.ObjectManager object_manager, bool is_in_session) { |
363 | 31 | main_switch = new Wingpanel.Widgets.Switch (_("Bluetooth"), object_manager.get_global_state ()); | 31 | main_switch = new Wingpanel.Widgets.Switch (_("Bluetooth"), object_manager.get_global_state ()); |
364 | 32 | show_settings_button = new Wingpanel.Widgets.Button (_("Bluetooth Settings…")); | 32 | show_settings_button = new Wingpanel.Widgets.Button (_("Bluetooth Settings…")); |
365 | 33 | discovery_button = new Wingpanel.Widgets.Button (_("Discover Devices…")); | 33 | discovery_button = new Wingpanel.Widgets.Button (_("Discover Devices…")); |