diff --git a/Plugins/org.mitk.gui.qt.common/files.cmake b/Plugins/org.mitk.gui.qt.common/files.cmake
index bb57973a0e..fc46816c35 100755
--- a/Plugins/org.mitk.gui.qt.common/files.cmake
+++ b/Plugins/org.mitk.gui.qt.common/files.cmake
@@ -1,67 +1,46 @@
set(SRC_CPP_FILES
QmitkAbstractMultiWidgetEditor.cpp
QmitkAbstractRenderEditor.cpp
QmitkAbstractView.cpp
QmitkDataNodeSelectionProvider.cpp
QmitkDnDFrameWidget.cpp
QmitkSelectionServiceConnector.cpp
QmitkSliceNavigationListener.cpp
- QmitkSingleNodeSelectionWidget.cpp
- QmitkNodeSelectionDialog.cpp
- QmitkMultiNodeSelectionWidget.cpp
QmitkMultiWidgetDecorationManager.cpp
- QmitkNodeSelectionPreferenceHelper.cpp
- QmitkNodeSelectionButton.cpp
)
set(INTERNAL_CPP_FILES
QmitkCommonActivator.cpp
QmitkDataNodeItemModel.cpp
QmitkDataNodeSelection.cpp
QmitkViewCoordinator.cpp
- QmitkNodeSelectionConstants.cpp
QmitkNodeSelectionPreferencePage.cpp
- QmitkNodeSelectionListItemWidget.cpp
)
set(UI_FILES
- src/QmitkSingleNodeSelectionWidget.ui
- src/QmitkMultiNodeSelectionWidget.ui
- src/QmitkNodeSelectionDialog.ui
src/internal/QmitkNodeSelectionPreferencePage.ui
- src/internal/QmitkNodeSelectionListItemWidget.ui
)
set(MOC_H_FILES
src/QmitkAbstractMultiWidgetEditor.h
src/QmitkAbstractRenderEditor.h
src/QmitkDnDFrameWidget.h
src/QmitkSelectionServiceConnector.h
src/QmitkSliceNavigationListener.h
- src/QmitkSingleNodeSelectionWidget.h
- src/QmitkNodeSelectionDialog.h
- src/QmitkMultiNodeSelectionWidget.h
- src/QmitkNodeSelectionButton.h
src/internal/QmitkCommonActivator.h
src/internal/QmitkNodeSelectionPreferencePage.h
- src/internal/QmitkNodeSelectionListItemWidget.h
)
set(CACHED_RESOURCE_FILES
plugin.xml
- resources/times.svg
-)
-
-set(QRC_FILES
- resources/common.qrc
)
set(CPP_FILES )
foreach(file ${SRC_CPP_FILES})
set(CPP_FILES ${CPP_FILES} src/${file})
endforeach(file ${SRC_CPP_FILES})
foreach(file ${INTERNAL_CPP_FILES})
set(CPP_FILES ${CPP_FILES} src/internal/${file})
endforeach(file ${INTERNAL_CPP_FILES})
diff --git a/Plugins/org.mitk.gui.qt.common/resources/common.qrc b/Plugins/org.mitk.gui.qt.common/resources/common.qrc
deleted file mode 100644
index e7959f2329..0000000000
--- a/Plugins/org.mitk.gui.qt.common/resources/common.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- times.svg
-
-
diff --git a/Plugins/org.mitk.gui.qt.common/resources/icon-license.txt b/Plugins/org.mitk.gui.qt.common/resources/icon-license.txt
deleted file mode 100644
index 167ecb6def..0000000000
--- a/Plugins/org.mitk.gui.qt.common/resources/icon-license.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-See [Font Awsome 4] in Licenses/ICONS.md for:
-- times.svg
\ No newline at end of file
diff --git a/Plugins/org.mitk.gui.qt.common/resources/times.svg b/Plugins/org.mitk.gui.qt.common/resources/times.svg
deleted file mode 100644
index fdb8c5c03b..0000000000
--- a/Plugins/org.mitk.gui.qt.common/resources/times.svg
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkMultiNodeSelectionWidget.cpp b/Plugins/org.mitk.gui.qt.common/src/QmitkMultiNodeSelectionWidget.cpp
deleted file mode 100644
index ecae1b05e3..0000000000
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkMultiNodeSelectionWidget.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-/*============================================================================
-
-The Medical Imaging Interaction Toolkit (MITK)
-
-Copyright (c) German Cancer Research Center (DKFZ)
-All rights reserved.
-
-Use of this source code is governed by a 3-clause BSD license that can be
-found in the LICENSE file.
-
-============================================================================*/
-
-#include "QmitkMultiNodeSelectionWidget.h"
-
-#include
-
-#include "QmitkNodeSelectionDialog.h"
-#include "QmitkCustomVariants.h"
-#include "internal/QmitkNodeSelectionListItemWidget.h"
-
-QmitkMultiNodeSelectionWidget::QmitkMultiNodeSelectionWidget(QWidget* parent)
- : QmitkAbstractNodeSelectionWidget(parent)
-{
- m_Controls.setupUi(this);
- m_Overlay = new QmitkSimpleTextOverlayWidget(m_Controls.list);
- m_Overlay->setVisible(false);
- m_CheckFunction = [](const NodeList &) { return ""; };
-
- this->OnInternalSelectionChanged();
- this->UpdateInfo();
-
- connect(m_Controls.btnChange, SIGNAL(clicked(bool)), this, SLOT(OnEditSelection()));
-}
-
-void QmitkMultiNodeSelectionWidget::SetSelectionCheckFunction(const SelectionCheckFunctionType &checkFunction)
-{
- m_CheckFunction = checkFunction;
-
- auto newEmission = this->CompileEmitSelection();
- auto newCheckResponse = m_CheckFunction(newEmission);
-
- if (newCheckResponse.empty() && !m_CheckResponse.empty())
- {
- this->EmitSelection(newEmission);
- }
- m_CheckResponse = newCheckResponse;
- this->UpdateInfo();
-}
-
-void QmitkMultiNodeSelectionWidget::OnEditSelection()
-{
- QmitkNodeSelectionDialog* dialog = new QmitkNodeSelectionDialog(this, m_PopUpTitel, m_PopUpHint);
-
- dialog->SetDataStorage(m_DataStorage.Lock());
- dialog->SetNodePredicate(m_NodePredicate);
- dialog->SetCurrentSelection(this->CompileEmitSelection());
- dialog->SetSelectOnlyVisibleNodes(m_SelectOnlyVisibleNodes);
- dialog->SetSelectionMode(QAbstractItemView::MultiSelection);
- dialog->SetSelectionCheckFunction(m_CheckFunction);
-
- m_Controls.btnChange->setChecked(true);
- if (dialog->exec())
- {
- this->HandleChangeOfInternalSelection(dialog->GetSelectedNodes());
- }
- m_Controls.btnChange->setChecked(false);
-
- delete dialog;
-}
-
-void QmitkMultiNodeSelectionWidget::UpdateInfo()
-{
- if (!m_Controls.list->count())
- {
- if (m_IsOptional)
- {
- if (this->isEnabled())
- {
- m_Overlay->SetOverlayText(QStringLiteral("") + m_EmptyInfo + QStringLiteral(""));
- }
- else
- {
- m_Overlay->SetOverlayText(QStringLiteral("") + m_EmptyInfo + QStringLiteral(""));
- }
- }
- else
- {
- if (this->isEnabled())
- {
- m_Overlay->SetOverlayText(QStringLiteral("") + m_InvalidInfo + QStringLiteral(""));
- }
- else
- {
- m_Overlay->SetOverlayText(QStringLiteral("") + m_InvalidInfo + QStringLiteral(""));
- }
- }
- }
- else
- {
- if (!m_CheckResponse.empty())
- {
- m_Overlay->SetOverlayText(QString::fromStdString(m_CheckResponse));
- }
- }
-
- m_Overlay->setVisible(m_Controls.list->count() == 0 || !m_CheckResponse.empty());
-
- for (auto i = 0; i < m_Controls.list->count(); ++i)
- {
- auto item = m_Controls.list->item(i);
- auto widget = qobject_cast(m_Controls.list->itemWidget(item));
- widget->SetClearAllowed(m_IsOptional || m_Controls.list->count() > 1);
- }
-}
-
-void QmitkMultiNodeSelectionWidget::OnInternalSelectionChanged()
-{
- m_Controls.list->clear();
- auto currentSelection = this->GetCurrentInternalSelection();
- for (auto& node : currentSelection)
- {
- if (m_NodePredicate.IsNull() || m_NodePredicate->CheckNode(node))
- {
- QListWidgetItem *newItem = new QListWidgetItem;
-
- newItem->setSizeHint(QSize(0, 40));
- QmitkNodeSelectionListItemWidget* widget = new QmitkNodeSelectionListItemWidget;
-
- widget->SetSelectedNode(node);
- widget->SetClearAllowed(m_IsOptional || currentSelection.size() > 1);
-
- connect(widget, &QmitkNodeSelectionListItemWidget::ClearSelection, this, &QmitkMultiNodeSelectionWidget::OnClearSelection);
- newItem->setData(Qt::UserRole, QVariant::fromValue(node));
-
- m_Controls.list->addItem(newItem);
- m_Controls.list->setItemWidget(newItem, widget);
- }
- }
-}
-
-void QmitkMultiNodeSelectionWidget::OnClearSelection(const mitk::DataNode* node)
-{
- this->RemoveNodeFromSelection(node);
-}
-
-void QmitkMultiNodeSelectionWidget::changeEvent(QEvent *event)
-{
- if (event->type() == QEvent::EnabledChange)
- {
- this->UpdateInfo();
- }
- QmitkAbstractNodeSelectionWidget::changeEvent(event);
-}
-
-bool QmitkMultiNodeSelectionWidget::AllowEmissionOfSelection(const NodeList& emissionCandidates) const
-{
- m_CheckResponse = m_CheckFunction(emissionCandidates);
- return m_CheckResponse.empty();
-}
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkMultiNodeSelectionWidget.h b/Plugins/org.mitk.gui.qt.common/src/QmitkMultiNodeSelectionWidget.h
deleted file mode 100644
index d490574f32..0000000000
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkMultiNodeSelectionWidget.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*============================================================================
-
-The Medical Imaging Interaction Toolkit (MITK)
-
-Copyright (c) German Cancer Research Center (DKFZ)
-All rights reserved.
-
-Use of this source code is governed by a 3-clause BSD license that can be
-found in the LICENSE file.
-
-============================================================================*/
-
-#ifndef QMITK_MULTI_NODE_SELECTION_WIDGET_H
-#define QMITK_MULTI_NODE_SELECTION_WIDGET_H
-
-#include
-#include
-#include
-
-#include "QmitkSimpleTextOverlayWidget.h"
-
-#include "org_mitk_gui_qt_common_Export.h"
-
-#include "ui_QmitkMultiNodeSelectionWidget.h"
-
-#include
-
-class QmitkAbstractDataStorageModel;
-
-/**
-* @class QmitkMultiNodeSelectionWidget
-* @brief Widget that allows to perform and represents a multiple node selection.
-*/
-class MITK_QT_COMMON QmitkMultiNodeSelectionWidget : public QmitkAbstractNodeSelectionWidget
-{
- Q_OBJECT
-
-public:
- explicit QmitkMultiNodeSelectionWidget(QWidget* parent = nullptr);
-
- using NodeList = QmitkAbstractNodeSelectionWidget::NodeList;
-
- /**
- * @brief Helper function that is used to check the given selection for consistency.
- * Returning an empty string assumes that everything is alright and the selection
- * is valid. If the string is not empty, the content of the string will be used
- * as error message in the overlay to indicate the problem.
- */
- using SelectionCheckFunctionType = std::function;
- /**
- * @brief A selection check function can be set. If set the widget uses this function to
- * check the made/set selection. If the selection is valid, everything is fine.
- * If selection is indicated as invalid, it will not be communicated by the widget
- * (no signal emission).
- */
- void SetSelectionCheckFunction(const SelectionCheckFunctionType &checkFunction);
-
-public Q_SLOTS:
- void OnEditSelection();
-
-protected Q_SLOTS:
- void OnClearSelection(const mitk::DataNode* node);
-
-protected:
- void changeEvent(QEvent *event) override;
-
- void UpdateInfo() override;
- void OnInternalSelectionChanged() override;
-
- bool AllowEmissionOfSelection(const NodeList& emissionCandidates) const override;
-
- QmitkSimpleTextOverlayWidget* m_Overlay;
-
- SelectionCheckFunctionType m_CheckFunction;
- mutable std::string m_CheckResponse;
-
- Ui_QmitkMultiNodeSelectionWidget m_Controls;
-};
-
-#endif // QMITK_MULTI_NODE_SELECTION_WIDGET_H
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkMultiNodeSelectionWidget.ui b/Plugins/org.mitk.gui.qt.common/src/QmitkMultiNodeSelectionWidget.ui
deleted file mode 100644
index 172db00d55..0000000000
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkMultiNodeSelectionWidget.ui
+++ /dev/null
@@ -1,85 +0,0 @@
-
-
- QmitkMultiNodeSelectionWidget
-
-
-
- 0
- 0
- 391
- 265
-
-
-
- Form
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
- -
-
-
- QAbstractItemView::NoEditTriggers
-
-
- false
-
-
- QAbstractItemView::NoDragDrop
-
-
- Qt::MoveAction
-
-
- QAbstractItemView::NoSelection
-
-
-
-
- 1
-
-
- -
-
- 2
-
-
- -
-
- 3
-
-
- -
-
- 4
-
-
-
-
- -
-
-
- Change selection
-
-
- true
-
-
-
-
-
-
-
-
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionButton.cpp b/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionButton.cpp
deleted file mode 100644
index aad227179e..0000000000
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionButton.cpp
+++ /dev/null
@@ -1,281 +0,0 @@
-/*============================================================================
-
-The Medical Imaging Interaction Toolkit (MITK)
-
-Copyright (c) German Cancer Research Center (DKFZ)
-All rights reserved.
-
-Use of this source code is governed by a 3-clause BSD license that can be
-found in the LICENSE file.
-
-============================================================================*/
-
-#include "QmitkNodeSelectionButton.h"
-
-// mitk core
-#include
-#include
-#include
-#include
-#include
-
-// mitk qt widgets module
-#include
-
-// berry includes
-#include
-#include
-
-#include
-
-#include
-#include
-#include
-
-QPixmap GetPixmapFromImageNode(const mitk::DataNode* dataNode, int height)
-{
- if (nullptr == dataNode)
- {
- return QPixmap();
- }
-
- const mitk::Image* image = dynamic_cast(dataNode->GetData());
- if ((nullptr == image || !image->IsInitialized()) || // -> must be an image
- (image->GetPixelType().GetNumberOfComponents() != 1)) // -> for now only single component are allowed
- {
- auto descManager = QmitkNodeDescriptorManager::GetInstance();
- auto desc = descManager->GetDescriptor(dataNode);
- auto icon = desc->GetIcon(dataNode);
- auto fallBackMap = icon.pixmap(height, height);
- return fallBackMap;
- }
-
- mitk::PlaneGeometry::Pointer planeGeometry = mitk::PlaneGeometry::New();
- int sliceNumber = image->GetDimension(2) / 2;
- planeGeometry->InitializeStandardPlane(image->GetGeometry(), mitk::AnatomicalPlane::Axial, sliceNumber);
-
- mitk::ExtractSliceFilter::Pointer extractSliceFilter = mitk::ExtractSliceFilter::New();
- extractSliceFilter->SetInput(image);
- extractSliceFilter->SetInterpolationMode(mitk::ExtractSliceFilter::RESLICE_CUBIC);
- extractSliceFilter->SetResliceTransformByGeometry(image->GetGeometry());
- extractSliceFilter->SetWorldGeometry(planeGeometry);
- extractSliceFilter->SetOutputDimensionality(2);
- extractSliceFilter->SetVtkOutputRequest(true);
- extractSliceFilter->Update();
-
- vtkImageData* imageData = extractSliceFilter->GetVtkOutput();
-
- mitk::LevelWindow levelWindow;
- dataNode->GetLevelWindow(levelWindow);
- vtkSmartPointer lookupTable = vtkSmartPointer::New();
- lookupTable->SetRange(levelWindow.GetLowerWindowBound(), levelWindow.GetUpperWindowBound());
- lookupTable->SetSaturationRange(0.0, 0.0);
- lookupTable->SetValueRange(0.0, 1.0);
- lookupTable->SetHueRange(0.0, 0.0);
- lookupTable->SetRampToLinear();
-
- vtkSmartPointer levelWindowFilter = vtkSmartPointer::New();
- levelWindowFilter->SetLookupTable(lookupTable);
- levelWindowFilter->SetInputData(imageData);
- levelWindowFilter->SetMinOpacity(0.0);
- levelWindowFilter->SetMaxOpacity(1.0);
- int dims[3];
- imageData->GetDimensions(dims);
- double clippingBounds[] = { 0.0, static_cast(dims[0]), 0.0, static_cast(dims[1]) };
- levelWindowFilter->SetClippingBounds(clippingBounds);
- levelWindowFilter->Update();
- imageData = levelWindowFilter->GetOutput();
-
- QImage thumbnailImage(reinterpret_cast(imageData->GetScalarPointer()), dims[0], dims[1], QImage::Format_ARGB32);
-
- if (dims[0] > dims[1])
- {
- thumbnailImage = thumbnailImage.scaledToWidth(height, Qt::SmoothTransformation).rgbSwapped();
- }
- else
- {
- thumbnailImage = thumbnailImage.scaledToHeight(height, Qt::SmoothTransformation).rgbSwapped();
- }
-
- return QPixmap::fromImage(thumbnailImage);
-}
-
-QmitkNodeSelectionButton::QmitkNodeSelectionButton(QWidget *parent)
- : QPushButton(parent)
- , m_OutDatedThumbNail(true)
- , m_DataMTime(0)
- , m_IsOptional(true)
- , m_NodeModifiedObserverTag(0)
- , m_NodeObserved(false)
-{
-}
-
-QmitkNodeSelectionButton::~QmitkNodeSelectionButton()
-{
- this->RemoveNodeObserver();
- this->m_SelectedNode = nullptr;
-}
-
-void QmitkNodeSelectionButton::AddNodeObserver()
-{
- if (this->m_SelectedNode.IsNotNull())
- {
- if (m_NodeObserved)
- {
- MITK_DEBUG << "Invalid observer state in QmitkNodeSelectionButton. There is already a registered observer. Internal logic is not correct. May be an old observer was not removed.";
- }
-
- auto modifiedCommand = itk::MemberCommand::New();
- modifiedCommand->SetCallbackFunction(this, &QmitkNodeSelectionButton::OnNodeModified);
-
- // const cast because we need non const nodes and it seems to be the lesser of two evil.
- // the changes to the node are only on the observer level. The other option would be to
- // make the public interface require non const nodes, this we don't want to introduce.
- auto nonconst_node = const_cast(this->m_SelectedNode.GetPointer());
- m_NodeModifiedObserverTag = nonconst_node->AddObserver(itk::ModifiedEvent(), modifiedCommand);
- m_NodeObserved = true;
- }
-}
-
-void QmitkNodeSelectionButton::RemoveNodeObserver()
-{
- if (this->m_SelectedNode.IsNotNull())
- {
- // const cast because we need non const nodes and it seems to be the lesser of two evil.
- // the changes to the node are only on the observer level. The other option would be to
- // make the public interface require non const nodes, this we don't want to introduce.
- auto nonconst_node = const_cast(this->m_SelectedNode.GetPointer());
- nonconst_node->RemoveObserver(m_NodeModifiedObserverTag);
- }
- m_NodeObserved = false;
-}
-
-void QmitkNodeSelectionButton::OnNodeModified(const itk::Object * /*caller*/, const itk::EventObject & event)
-{
- if (itk::ModifiedEvent().CheckEvent(&event))
- {
- this->update();
- }
-}
-
-const mitk::DataNode* QmitkNodeSelectionButton::GetSelectedNode() const
-{
- return m_SelectedNode;
-}
-
-void QmitkNodeSelectionButton::SetSelectedNode(const mitk::DataNode* node)
-{
- if (m_SelectedNode != node)
- {
- this->RemoveNodeObserver();
- this->m_SelectedNode = node;
- this->m_OutDatedThumbNail = true;
- this->AddNodeObserver();
- }
-
- this->update();
-}
-
-void QmitkNodeSelectionButton::SetNodeInfo(QString info)
-{
- this->m_Info = info;
- this->update();
-}
-
-void QmitkNodeSelectionButton::paintEvent(QPaintEvent *p)
-{
- QString stylesheet;
-
- ctkPluginContext* context = berry::WorkbenchPlugin::GetDefault()->GetPluginContext();
- ctkServiceReference styleManagerRef = context->getServiceReference();
- if (styleManagerRef)
- {
- auto styleManager = context->getService(styleManagerRef);
- stylesheet = styleManager->GetStylesheet();
- }
-
- QPushButton::paintEvent(p);
-
- QPainter painter(this);
- QTextDocument td(this);
- td.setDefaultStyleSheet(stylesheet);
-
- auto widgetSize = this->size();
- QPoint origin = QPoint(5, 5);
-
- if (this->m_SelectedNode)
- {
- auto iconLength = widgetSize.height() - 10;
- auto node = this->m_SelectedNode;
-
- itk::ModifiedTimeType dataMTime = 0;
- if (m_SelectedNode->GetData())
- {
- dataMTime = m_SelectedNode->GetData()->GetMTime();
- }
- if (dataMTime>m_DataMTime || this->m_OutDatedThumbNail)
- {
- this->m_ThumbNail = GetPixmapFromImageNode(node, iconLength);
- this->m_OutDatedThumbNail = false;
- m_DataMTime = dataMTime;
- }
-
- auto thumbNailOrigin = origin;
- thumbNailOrigin.setY(thumbNailOrigin.y() + ((iconLength - m_ThumbNail.height()) / 2));
- painter.drawPixmap(thumbNailOrigin, m_ThumbNail);
- origin.setX(origin.x() + iconLength + 5);
-
- if (this->isEnabled())
- {
- td.setHtml(QString::fromStdString("" + node->GetName() + ""));
- }
- else
- {
- td.setHtml(QString::fromStdString("" + node->GetName() + ""));
- }
- }
- else
- {
- if (this->isEnabled())
- {
- if (this->m_IsOptional)
- {
- td.setHtml(QString("") + m_Info + QString(""));
- }
- else
- {
- td.setHtml(QString("") + m_Info + QString(""));
- }
- }
- else
- {
- td.setHtml(QString("") + m_Info + QString(""));
- }
- }
-
- auto textSize = td.size();
-
- origin.setY( (widgetSize.height() - textSize.height()) / 2.);
-
- painter.translate(origin);
- td.drawContents(&painter);
-}
-
-void QmitkNodeSelectionButton::changeEvent(QEvent *event)
-{
- if (event->type() == QEvent::EnabledChange)
- {
- this->update();
- }
-}
-
-bool QmitkNodeSelectionButton::GetSelectionIsOptional() const
-{
- return m_IsOptional;
-}
-
-void QmitkNodeSelectionButton::SetSelectionIsOptional(bool isOptional)
-{
- m_IsOptional = isOptional;
- this->update();
-}
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionButton.h b/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionButton.h
deleted file mode 100644
index 21d328da1c..0000000000
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionButton.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*============================================================================
-
-The Medical Imaging Interaction Toolkit (MITK)
-
-Copyright (c) German Cancer Research Center (DKFZ)
-All rights reserved.
-
-Use of this source code is governed by a 3-clause BSD license that can be
-found in the LICENSE file.
-
-============================================================================*/
-
-#ifndef QMITK_NODE_SELECTION_BUTTON_H
-#define QMITK_NODE_SELECTION_BUTTON_H
-
-#include "org_mitk_gui_qt_common_Export.h"
-
-#include
-
-#include
-#include
-
-/**
-* @class QmitkNodeSelectionButton
-* @brief Button class that can be used to display information about a given node.
-* If the given node is a nullptr the node info text will be shown.
-* The node info can be formated text (e.g. HTML code; like the tooltip text).
-*/
-class MITK_QT_COMMON QmitkNodeSelectionButton : public QPushButton
-{
- Q_OBJECT
-
-public:
- explicit QmitkNodeSelectionButton(QWidget *parent = nullptr);
- ~QmitkNodeSelectionButton() override;
-
- const mitk::DataNode* GetSelectedNode() const;
- bool GetSelectionIsOptional() const;
-
-public Q_SLOTS:
- virtual void SetSelectedNode(const mitk::DataNode* node);
- virtual void SetNodeInfo(QString info);
-
- /** Set the widget into an optional mode. Optional means that the selection of no valid
- node does not mean an invalid state. Thus no node is a valid "node" selection too.
- The state influences if the info text is handled as an information (optional) or a
- warning (optiona==false).*/
- void SetSelectionIsOptional(bool isOptional);
-
-protected:
- void paintEvent(QPaintEvent *p) override;
- void changeEvent(QEvent *event) override;
-
- void AddNodeObserver();
- void RemoveNodeObserver();
- void OnNodeModified(const itk::Object * /*caller*/, const itk::EventObject &);
-
- mitk::DataNode::ConstPointer m_SelectedNode;
- QString m_Info;
- bool m_OutDatedThumbNail;
- QPixmap m_ThumbNail;
- itk::ModifiedTimeType m_DataMTime;
- itk::ModifiedTimeType m_SelectionPropMTime;
-
- bool m_IsOptional;
-
- unsigned long m_NodeModifiedObserverTag;
- bool m_NodeObserved;
-};
-
-#endif // QMITK_NODE_SELECTION_BUTTON_H
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.cpp b/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.cpp
deleted file mode 100644
index 5c557c42bd..0000000000
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.cpp
+++ /dev/null
@@ -1,293 +0,0 @@
-/*============================================================================
-
-The Medical Imaging Interaction Toolkit (MITK)
-
-Copyright (c) German Cancer Research Center (DKFZ)
-All rights reserved.
-
-Use of this source code is governed by a 3-clause BSD license that can be
-found in the LICENSE file.
-
-============================================================================*/
-
-#include "QmitkNodeSelectionDialog.h"
-
-#include
-
-#include
-#include
-#include
-#include
-
-QmitkNodeSelectionDialog::QmitkNodeSelectionDialog(QWidget* parent, QString title, QString hint)
- : QDialog(parent)
- , m_NodePredicate(nullptr)
- , m_SelectOnlyVisibleNodes(false)
- , m_SelectedNodes(NodeList())
- , m_SelectionMode(QAbstractItemView::SingleSelection)
-{
- m_Controls.setupUi(this);
-
- m_CheckFunction = [](const NodeList &) { return ""; };
-
- auto providers = mitk::DataStorageInspectorGenerator::GetProviders();
- auto visibleProviders = mitk::GetVisibleDataStorageInspectors();
- auto preferredID = mitk::GetPreferredDataStorageInspector();
-
- if (visibleProviders.empty())
- {
- MITK_DEBUG << "No presets for visible node selection inspectors available. Use fallback (show all available inspectors)";
- unsigned int order = 0;
- for (const auto &proIter : providers)
- {
- visibleProviders.insert(std::make_pair(order, proIter.first));
- ++order;
- }
- }
-
- int preferredIndex = 0;
- bool preferredFound = false;
- for (const auto &proIter : visibleProviders)
- {
- auto finding = providers.find(proIter.second);
- if (finding != providers.end())
- {
- if (finding->second->GetInspectorID() != QmitkDataStorageFavoriteNodesInspector::INSPECTOR_ID() && finding->second->GetInspectorID() != QmitkDataStorageSelectionHistoryInspector::INSPECTOR_ID())
- {
- auto provider = finding->second;
- this->AddPanel(provider, preferredID, preferredFound, preferredIndex);
- }
- }
- else
- {
- MITK_DEBUG << "No provider registered for inspector that is defined as visible in the preferences. Illegal inspector ID: " << proIter.second;
- }
- }
-
- if (mitk::GetShowFavoritesInspector())
- {
- auto favoritesPorvider = mitk::DataStorageInspectorGenerator::GetProvider(QmitkDataStorageFavoriteNodesInspector::INSPECTOR_ID());
- if (favoritesPorvider != nullptr)
- {
- this->AddPanel(favoritesPorvider, preferredID, preferredFound, preferredIndex);
- }
- }
-
- if (mitk::GetShowHistoryInspector())
- {
- auto historyPorvider = mitk::DataStorageInspectorGenerator::GetProvider(QmitkDataStorageSelectionHistoryInspector::INSPECTOR_ID());
- if (historyPorvider != nullptr)
- {
- this->AddPanel(historyPorvider, preferredID, preferredFound, preferredIndex);
- }
- }
-
- m_Controls.tabWidget->setCurrentIndex(preferredIndex);
- this->setWindowTitle(title);
- this->setToolTip(hint);
-
- m_Controls.hint->setText(hint);
- m_Controls.hint->setVisible(!hint.isEmpty());
- if(hint.isEmpty())
- {
- m_Controls.layoutHint->setContentsMargins(0, 0, 0, 0);
- }
- else
- {
- m_Controls.layoutHint->setContentsMargins(6, 6, 6, 6);
- }
-
- this->SetErrorText("");
-
- m_Controls.btnAddToFav->setIcon(berry::QtStyleManager::ThemeIcon(QStringLiteral(":/Qmitk/favorite_add.svg")));
-
- connect(m_Controls.btnAddToFav, &QPushButton::clicked, this, &QmitkNodeSelectionDialog::OnFavoriteNodesButtonClicked);
- connect(m_Controls.buttonBox, &QDialogButtonBox::accepted, this, &QmitkNodeSelectionDialog::OnOK);
- connect(m_Controls.buttonBox, &QDialogButtonBox::rejected, this, &QmitkNodeSelectionDialog::OnCancel);
-}
-
-void QmitkNodeSelectionDialog::SetDataStorage(mitk::DataStorage* dataStorage)
-{
- if (m_DataStorage != dataStorage)
- {
- m_DataStorage = dataStorage;
- auto lockedDataStorage = m_DataStorage.Lock();
-
- if (lockedDataStorage.IsNotNull())
- {
- for (auto panel : m_Panels)
- {
- panel->SetDataStorage(lockedDataStorage);
- }
- }
- }
-}
-
-void QmitkNodeSelectionDialog::SetNodePredicate(const mitk::NodePredicateBase* nodePredicate)
-{
- if (m_NodePredicate != nodePredicate)
- {
- m_NodePredicate = nodePredicate;
-
- for (auto panel : m_Panels)
- {
- panel->SetNodePredicate(m_NodePredicate);
- }
- }
-}
-
-const mitk::NodePredicateBase* QmitkNodeSelectionDialog::GetNodePredicate() const
-{
- return m_NodePredicate;
-}
-
-QmitkNodeSelectionDialog::NodeList QmitkNodeSelectionDialog::GetSelectedNodes() const
-{
- return m_SelectedNodes;
-}
-
-void QmitkNodeSelectionDialog::SetSelectionCheckFunction(const SelectionCheckFunctionType &checkFunction)
-{
- m_CheckFunction = checkFunction;
- auto checkResponse = m_CheckFunction(m_SelectedNodes);
-
- SetErrorText(checkResponse);
-
- m_Controls.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(checkResponse.empty());
-}
-
-void QmitkNodeSelectionDialog::SetErrorText(const std::string& checkResponse)
-{
- m_Controls.error->setText(QString::fromStdString(checkResponse));
- m_Controls.error->setVisible(!checkResponse.empty());
- if (checkResponse.empty())
- {
- m_Controls.layoutError->setContentsMargins(0, 0, 0, 0);
- }
- else
- {
- m_Controls.layoutError->setContentsMargins(6, 6, 6, 6);
- }
-}
-
-bool QmitkNodeSelectionDialog::GetSelectOnlyVisibleNodes() const
-{
- return m_SelectOnlyVisibleNodes;
-}
-
-void QmitkNodeSelectionDialog::SetSelectionMode(SelectionMode mode)
-{
- m_SelectionMode = mode;
- for (auto panel : m_Panels)
- {
- panel->SetSelectionMode(mode);
- }
-}
-
-QmitkNodeSelectionDialog::SelectionMode QmitkNodeSelectionDialog::GetSelectionMode() const
-{
- return m_SelectionMode;
-}
-
-void QmitkNodeSelectionDialog::SetSelectOnlyVisibleNodes(bool selectOnlyVisibleNodes)
-{
- if (m_SelectOnlyVisibleNodes != selectOnlyVisibleNodes)
- {
- m_SelectOnlyVisibleNodes = selectOnlyVisibleNodes;
-
- for (auto panel : m_Panels)
- {
- panel->SetSelectOnlyVisibleNodes(m_SelectOnlyVisibleNodes);
- }
- }
-}
-
-void QmitkNodeSelectionDialog::SetCurrentSelection(NodeList selectedNodes)
-{
- m_SelectedNodes = selectedNodes;
- auto checkResponse = m_CheckFunction(m_SelectedNodes);
-
- SetErrorText(checkResponse);
-
- m_Controls.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(checkResponse.empty());
-
- for (auto panel : m_Panels)
- {
- panel->SetCurrentSelection(selectedNodes);
- }
-}
-
-void QmitkNodeSelectionDialog::OnSelectionChanged(NodeList selectedNodes)
-{
- SetCurrentSelection(selectedNodes);
- emit CurrentSelectionChanged(selectedNodes);
-}
-
-void QmitkNodeSelectionDialog::OnFavoriteNodesButtonClicked()
-{
- for (auto node : qAsConst(m_SelectedNodes))
- {
- node->SetBoolProperty("org.mitk.selection.favorite", true);
- }
-}
-
-void QmitkNodeSelectionDialog::OnOK()
-{
- for (const auto &node : qAsConst(m_SelectedNodes))
- {
- QmitkDataStorageSelectionHistoryInspector::AddNodeToHistory(node);
- }
-
- this->accept();
-}
-
-void QmitkNodeSelectionDialog::OnCancel()
-{
- this->reject();
-}
-
-void QmitkNodeSelectionDialog::AddPanel(const mitk::IDataStorageInspectorProvider * provider, const mitk::IDataStorageInspectorProvider::InspectorIDType& preferredID, bool &preferredFound, int &preferredIndex)
-{
- auto inspector = provider->CreateInspector();
- QString name = QString::fromStdString(provider->GetInspectorDisplayName());
- QString desc = QString::fromStdString(provider->GetInspectorDescription());
-
- inspector->setParent(this);
- inspector->SetSelectionMode(m_SelectionMode);
-
- auto tabPanel = new QWidget();
- tabPanel->setObjectName(QString("tab_") + name);
- tabPanel->setToolTip(desc);
-
- auto verticalLayout = new QVBoxLayout(tabPanel);
- verticalLayout->setSpacing(0);
- verticalLayout->setContentsMargins(0, 0, 0, 0);
- verticalLayout->addWidget(inspector);
-
- auto panelPos = m_Controls.tabWidget->insertTab(m_Controls.tabWidget->count(), tabPanel, name);
-
- auto icon = provider->GetInspectorIcon();
- if (!icon.isNull())
- {
- m_Controls.tabWidget->setTabIcon(panelPos, icon);
- }
-
- m_Panels.push_back(inspector);
- connect(inspector, &QmitkAbstractDataStorageInspector::CurrentSelectionChanged, this, &QmitkNodeSelectionDialog::OnSelectionChanged);
- connect(inspector->GetView(), &QAbstractItemView::doubleClicked, this, &QmitkNodeSelectionDialog::OnDoubleClicked);
-
- preferredFound = preferredFound || provider->GetInspectorID() == preferredID;
- if (!preferredFound)
- {
- ++preferredIndex;
- }
-}
-
-void QmitkNodeSelectionDialog::OnDoubleClicked(const QModelIndex& /*index*/)
-{
- const auto isOK = m_Controls.buttonBox->button(QDialogButtonBox::Ok)->isEnabled();
- if (!m_SelectedNodes.empty() && isOK)
- {
- this->OnOK();
- }
-}
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.h b/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.h
deleted file mode 100644
index 217e212b6d..0000000000
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*============================================================================
-
-The Medical Imaging Interaction Toolkit (MITK)
-
-Copyright (c) German Cancer Research Center (DKFZ)
-All rights reserved.
-
-Use of this source code is governed by a 3-clause BSD license that can be
-found in the LICENSE file.
-
-============================================================================*/
-
-#ifndef QMITK_NODE_SELECTION_DIALOG_H
-#define QMITK_NODE_SELECTION_DIALOG_H
-
-#include "org_mitk_gui_qt_common_Export.h"
-
-#include "ui_QmitkNodeSelectionDialog.h"
-
-#include
-#include
-#include
-#include "mitkIDataStorageInspectorProvider.h"
-
-#include
-
-#include
-#include
-
-/**
-* @class QmitkNodeSelectionDialog
-* @brief A customized QDialog that displays different data storage inspectors and allows to
-* set and get a current selection by selecting data nodes in the data storage inspectors.
-*/
-class MITK_QT_COMMON QmitkNodeSelectionDialog : public QDialog
-{
- Q_OBJECT
-
-public:
- explicit QmitkNodeSelectionDialog(QWidget* parent = nullptr, QString caption = "", QString hint = "");
-
- /**
- * @brief Set the data storage that will be used.
- * The function iterates over the dialog's panels and sets the data storage of each panel accordingly.
- * Each panel is a specific data storage inspector.
- *
- * @param dataStorage A pointer to the data storage to set.
- */
- void SetDataStorage(mitk::DataStorage* dataStorage);
-
- /**
- * @brief Set the node predicate that will be used.
- * The function iterates over the dialog's panels and sets the node predicate of each panel accordingly.
- * Each panel is a specific data storage inspector.
- *
- * @param nodePredicate A pointer to node predicate.
- */
- virtual void SetNodePredicate(const mitk::NodePredicateBase* nodePredicate);
-
- const mitk::NodePredicateBase* GetNodePredicate() const;
-
- using NodeList = QList;
- NodeList GetSelectedNodes() const;
-
- /**
- * @brief Helper function that is used to check the given selection for consistency.
- * Returning an empty string assumes that everything is alright and the selection is valid.
- * If the string is not empty, the content of the string will be used as error message.
- */
- using SelectionCheckFunctionType = std::function;
- /**
- * @brief A selection check function can be set. If set the dialog uses this function to check the made/set selection.
- * If the selection is valid, everything is fine.
- * If the selection is indicated as invalid, the dialog will display the selection check function error message.
- */
- void SetSelectionCheckFunction(const SelectionCheckFunctionType &checkFunction);
-
- bool GetSelectOnlyVisibleNodes() const;
-
- using SelectionMode = QAbstractItemView::SelectionMode;
- /**
- * @brief Set the Qt selection mode (e.g. Single selection, multi selection).
- * The function iterates over the dialog's panels and sets the Qt selection mode of each panel accordingly.
- * Each panel is a concrete data storage inspector.
- *
- * @param mode The QAbstractItemView::SelectionMode to define the selection mode.
- */
- void SetSelectionMode(SelectionMode mode);
- SelectionMode GetSelectionMode() const;
-
-Q_SIGNALS:
- /**
- * @brief A signal that will be emitted if the selected node has changed.
- *
- * @param nodes A list of data nodes that are newly selected.
- */
- void CurrentSelectionChanged(NodeList nodes);
-
- public Q_SLOTS:
- /**
- * @brief Set the selection modus to (not) include invisible nodes in the selection.
- * The function iterates over the dialog's panels and sets the selection modus of each panel accordingly.
- * Each panel is a concrete data storage inspector.
- *
- * @param selectOnlyVisibleNodes The bool value to define the selection modus.
- */
- void SetSelectOnlyVisibleNodes(bool selectOnlyVisibleNodes);
- /**
- * @brief Set the currently selected nodes given a list of data nodes.
- * The function iterates over the dialog's panels and sets the current selection of each panel accordingly.
- * Each panel is a concrete data storage inspector.
- *
- * @param selectedNodes A list of data nodes that should be newly selected.
- */
- void SetCurrentSelection(NodeList selectedNodes);
-
-protected Q_SLOTS:
-
- void OnSelectionChanged(NodeList selectedNodes);
- void OnFavoriteNodesButtonClicked();
- void OnOK();
- void OnCancel();
- void OnDoubleClicked(const QModelIndex& index);
-
-protected:
- void SetErrorText(const std::string& checkResponse);
-
- void AddPanel(const mitk::IDataStorageInspectorProvider* provider, const mitk::IDataStorageInspectorProvider::InspectorIDType &preferredID, bool &preferredFound, int &preferredIndex);
-
- mitk::WeakPointer m_DataStorage;
- mitk::NodePredicateBase::ConstPointer m_NodePredicate;
- bool m_SelectOnlyVisibleNodes;
- NodeList m_SelectedNodes;
-
- SelectionCheckFunctionType m_CheckFunction;
-
- SelectionMode m_SelectionMode;
-
- using PanelVectorType = std::vector;
- PanelVectorType m_Panels;
-
- QPushButton* m_FavoriteNodesButton;
- Ui_QmitkNodeSelectionDialog m_Controls;
-};
-
-#endif // QMITK_NODE_SELECTION_DIALOG_H
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.ui b/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.ui
deleted file mode 100644
index 26f94b420d..0000000000
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.ui
+++ /dev/null
@@ -1,116 +0,0 @@
-
-
- QmitkNodeSelectionDialog
-
-
-
- 0
- 0
- 800
- 600
-
-
-
- Dialog
-
-
- true
-
-
- true
-
-
- -
-
-
- 6
-
-
- 6
-
-
- 6
-
-
- 6
-
-
-
-
-
- QFrame::NoFrame
-
-
- Info text ...
-
-
- Qt::RichText
-
-
- true
-
-
-
-
-
- -
-
-
- -1
-
-
-
- 24
- 24
-
-
-
-
- -
-
-
- 6
-
-
- 6
-
-
- 6
-
-
- 6
-
-
-
-
-
- error text
-
-
-
-
-
- -
-
-
-
-
-
- Add the current selection to the favorites.
-
-
- Add to favorites
-
-
-
- -
-
-
- QDialogButtonBox::Cancel|QDialogButtonBox::Ok
-
-
-
-
-
-
-
-
-
-
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionPreferenceHelper.cpp b/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionPreferenceHelper.cpp
deleted file mode 100644
index df4a7c5920..0000000000
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionPreferenceHelper.cpp
+++ /dev/null
@@ -1,158 +0,0 @@
-/*============================================================================
-
-The Medical Imaging Interaction Toolkit (MITK)
-
-Copyright (c) German Cancer Research Center (DKFZ)
-All rights reserved.
-
-Use of this source code is governed by a 3-clause BSD license that can be
-found in the LICENSE file.
-
-============================================================================*/
-
-#include "QmitkNodeSelectionPreferenceHelper.h"
-
-#include
-
-#include
-#include
-#include
-
-#include
-#include
-
-#include "mitkExceptionMacro.h"
-#include "mitkDataStorageInspectorGenerator.h"
-
-void mitk::PutVisibleDataStorageInspectors(const VisibleDataStorageInspectorMapType &inspectors)
-{
- auto* prefService = mitk::CoreServices::GetPreferencesService();
- auto* prefNode = prefService->GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID);
- auto* visNode = prefNode->Node(mitk::NodeSelectionConstants::VISIBLE_INSPECTORS_NODE_ID);
-
- visNode->Clear();
-
- // store map in new node
- for (const auto &inspector : inspectors)
- {
- std::ostringstream sstr;
- sstr << inspector.first;
- auto* aNode = visNode->Node(sstr.str());
-
- aNode->Put(mitk::NodeSelectionConstants::VISIBLE_INSPECTOR_ID, inspector.second);
- }
-
- visNode->Flush();
-}
-
-mitk::VisibleDataStorageInspectorMapType mitk::GetVisibleDataStorageInspectors()
-{
- auto* prefService = mitk::CoreServices::GetPreferencesService();
-
- auto* prefNode = prefService->GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID);
- auto* visNode = prefNode->Node(mitk::NodeSelectionConstants::VISIBLE_INSPECTORS_NODE_ID);
-
- using NamesType = std::vector;
- NamesType names = visNode->ChildrenNames();
-
- VisibleDataStorageInspectorMapType visMap;
-
- if (!names.empty())
- {
- for (const auto& name : names)
- {
- auto* aNode = visNode->Node(name);
-
- if (aNode == nullptr)
- mitkThrow() << "Error in preference interface. Cannot find preset node under given name. Name: " << name;
-
- std::istringstream isstr(name);
- unsigned int order = 0;
- isstr >> order;
-
- auto id = aNode->Get(mitk::NodeSelectionConstants::VISIBLE_INSPECTOR_ID, "");
-
- if (id.empty())
- mitkThrow() << "Error in preference interface. ID of visible inspector is not set. Inspector position: " << order;
-
- visMap.insert(std::make_pair(order, id));
- }
- }
-
- if (visMap.empty())
- { //no visibility preferences set. Generate default
- auto allProviders = mitk::DataStorageInspectorGenerator::GetProviders();
-
- //fill inspector list
- unsigned int pos = 0;
- for (const auto& iter : allProviders)
- {
- if (iter.first != QmitkDataStorageFavoriteNodesInspector::INSPECTOR_ID() && iter.first != QmitkDataStorageSelectionHistoryInspector::INSPECTOR_ID())
- {
- visMap.insert(std::make_pair(pos, iter.first));
- ++pos;
- }
- }
- }
-
- return visMap;
-}
-
-mitk::DataStorageInspectorIDType mitk::GetPreferredDataStorageInspector()
-{
- auto* prefService = mitk::CoreServices::GetPreferencesService();
- auto* prefNode = prefService->GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID);
- auto id = prefNode->Get(mitk::NodeSelectionConstants::PREFERRED_INSPECTOR_ID, "");
-
- if (id.empty())
- { //nothing set, deduce default preferred inspector
- auto visibleInspectors = GetVisibleDataStorageInspectors();
- if (!visibleInspectors.empty())
- id = visibleInspectors.begin()->second;
- }
-
- return id;
-}
-
-void mitk::PutPreferredDataStorageInspector(const DataStorageInspectorIDType &id)
-{
- auto* prefService = mitk::CoreServices::GetPreferencesService();
- auto* prefNode = prefService->GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID);
-
- prefNode->Put(mitk::NodeSelectionConstants::PREFERRED_INSPECTOR_ID, id);
- prefNode->Flush();
-}
-
-void mitk::PutShowFavoritesInspector(bool show)
-{
- auto* prefService = mitk::CoreServices::GetPreferencesService();
- auto* prefNode = prefService->GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID);
-
- prefNode->PutBool(mitk::NodeSelectionConstants::SHOW_FAVORITE_INSPECTOR, show);
- prefNode->Flush();
-}
-
-bool mitk::GetShowFavoritesInspector()
-{
- auto* prefService = mitk::CoreServices::GetPreferencesService();
- auto* prefNode = prefService->GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID);
-
- return prefNode->GetBool(mitk::NodeSelectionConstants::SHOW_FAVORITE_INSPECTOR, true);
-}
-
-void mitk::PutShowHistoryInspector(bool show)
-{
- auto* prefService = mitk::CoreServices::GetPreferencesService();
- auto* prefNode = prefService->GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID);
-
- prefNode->PutBool(mitk::NodeSelectionConstants::SHOW_HISTORY_INSPECTOR, show);
- prefNode->Flush();
-}
-
-bool mitk::GetShowHistoryInspector()
-{
- auto* prefService = mitk::CoreServices::GetPreferencesService();
- auto* prefNode = prefService->GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID);
-
- return prefNode->GetBool(mitk::NodeSelectionConstants::SHOW_HISTORY_INSPECTOR, true);
-}
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionPreferenceHelper.h b/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionPreferenceHelper.h
deleted file mode 100644
index 477493c03e..0000000000
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionPreferenceHelper.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*============================================================================
-
-The Medical Imaging Interaction Toolkit (MITK)
-
-Copyright (c) German Cancer Research Center (DKFZ)
-All rights reserved.
-
-Use of this source code is governed by a 3-clause BSD license that can be
-found in the LICENSE file.
-
-============================================================================*/
-
-
-#ifndef __QMITK_NODE_SELECTION_PREFERENCE_HELPER_H
-#define __QMITK_NODE_SELECTION_PREFERENCE_HELPER_H
-
-#include
-#include