GNOME Bugzilla – Bug 719341
Stop using gnome-bluetooth-applet
Last modified: 2013-11-30 13:10:00 UTC
The Bluetooth part of the system status has shrunk in 3.10, and Bluetooth support is now built on top of BlueZ 5, so that it might not make sense to use a helper anymore. 1. Killswitch support would use the Bluetooth rfkill support in gnome-settings-daemon (bug 719339) 2. Authorisation support (notifications) would be removed so that only the Bluetooth panel handles those. 3. The number of connected devices can be gathered through the properties of each device listed in the BlueZ ObjectManager for devices.
Created attachment 262857 [details] [review] bluetooth: Remove pairing agent We'll only have it in the Bluetooth settings panel.
Created attachment 262858 [details] [review] bluetooth: Use g-s-d to turn off Bluetooth
Created attachment 262859 [details] [review] bluetooth: Use BluetoothClient to detect connected devices Instead of the GnomeBluetoothApplet helper.
Created attachment 262860 [details] [review] bluetooth: Remove GnomeBluetoothApplet hacks
Review of attachment 262860 [details] [review]: OK.
Review of attachment 262857 [details] [review]: Looks OK, minus the change to gvc.
Created attachment 262861 [details] [review] bluetooth: Remove pairing agent We'll only have it in the Bluetooth settings panel.
Review of attachment 262858 [details] [review]: ::: js/ui/status/bluetooth.js @@ +37,3 @@ + Lang.bind(this, function(proxy, error) { + if (error) { + log(error.message); logError(error, "Could not connect to RFKill");
Review of attachment 262861 [details] [review]: Yep.
(In reply to comment #8) > Review of attachment 262858 [details] [review]: > > ::: js/ui/status/bluetooth.js > @@ +37,3 @@ > + Lang.bind(this, function(proxy, > error) { > + if (error) { > + log(error.message); > > logError(error, "Could not connect to RFKill"); It's the same code as in rfkill.js, should we change it there as well?
Review of attachment 262859 [details] [review]: Ugh. I'm not so happy about using a GtkTreeModel from unrelated bluetooth code, but I suppose that's the library's problem, not ours.
(In reply to comment #10) > > logError(error, "Could not connect to RFKill"); > > It's the same code as in rfkill.js, should we change it there as well? Land this as-is, then, and I'll do a followup to change it in both places.
Created attachment 262880 [details] [review] bluetooth: Use g-s-d to turn off Bluetooth
Created attachment 262881 [details] [review] bluetooth: Use BluetoothClient to detect connected devices Instead of the GnomeBluetoothApplet helper.
Comment on attachment 262880 [details] [review] bluetooth: Use g-s-d to turn off Bluetooth Just a single missing imports, so marking as acn as the original patch.
Review of attachment 262881 [details] [review]: ::: js/ui/status/bluetooth.js @@ +64,3 @@ + let [ret, iter] = this._model.get_iter_first(); + let nDevices = 0; + while (ret) { I think this would be easier to read split into two methods: _getNConnectedDevices, and _getDefaultAdapter: _getDefaultAdapter: function() { let [ret, iter] = this._model.get_iter_first(); while (ret) { let isDefault = this._model.get_value(iter, GnomeBluetooth.Column.DEFAULT); if (isDefault) return iter; ret = this._model.iter_next(iter); } return iter; }, _getNConnectedDevices: function() { let adapter = this._getDefaultAdapter(); if (!adapter) return 0; let nDevices = 0; let [ret, iter] = this._model.iter_children(adapter); while (ret) { let isConnected = this._model.get_value(iter, GnomeBluetooth.Column.CONNECTED); if (isConnected) nDevices++; ret = this._model.iter_next(iter); } return nDevices; },
Created attachment 262885 [details] [review] bluetooth: Use BluetoothClient to detect connected devices Instead of the GnomeBluetoothApplet helper.
Review of attachment 262885 [details] [review]: Looks good.
Attachment 262860 [details] pushed as ebc15e6 - bluetooth: Remove GnomeBluetoothApplet hacks Attachment 262861 [details] pushed as abf7c33 - bluetooth: Remove pairing agent Attachment 262880 [details] pushed as 981a536 - bluetooth: Use g-s-d to turn off Bluetooth Attachment 262885 [details] pushed as 85f2d94 - bluetooth: Use BluetoothClient to detect connected devices
*** Bug 672782 has been marked as a duplicate of this bug. ***