properly handle tree re-selection when removing a receiver

This commit is contained in:
Daniel Pavel 2013-06-23 18:35:23 +02:00
parent 422cd26b92
commit dc59c79bd3
1 changed files with 10 additions and 1 deletions

View File

@ -356,7 +356,16 @@ def _find_selected_device_id():
def _device_selected(selection):
model, item = selection.get_selected()
device = model.get_value(item, _COLUMN.DEVICE) if item else None
_update_info_panel(device, full=True)
# if _log.isEnabledFor(_DEBUG):
# _log.debug("window tree selected device %s", device)
if device:
_update_info_panel(device, full=True)
else:
# When removing a receiver, one of its children may get automatically selected
# before the tree had time to remove them as well.
# Rather than chase around for another device to select, just clear the selection.
_tree.get_selection().unselect_all()
_update_info_panel(None, full=True)
def _receiver_row(receiver_path, receiver=None):