Page MenuHomePhabricator

OnSelectionChanged event is not fired when the data manager isn't focused
Closed, InvalidPublic

Description

In my plugin I have a view (based on QmitkAbstractView) that relies on the OnSelectionChanged event to know if there is anything selected or not.
This works fine, however when the focus is not on the data manager (but on the plugin for example) and i click "close project" to remove all images, the OnSelectionChanged method in my view does not get called. I assume the event is never even fired.

Event Timeline

I guess what is going on is that the datamanager is not selected when the project is closed. The current selection always refers to the currently focused view, so when closing the project, the OnSelectionChanged event is not triggered because the selection of the current view has not changed.

In you specific case, if you are holding on to a previously selected node in the datamanager, you need to listen to "Delete" events of that specific node. This also accounts for situations where to node is deleted by someone else without directly modifying the selection.

kislinsk changed the task status from Invalid to Spite.Jun 27 2018, 1:30 PM
kislinsk added a project: Bulk Edit.
kislinsk changed the task status from Spite to Invalid.Jun 27 2018, 1:36 PM
kislinsk removed a project: Bulk Edit.