~indicator-applet-developers/indicator-bluetooth/trunk.14.10

« back to all changes in this revision

Viewing changes to src/desktop.vala

  • Committer: Tarmac
  • Author(s): Charles Kerr
  • Date: 2013-10-15 16:12:42 UTC
  • mfrom: (68.2.5 lp-1236249)
  • Revision ID: tarmac-20131015161242-kbzk76chx3ep8dg8
When the user chooses to toggle bluetooth on or off, if /dev/rfkill isn't available, fall back to toggling org.bluez.Adapter's Powered property. Fixes: https://bugs.launchpad.net/bugs/1230275, https://bugs.launchpad.net/bugs/1236249.

Approved by Ted Gould, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
 
67
67
    // know when to show the indicator & when to hide it
68
68
    settings.changed["visible"].connect (()=> update_visibility());
69
 
    bluetooth.notify.connect (() => update_visibility());
 
69
    bluetooth.notify["enabled"].connect (() => update_visibility());
70
70
    update_visibility ();
71
71
 
72
72
    // when devices change, rebuild our device section
82
82
 
83
83
  void update_visibility ()
84
84
  {
85
 
    visible = bluetooth.powered && !bluetooth.blocked && settings.get_boolean("visible");
 
85
    visible = bluetooth.enabled && settings.get_boolean("visible");
86
86
  }
87
87
 
88
88
  ///
229
229
    bluetooth.notify["discoverable"].connect (()
230
230
        => action.set_state (bluetooth.discoverable));
231
231
 
232
 
    action.set_enabled (bluetooth.powered);
233
 
    bluetooth.notify["powered"].connect (()
234
 
        => action.set_enabled (bluetooth.powered));
235
 
 
236
232
    return action;
237
233
  }
238
234