Page MenuHomePhabricator

Pull request 212: Make Data Manager's color button work on multi-selections
Closed, ResolvedPublic

Description

Please consider integration of pull request 212: https://github.com/MITK/MITK/pull/212

Modified code to handle selections of multiple nodes.
Also needed to change registration of corrsponding action as "batch action".

Event Timeline

The changes seem reasonable for me, but the button does not appear if multiple Pic3Ds are loaded and selected, I am going to check out why.

Ok, the reason seems to be that

QmitkNodeDescriptor *QmitkNodeDescriptorManager::GetDescriptor(const mitk::DataNode *_Node) const

returns a "NoneBinaryImage" nodes descriptor instead of an "Image" node descriptor. When I add that descriptor to

void QmitkDataManagerView::CreateQtPartControl(QWidget* parent)

The color button appears.

Just a quick note:

QList<QAction *> QmitkNodeDescriptorManager::GetActions(const mitk::DataNode *_Node) const

will return all actions for all applicable descriptors, whereas

QList<QAction *> QmitkNodeDescriptorManager::GetActions(const QList<mitk::DataNode::Pointer> &_Nodes) const

will only return all actions for the last applicable descriptor.

goch claimed this task.

Merged.
@maleike are my changes working for you?