Hi, this is not a direct solution but based on my own experiences I strongly recommend not to integrate the Data Manager into a view's logic if possible. There are countless pitfalls and surprising state changes you have to be aware of and you can't control. Even worse, due to changes in the code base, the logic of other plugins or the Data Manager changes over time and you would have to adapt without knowing that you have to. The segmentation view is unfortunately a negative example as many (!) lines of code in its implementation do nothing but to try to act proberly based on selections. This really caused a lot of bugs in the past and I'm sure there are still a few minor ones left.
A more simple and cleaner solution would be to *only* use QmitkDataStorageComboBoxes in your view for data selection and to listen to their OnSelectionChanged signal. You can graft a predicate to restrict the available combo box items to certain data nodes, e.g., segmentation images which are not a helper object. The QmitkDataStorageComboBox is aware of Data Manager changes, e.g. when nodes are removed and so on. Best, Stefan ________________________________________ Von: Rostislav Khlebnikov [[email protected]] Gesendet: Dienstag, 25. März 2014 16:34 An: [email protected] Betreff: [mitk-users] OnSelectionChanged when DataManager is not active Hello, I have a small problem with selecting the nodes from within the application. I create data node similar to segmentation view and I can instruct the datamanager to select the newly created node by calling SetDataManagerSelection method. However, I have some other views depending on the current selection and the OnSelectionChanged is not called on any of views until the Data Manager view is focused. I have also tried to use FireNodeSelected method, but the results are the same. It seems to me that this bug http://bugs.mitk.org/show_bug.cgi?id=16081 refers to exactly the same behaviour. So, the question is if there is a way to force the call of OnSelectionChanged() when the Data Manager view is not active. Or perhaps there is some workaround for this? All best, Rostislav. ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users
