| 97 | } |
| 98 | |
| 99 | void QmitkToolSelectionBox::SetToolManager( |
| 100 | mitk::ToolManager &newManager) // no nullptr pointer allowed here, a manager is required |
| 101 | { |
| 102 | // say bye to the old manager |
| 103 | m_ToolManager->ActiveToolChanged -= |
| 104 | mitk::MessageDelegate<QmitkToolSelectionBox>(this, &QmitkToolSelectionBox::OnToolManagerToolModified); |
| 105 | m_ToolManager->ReferenceDataChanged -= |
| 106 | mitk::MessageDelegate<QmitkToolSelectionBox>(this, &QmitkToolSelectionBox::OnToolManagerReferenceDataModified); |
| 107 | m_ToolManager->WorkingDataChanged -= |
| 108 | mitk::MessageDelegate<QmitkToolSelectionBox>(this, &QmitkToolSelectionBox::OnToolManagerWorkingDataModified); |
| 109 | |
| 110 | if (QWidget::isEnabled()) |
| 111 | { |
| 112 | m_ToolManager->UnregisterClient(); |
| 113 | } |
| 114 | |
| 115 | m_ToolManager = &newManager; |
| 116 | RecreateButtons(); |
| 117 | |
| 118 | // greet the new one |
| 119 | m_ToolManager->ActiveToolChanged += |
| 120 | mitk::MessageDelegate<QmitkToolSelectionBox>(this, &QmitkToolSelectionBox::OnToolManagerToolModified); |
| 121 | m_ToolManager->ReferenceDataChanged += |
| 122 | mitk::MessageDelegate<QmitkToolSelectionBox>(this, &QmitkToolSelectionBox::OnToolManagerReferenceDataModified); |
| 123 | m_ToolManager->WorkingDataChanged += |
| 124 | mitk::MessageDelegate<QmitkToolSelectionBox>(this, &QmitkToolSelectionBox::OnToolManagerWorkingDataModified); |
| 125 | |
| 126 | if (QWidget::isEnabled()) |
| 127 | { |
| 128 | m_ToolManager->RegisterClient(); |
| 129 | } |
| 130 | |
| 131 | // ask the new one what the situation is like |
| 132 | SetOrUnsetButtonForActiveTool(); |
| 133 | } |
| 134 | |
| 135 | void QmitkToolSelectionBox::toolButtonClicked(int id) |
| 136 | { |
nothing calls this directly
no test coverage detected