Merge lp:~charlesk/indicator-bluetooth/lp-1233628 into lp:indicator-bluetooth/13.10

Proposed by Charles Kerr
Status: Merged
Approved by: Ted Gould
Approved revision: 68
Merged at revision: 68
Proposed branch: lp:~charlesk/indicator-bluetooth/lp-1233628
Merge into: lp:indicator-bluetooth/13.10
Diff against target: 82 lines (+21/-0)
5 files modified
src/bluetooth.vala (+5/-0)
src/bluez.vala (+2/-0)
src/desktop.vala (+1/-0)
src/phone.vala (+1/-0)
src/profile.vala (+12/-0)
To merge this branch: bzr merge lp:~charlesk/indicator-bluetooth/lp-1233628
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+190465@code.launchpad.net

Description of the change

add an action whose state shows whether or not bluetooth is supported by the hardware, used by ubuntu-system-settings.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ted Gould (ted) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/bluetooth.vala'
2--- src/bluetooth.vala 2013-08-05 21:48:17 +0000
3+++ src/bluetooth.vala 2013-10-10 20:02:22 +0000
4@@ -23,6 +23,10 @@
5 */
6 public interface Bluetooth: Object
7 {
8+ /* True if there are any bluetooth adapters on this system.
9+ This work as a proxy for "does this hardware support bluetooth?" */
10+ public abstract bool supported { get; protected set; }
11+
12 /* True if there are any bluetooth adapters powered up on the system.
13 In short, whether or not this system's bluetooth is "on". */
14 public abstract bool powered { get; protected set; }
15@@ -68,6 +72,7 @@
16 killswitch.notify["blocked"].connect (() => blocked = killswitch.blocked );
17 }
18
19+ public bool supported { get; protected set; default = false; }
20 public bool powered { get; protected set; default = false; }
21 public bool discoverable { get; protected set; default = false; }
22 public bool blocked { get; protected set; default = true; }
23
24=== modified file 'src/bluez.vala'
25--- src/bluez.vala 2013-08-06 20:33:26 +0000
26+++ src/bluez.vala 2013-10-10 20:02:22 +0000
27@@ -70,6 +70,8 @@
28
29 private void on_default_adapter_changed (string? object_path)
30 {
31+ supported = object_path != null;
32+
33 if (object_path != null) try
34 {
35 debug (@"using default adapter at $object_path");
36
37=== modified file 'src/desktop.vala'
38--- src/desktop.vala 2013-08-22 16:25:21 +0000
39+++ src/desktop.vala 2013-10-10 20:02:22 +0000
40@@ -52,6 +52,7 @@
41 // build the static actions
42 Action[] actions = {};
43 actions += root_action;
44+ actions += create_supported_action (bluetooth);
45 actions += create_enabled_action (bluetooth);
46 actions += create_discoverable_action (bluetooth);
47 actions += create_wizard_action ();
48
49=== modified file 'src/phone.vala'
50--- src/phone.vala 2013-10-03 20:49:23 +0000
51+++ src/phone.vala 2013-10-10 20:02:22 +0000
52@@ -32,6 +32,7 @@
53 // build the static actions
54 Action[] actions = {};
55 actions += root_action;
56+ actions += create_supported_action (bluetooth);
57 actions += create_enabled_action (bluetooth);
58 actions += create_settings_action ();
59 foreach (var a in actions)
60
61=== modified file 'src/profile.vala'
62--- src/profile.vala 2013-09-23 15:22:08 +0000
63+++ src/profile.vala 2013-10-10 20:02:22 +0000
64@@ -107,6 +107,18 @@
65 /// Actions
66 ///
67
68+ protected Action create_supported_action (Bluetooth bluetooth)
69+ {
70+ var action = new SimpleAction.stateful ("bluetooth-supported",
71+ null,
72+ bluetooth.supported);
73+
74+ bluetooth.notify["supported"].connect (()
75+ => action.set_state (bluetooth.supported));
76+
77+ return action;
78+ }
79+
80 protected Action create_enabled_action (Bluetooth bluetooth)
81 {
82 var action = new SimpleAction.stateful ("bluetooth-enabled",

Subscribers

People subscribed via source and target branches