Skip to content

Commit

Permalink
xfce-bluetooth: start scanning when window opens
Browse files Browse the repository at this point in the history
  • Loading branch information
ncopa committed Sep 21, 2018
1 parent 6f5e2a9 commit 2ccd497
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/xfce-bluetooth.vala
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,18 @@ public class XfceBluetoothApp : GLib.Object {
private void set_powered(bool state) {
adapter.powered = state;
set_discoverable(state);
set_scanning(state);
set_widgets_sensibility();
}

private void set_scanning(bool state) {
if (state) {
adapter.start_discovery();
} else {
adapter.stop_discovery();
}
}

private void build_ui() {
Builder builder = new Builder();
try {
Expand Down Expand Up @@ -206,6 +215,7 @@ public class XfceBluetoothApp : GLib.Object {

device_treeview.get_selection().changed.connect(on_device_selection_changed);
set_discoverable(true);
set_scanning(true);
set_widgets_sensibility();
} catch (Error e) {
stderr.printf("%s\n", e.message);
Expand Down

0 comments on commit 2ccd497

Please sign in to comment.