Add disconnect/re-connect in tray menu and fix wrong status when adapter changes

Review Request #120372 - Created Sept. 25, 2014 and submitted

Information
Xuetian Weng
bluedevil
master
Reviewers
bluedevil
afiestas
  1. Add "re-connect" and "disconnect" actions to device just like kcm
  2. Disconnect all signals for adapter and devices in offlineMode in order to avoid multiple connection
  3. use poweredChanged to populate the adapter status change and remove some redundant calls to regenerateConnectedDevice() and regenerateDeviceEntries(). Before this change, when I suspend the laptop, bluetooth device automatically go powered off (an unrelated issue), but the status might become "No adaptors found", while it should be "Turn bluetooth On". This is because adapterChanged() will only do update inside offlineMode(), and regenerateDeviceEntries() is not called in this case. To make it more consistent, all state populate function call are removed from onlineMode and moved to the function call onlineMode() and offlineMode().

Re-connect and disconnect works, and menu and tray is updated correctly when device get connected and disconnected.

Xuetian Weng
Àlex Fiestas
Xuetian Weng
Review request changed

Status: Closed (submitted)

Loading...