diff --git a/Modules/QtWidgets/include/QmitkDataStorageInspectorProviderBase.h b/Modules/QtWidgets/include/QmitkDataStorageInspectorProviderBase.h index 980de6c4ac..52d55d3d52 100644 --- a/Modules/QtWidgets/include/QmitkDataStorageInspectorProviderBase.h +++ b/Modules/QtWidgets/include/QmitkDataStorageInspectorProviderBase.h @@ -1,81 +1,81 @@ /*============================================================================ 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_DATA_STORAGE_INSPECTOR_PROVIDER_BASE_H #define __QMITK_DATA_STORAGE_INSPECTOR_PROVIDER_BASE_H #include // Microservices #include #include #include // MITK #include /** * @brief Base class for DataStorage inspector provider. * * This class is the default implementation for a inspector provider. You can template it with * the respective inspector class to directly use it. */ template class QmitkDataStorageInspectorProviderBase : public mitk::IDataStorageInspectorProvider { public: QmitkAbstractDataStorageInspector* CreateInspector() const override; using InspectorIDType = mitk::IDataStorageInspectorProvider::InspectorIDType; InspectorIDType GetInspectorID() const override; std::string GetInspectorDisplayName() const override; std::string GetInspectorDescription() const override; - QByteArray GetInspectorIconSVG() const override; + QIcon GetInspectorIcon() const override; us::ServiceRegistration RegisterService( us::ModuleContext *context = us::GetModuleContext()); void UnregisterService(); QmitkDataStorageInspectorProviderBase(const std::string& id); QmitkDataStorageInspectorProviderBase(const std::string& id, const std::string& displayName, const std::string& desc = "", const std::string& pathToIconSVG = ""); ~QmitkDataStorageInspectorProviderBase() override; protected: QmitkDataStorageInspectorProviderBase(const QmitkDataStorageInspectorProviderBase &other); QmitkDataStorageInspectorProviderBase &operator=(const QmitkDataStorageInspectorProviderBase &other) = delete; virtual us::ServiceProperties GetServiceProperties() const; /** * \brief Set the service ranking for this file reader. * * Default is zero and should only be chosen differently for a reason. * The ranking is used to determine which provider to use if several * equivalent providers have been found. * It may be used to replace a default provider from MITK in your own project. */ void SetRanking(int ranking); int GetRanking() const; private: class Impl; std::unique_ptr d; }; #ifndef ITK_MANUAL_INSTANTIATION #include "QmitkDataStorageInspectorProviderBase.tpp" #endif #endif /* __QMITK_DATA_STORAGE_INSPECTOR_PROVIDER_BASE_H */ diff --git a/Modules/QtWidgets/include/QmitkDataStorageInspectorProviderBase.tpp b/Modules/QtWidgets/include/QmitkDataStorageInspectorProviderBase.tpp index fdc81849c5..d7e9360308 100644 --- a/Modules/QtWidgets/include/QmitkDataStorageInspectorProviderBase.tpp +++ b/Modules/QtWidgets/include/QmitkDataStorageInspectorProviderBase.tpp @@ -1,164 +1,166 @@ /*============================================================================ 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 #include #include #include #include +#include + #include - template - class QmitkDataStorageInspectorProviderBase::Impl +template +class QmitkDataStorageInspectorProviderBase::Impl +{ +public: + Impl(const std::string& id, const std::string& displayName, const std::string& desc, const QByteArray& svg) : m_Ranking(0), m_ID(id), m_DisplayName(displayName), m_Desc(desc), m_SVG(svg) { - public: - Impl(const std::string& id, const std::string& displayName, const std::string& desc, const QByteArray& svg) : m_Ranking(0), m_ID(id), m_DisplayName(displayName), m_Desc(desc), m_SVG(svg) - { - }; - - Impl(const Impl &other) = default; - - void SetRanking(int ranking) - { - m_Ranking = ranking; - }; - - int GetRanking() const - { - return m_Ranking; - }; - - us::ServiceRegistration m_Reg; - int m_Ranking; - std::string m_ID; - std::string m_DisplayName; - std::string m_Desc; - QByteArray m_SVG; }; - template - QmitkDataStorageInspectorProviderBase::QmitkDataStorageInspectorProviderBase(const std::string& id) : QmitkDataStorageInspectorProviderBase(id, id) - { - } - - template - QmitkDataStorageInspectorProviderBase::QmitkDataStorageInspectorProviderBase(const std::string& id, const std::string& displayName, const std::string& desc, const std::string& pathToIconSVG) - { - QByteArray svg; - - if (!pathToIconSVG.empty()) - { - QFile iconFile(QString::fromStdString(pathToIconSVG)); - if (iconFile.open(QIODevice::ReadOnly)) - svg = iconFile.readAll(); - } - - d.reset(new Impl(id, displayName, desc, svg)); - RegisterService(); - } - - template - QmitkDataStorageInspectorProviderBase::~QmitkDataStorageInspectorProviderBase() - { - UnregisterService(); - } - - template - QmitkDataStorageInspectorProviderBase::QmitkDataStorageInspectorProviderBase(const QmitkDataStorageInspectorProviderBase &other) : IDataStorageInspectorProvider(), d(new Impl(*other.d.get())) - { - } - - template - QmitkAbstractDataStorageInspector* - QmitkDataStorageInspectorProviderBase::CreateInspector() const - { - return new TInspector; - }; + Impl(const Impl &other) = default; - template - typename QmitkDataStorageInspectorProviderBase::InspectorIDType - QmitkDataStorageInspectorProviderBase::GetInspectorID() const + void SetRanking(int ranking) { - return d->m_ID; + m_Ranking = ranking; }; - template - std::string - QmitkDataStorageInspectorProviderBase::GetInspectorDisplayName() const + int GetRanking() const { - return d->m_DisplayName; + return m_Ranking; }; - template - std::string - QmitkDataStorageInspectorProviderBase::GetInspectorDescription() const + us::ServiceRegistration m_Reg; + int m_Ranking; + std::string m_ID; + std::string m_DisplayName; + std::string m_Desc; + QByteArray m_SVG; +}; + +template +QmitkDataStorageInspectorProviderBase::QmitkDataStorageInspectorProviderBase(const std::string& id) : QmitkDataStorageInspectorProviderBase(id, id) +{ +} + +template +QmitkDataStorageInspectorProviderBase::QmitkDataStorageInspectorProviderBase(const std::string& id, const std::string& displayName, const std::string& desc, const std::string& pathToIconSVG) +{ + QByteArray svg; + + if (!pathToIconSVG.empty()) { - return d->m_Desc; - }; + QFile iconFile(QString::fromStdString(pathToIconSVG)); + if (iconFile.open(QIODevice::ReadOnly)) + svg = iconFile.readAll(); + } - template - QByteArray - QmitkDataStorageInspectorProviderBase::GetInspectorIconSVG() const - { - return d->m_SVG; - }; + d.reset(new Impl(id, displayName, desc, svg)); + RegisterService(); +} + +template +QmitkDataStorageInspectorProviderBase::~QmitkDataStorageInspectorProviderBase() +{ + UnregisterService(); +} + +template +QmitkDataStorageInspectorProviderBase::QmitkDataStorageInspectorProviderBase(const QmitkDataStorageInspectorProviderBase &other) : IDataStorageInspectorProvider(), d(new Impl(*other.d.get())) +{ +} + +template +QmitkAbstractDataStorageInspector* + QmitkDataStorageInspectorProviderBase::CreateInspector() const +{ + return new TInspector; +}; + +template +typename QmitkDataStorageInspectorProviderBase::InspectorIDType + QmitkDataStorageInspectorProviderBase::GetInspectorID() const +{ + return d->m_ID; +}; + +template +std::string + QmitkDataStorageInspectorProviderBase::GetInspectorDisplayName() const +{ + return d->m_DisplayName; +}; + +template +std::string + QmitkDataStorageInspectorProviderBase::GetInspectorDescription() const +{ + return d->m_Desc; +}; + +template +QIcon + QmitkDataStorageInspectorProviderBase::GetInspectorIcon() const +{ + return QmitkStyleManager::ThemeIcon(d->m_SVG); +}; + +template +us::ServiceRegistration + QmitkDataStorageInspectorProviderBase::RegisterService(us::ModuleContext *context) +{ + if (d->m_Reg) + return d->m_Reg; - template - us::ServiceRegistration - QmitkDataStorageInspectorProviderBase::RegisterService(us::ModuleContext *context) + if (context == nullptr) { - if (d->m_Reg) - return d->m_Reg; - - if (context == nullptr) - { - context = us::GetModuleContext(); - } - - us::ServiceProperties props = this->GetServiceProperties(); - d->m_Reg = context->RegisterService(this, props); - return d->m_Reg; + context = us::GetModuleContext(); } - template - void - QmitkDataStorageInspectorProviderBase::UnregisterService() + us::ServiceProperties props = this->GetServiceProperties(); + d->m_Reg = context->RegisterService(this, props); + return d->m_Reg; +} + +template +void + QmitkDataStorageInspectorProviderBase::UnregisterService() +{ + try { - try - { - d->m_Reg.Unregister(); - } - catch (const std::exception &) - { - } + d->m_Reg.Unregister(); } - - template - us::ServiceProperties - QmitkDataStorageInspectorProviderBase::GetServiceProperties() const + catch (const std::exception &) { - us::ServiceProperties result; - - result[IDataStorageInspectorProvider::PROP_INSPECTOR_ID()] = this->d->m_ID; - result[us::ServiceConstants::SERVICE_RANKING()] = this->GetRanking(); - return result; } - - template - void - QmitkDataStorageInspectorProviderBase::SetRanking(int ranking) { d->SetRanking(ranking); } - - template - int - QmitkDataStorageInspectorProviderBase::GetRanking() const { return d->GetRanking(); } +} + +template +us::ServiceProperties +QmitkDataStorageInspectorProviderBase::GetServiceProperties() const +{ + us::ServiceProperties result; + + result[IDataStorageInspectorProvider::PROP_INSPECTOR_ID()] = this->d->m_ID; + result[us::ServiceConstants::SERVICE_RANKING()] = this->GetRanking(); + return result; +} + +template +void +QmitkDataStorageInspectorProviderBase::SetRanking(int ranking) { d->SetRanking(ranking); } + +template +int +QmitkDataStorageInspectorProviderBase::GetRanking() const { return d->GetRanking(); } diff --git a/Modules/QtWidgets/include/mitkIDataStorageInspectorProvider.h b/Modules/QtWidgets/include/mitkIDataStorageInspectorProvider.h index 8e28b774ec..220558b73e 100644 --- a/Modules/QtWidgets/include/mitkIDataStorageInspectorProvider.h +++ b/Modules/QtWidgets/include/mitkIDataStorageInspectorProvider.h @@ -1,73 +1,73 @@ /*============================================================================ 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 __I_DATA_STORAGE_INSPECTOR_PROVIDER_H #define __I_DATA_STORAGE_INSPECTOR_PROVIDER_H #include #include -#include +#include class QmitkAbstractDataStorageInspector; namespace mitk { /** * \ingroup MicroServices_Interfaces * * \brief The common interface for all DataStorage inspector providers. * * Implementations of this interface must be registered as a service * to make themselves available via the service registry. * * It is recommended to derive new implementations from QmitkDataStorageInspectorProviderBase * which provide correct service registration semantics. * * \sa QmitkDataStorageInspectorProviderBase */ struct MITKQTWIDGETS_EXPORT IDataStorageInspectorProvider { virtual ~IDataStorageInspectorProvider(); /** * \brief returns an inspector instance represented by the provider. */ virtual QmitkAbstractDataStorageInspector* CreateInspector() const = 0; using InspectorIDType = std::string; /** Return the uniqe ID for the inspector type provided.*/ virtual InspectorIDType GetInspectorID() const = 0; /** Return the display name (e.g. used in the UI) for the inspector type provided.*/ virtual std::string GetInspectorDisplayName() const = 0; /** Returns a description of the inspector type provided.*/ virtual std::string GetInspectorDescription() const = 0; /** Returns the svg data of the icon of the inspector. Empty array indicates that no icon is defined. @remark It is passed as svg file content and not as icon directly to allow later styling*/ - virtual QByteArray GetInspectorIconSVG() const = 0; + virtual QIcon GetInspectorIcon() const = 0; /** * @brief Service property name for the inspector ID. * * The property value must be of type \c std::string. * * @return The property name. */ static std::string PROP_INSPECTOR_ID(); }; } // namespace mitk MITK_DECLARE_SERVICE_INTERFACE(mitk::IDataStorageInspectorProvider, "org.mitk.IDataStorageInspectorProvider") #endif /* __I_DATA_STORAGE_INSPECTOR_PROVIDER_H */ diff --git a/Modules/QtWidgets/resource/Qmitk.qrc b/Modules/QtWidgets/resource/Qmitk.qrc index 05f38518c4..4f12f499d8 100644 --- a/Modules/QtWidgets/resource/Qmitk.qrc +++ b/Modules/QtWidgets/resource/Qmitk.qrc @@ -1,24 +1,26 @@ Binaerbilder_48.png Images_48.png PointSet_48.png Segmentation_48.png Surface_48.png mm_pointer.png mm_scroll.png mm_zoom.png mm_contrast.png mm_pan.png LabelSetImage_48.png mwLayout.png mwSynchronized.png mwDesynchronized.png mwMITK.png mwPACS.png star-solid.svg history-solid.svg tree_inspector.svg list-solid.svg - + favorite_add.svg + favorite_remove.svg + diff --git a/Modules/QtWidgets/resource/favorite_add.svg b/Modules/QtWidgets/resource/favorite_add.svg new file mode 100644 index 0000000000..6240713584 --- /dev/null +++ b/Modules/QtWidgets/resource/favorite_add.svg @@ -0,0 +1,39 @@ + + diff --git a/Modules/QtWidgets/resource/favorite_remove.svg b/Modules/QtWidgets/resource/favorite_remove.svg new file mode 100644 index 0000000000..c05b9c255e --- /dev/null +++ b/Modules/QtWidgets/resource/favorite_remove.svg @@ -0,0 +1,42 @@ + + diff --git a/Modules/QtWidgets/resource/icon-license.txt b/Modules/QtWidgets/resource/icon-license.txt index 4449413332..662c801d5f 100644 --- a/Modules/QtWidgets/resource/icon-license.txt +++ b/Modules/QtWidgets/resource/icon-license.txt @@ -1,4 +1,6 @@ See [Font Awsome 4] in Licenses/ICONS.md for: - history-solid.svg based on Font Awsome's history-solid.svg - list-solid.svg based on Font Awsome's list-solid.svg - star-solid.svg based on Font Awsome's star-solid.svg +- favorite_add.svg based on Font Awsome's star-solid.svg +- favorite_remove.svg based on Font Awsome's star-solid.svg diff --git a/Modules/QtWidgets/src/QmitkDataStorageFavoriteNodesInspector.cpp b/Modules/QtWidgets/src/QmitkDataStorageFavoriteNodesInspector.cpp index 489263a5a1..a15973ec6f 100644 --- a/Modules/QtWidgets/src/QmitkDataStorageFavoriteNodesInspector.cpp +++ b/Modules/QtWidgets/src/QmitkDataStorageFavoriteNodesInspector.cpp @@ -1,50 +1,56 @@ /*============================================================================ 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 #include #include "mitkNodePredicateAnd.h" #include "QPushButton" +#include "QmitkStyleManager.h" + QmitkDataStorageFavoriteNodesInspector::QmitkDataStorageFavoriteNodesInspector(QWidget* parent/* = nullptr*/) : QmitkDataStorageListInspector(parent) { - auto favoriteNodesButton = new QPushButton("Remove selection from favorites", parent); + auto favoriteNodesButton = new QPushButton(parent); QmitkDataStorageListInspector::m_Controls.verticalLayout->addWidget(favoriteNodesButton, 0, Qt::AlignRight); + favoriteNodesButton->setIcon(QmitkStyleManager::ThemeIcon(QStringLiteral(":/Qmitk/favorite_remove.svg"))); + favoriteNodesButton->setIconSize(QSize(24, 24)); + favoriteNodesButton->setToolTip("Remove selected nodes as favorite"); + m_FavoriteNodeSelectionPredicate = mitk::NodePredicateProperty::New("org.mitk.selection.favorite", mitk::BoolProperty::New(true)); m_NodePredicate = m_FavoriteNodeSelectionPredicate; connect(favoriteNodesButton, &QPushButton::clicked, this, &QmitkDataStorageFavoriteNodesInspector::OnFavoriteNodesButtonClicked); } void QmitkDataStorageFavoriteNodesInspector::SetNodePredicate(const mitk::NodePredicateBase* nodePredicate) { mitk::NodePredicateAnd::Pointer combinedPredicate = mitk::NodePredicateAnd::New(); combinedPredicate->AddPredicate(m_FavoriteNodeSelectionPredicate); combinedPredicate->AddPredicate(nodePredicate); QmitkDataStorageListInspector::SetNodePredicate(combinedPredicate); } void QmitkDataStorageFavoriteNodesInspector::OnFavoriteNodesButtonClicked() { auto selectedNodes = GetSelectedNodes(); for (auto node : selectedNodes) { node->SetBoolProperty("org.mitk.selection.favorite", false); } } diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.cpp b/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.cpp index b4ee5e55d7..5adcf94c8b 100644 --- a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.cpp +++ b/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.cpp @@ -1,248 +1,254 @@ /*============================================================================ 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 favoriteID = mitk::GetFavoriteDataStorageInspector(); + auto favoriteID = 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 (auto proIter : providers) { visibleProviders.insert(std::make_pair(order, proIter.first)); ++order; } } int favIndex = 0; bool favoriteFound = false; for (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, favoriteID, favoriteFound, favIndex); } } else { MITK_DEBUG << "No provider registered for inspector that is defined as visible in the preferences. Illegal inspector ID: " << proIter.second; } } - auto favoritesPorvider = mitk::DataStorageInspectorGenerator::GetProvider(QmitkDataStorageFavoriteNodesInspector::INSPECTOR_ID()); - if (favoritesPorvider != nullptr) + if (mitk::GetShowFavoritesInspector()) { - this->AddPanel(favoritesPorvider, favoriteID, favoriteFound, favIndex); + auto favoritesPorvider = mitk::DataStorageInspectorGenerator::GetProvider(QmitkDataStorageFavoriteNodesInspector::INSPECTOR_ID()); + if (favoritesPorvider != nullptr) + { + this->AddPanel(favoritesPorvider, favoriteID, favoriteFound, favIndex); + } } - auto historyPorvider = mitk::DataStorageInspectorGenerator::GetProvider(QmitkDataStorageSelectionHistoryInspector::INSPECTOR_ID()); - if (historyPorvider != nullptr) + if (mitk::GetShowHistoryInspector()) { - this->AddPanel(historyPorvider, favoriteID, favoriteFound, favIndex); + auto historyPorvider = mitk::DataStorageInspectorGenerator::GetProvider(QmitkDataStorageSelectionHistoryInspector::INSPECTOR_ID()); + if (historyPorvider != nullptr) + { + this->AddPanel(historyPorvider, favoriteID, favoriteFound, favIndex); + } } m_Controls.tabWidget->setCurrentIndex(favIndex); this->setWindowTitle(title); this->setToolTip(hint); m_Controls.hint->setText(hint); m_Controls.hint->setVisible(!hint.isEmpty()); - m_Controls.btnAddToFav->setIcon(berry::QtStyleManager::ThemeIcon(QStringLiteral(":/Qmitk/star-solid.svg"))); + 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, SIGNAL(accepted()), this, SLOT(OnOK())); connect(m_Controls.buttonBox, SIGNAL(rejected()), this, SLOT(OnCancel())); } void QmitkNodeSelectionDialog::SetDataStorage(mitk::DataStorage* dataStorage) { if (m_DataStorage != dataStorage) { m_DataStorage = dataStorage; if (!m_DataStorage.IsExpired()) { for (auto panel : m_Panels) { panel->SetDataStorage(dataStorage); } } } } 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); m_Controls.hint->setText(QString::fromStdString(checkResponse)); m_Controls.hint->setVisible(!checkResponse.empty()); m_Controls.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(checkResponse.empty()); } 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); m_Controls.hint->setText(QString::fromStdString(checkResponse)); m_Controls.hint->setVisible(!checkResponse.empty()); 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 : m_SelectedNodes) { node->SetBoolProperty("org.mitk.selection.favorite", true); } } void QmitkNodeSelectionDialog::OnOK() { for (auto node : m_SelectedNodes) { QmitkDataStorageSelectionHistoryInspector::AddNodeToHistory(node); } this->accept(); } void QmitkNodeSelectionDialog::OnCancel() { this->reject(); } void QmitkNodeSelectionDialog::AddPanel(const mitk::IDataStorageInspectorProvider * provider, const mitk::IDataStorageInspectorProvider::InspectorIDType&favoriteID, bool &favoriteFound, int &favIndex) { 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 iconSVG = provider->GetInspectorIconSVG(); - if (!iconSVG.isEmpty()) + auto icon = provider->GetInspectorIcon(); + if (!icon.isNull()) { - m_Controls.tabWidget->setTabIcon(panelPos, berry::QtStyleManager::ThemeIcon(iconSVG)); + m_Controls.tabWidget->setTabIcon(panelPos, icon); } m_Panels.push_back(inspector); connect(inspector, &QmitkAbstractDataStorageInspector::CurrentSelectionChanged, this, &QmitkNodeSelectionDialog::OnSelectionChanged); favoriteFound = favoriteFound || provider->GetInspectorID() == favoriteID; if (!favoriteFound) { ++favIndex; } } diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.ui b/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.ui index f70d47475b..a07b9670ae 100644 --- a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.ui +++ b/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionDialog.ui @@ -1,102 +1,102 @@ QmitkNodeSelectionDialog 0 0 800 600 Dialog true true 5 0 0 0 0 6 6 6 QFrame::NoFrame Info text ... true -1 - 32 - 32 + 24 + 24 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 index 442e8f9a37..24c157539b 100644 --- a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionPreferenceHelper.cpp +++ b/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionPreferenceHelper.cpp @@ -1,119 +1,161 @@ /*============================================================================ 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 "mitkExceptionMacro.h" void mitk::PutVisibleDataStorageInspectors(const VisibleDataStorageInspectorMapType &inspectors) { berry::IPreferencesService *prefService = berry::Platform::GetPreferencesService(); berry::IPreferences::Pointer prefNode = prefService->GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID.c_str()); berry::IPreferences::Pointer visNode = prefNode->Node(mitk::NodeSelectionConstants::VISIBLE_INSPECTORS_NODE_ID.c_str()); visNode->RemoveNode(); prefNode->Flush(); // new empty preset node visNode = prefNode->Node(mitk::NodeSelectionConstants::VISIBLE_INSPECTORS_NODE_ID.c_str()); // store map in new node for (const auto &inspector : inspectors) { std::ostringstream sstr; sstr << inspector.first; berry::IPreferences::Pointer aNode = visNode->Node(QString::fromStdString(sstr.str())); aNode->Put(mitk::NodeSelectionConstants::VISIBLE_INSPECTOR_ID.c_str(), inspector.second.c_str()); aNode->Flush(); } visNode->Flush(); } mitk::VisibleDataStorageInspectorMapType mitk::GetVisibleDataStorageInspectors() { berry::IPreferencesService *prefService = berry::Platform::GetPreferencesService(); berry::IPreferences::Pointer prefNode = prefService->GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID.c_str()); berry::IPreferences::Pointer visNode = prefNode->Node(mitk::NodeSelectionConstants::VISIBLE_INSPECTORS_NODE_ID.c_str()); typedef QStringList NamesType; NamesType names = visNode->ChildrenNames(); VisibleDataStorageInspectorMapType visMap; if (!names.empty()) { for (NamesType::const_iterator pos = names.begin(); pos != names.end(); ++pos) { berry::IPreferences::Pointer aNode = visNode->Node(*pos); if (aNode.IsNull()) { mitkThrow() << "Error in preference interface. Cannot find preset node under given name. Name: " << (*pos).toStdString(); } std::istringstream isstr(pos->toStdString()); unsigned int order = 0; isstr >> order; auto id = aNode->Get(mitk::NodeSelectionConstants::VISIBLE_INSPECTOR_ID.c_str(), ""); if (id.isEmpty()) { mitkThrow() << "Error in preference interface. ID of visible inspector is not set. Inspector position: " << order; } visMap.insert(std::make_pair(order, id.toStdString())); } } return visMap; } -mitk::DataStorageInspectorIDType mitk::GetFavoriteDataStorageInspector() +mitk::DataStorageInspectorIDType mitk::GetPreferredDataStorageInspector() { berry::IPreferencesService *prefService = berry::Platform::GetPreferencesService(); berry::IPreferences::Pointer prefNode = prefService->GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID.c_str()); - auto id = prefNode->Get(mitk::NodeSelectionConstants::FAVORITE_INSPECTOR_ID.c_str(), ""); + auto id = prefNode->Get(mitk::NodeSelectionConstants::PREFERRED_INSPECTOR_ID.c_str(), ""); mitk::DataStorageInspectorIDType result = id.toStdString(); return result; } -void mitk::PutFavoriteDataStorageInspector(const DataStorageInspectorIDType &id) +void mitk::PutPreferredDataStorageInspector(const DataStorageInspectorIDType &id) { berry::IPreferencesService *prefService = berry::Platform::GetPreferencesService(); berry::IPreferences::Pointer prefNode = prefService->GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID.c_str()); - prefNode->Put(mitk::NodeSelectionConstants::FAVORITE_INSPECTOR_ID.c_str(), id.c_str()); + prefNode->Put(mitk::NodeSelectionConstants::PREFERRED_INSPECTOR_ID.c_str(), id.c_str()); prefNode->Flush(); } + +void mitk::PutShowFavoritesInspector(bool show) +{ + berry::IPreferencesService *prefService = berry::Platform::GetPreferencesService(); + + berry::IPreferences::Pointer prefNode = + prefService->GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID.c_str()); + + prefNode->PutBool(mitk::NodeSelectionConstants::SHOW_FAVORITE_INSPECTOR.c_str(), show); + prefNode->Flush(); +} + +bool mitk::GetShowFavoritesInspector() +{ + berry::IPreferencesService *prefService = berry::Platform::GetPreferencesService(); + + berry::IPreferences::Pointer prefNode = + prefService->GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID.c_str()); + + return prefNode->GetBool(mitk::NodeSelectionConstants::SHOW_FAVORITE_INSPECTOR.c_str(), true); +} + +void mitk::PutShowHistoryInspector(bool show) +{ + berry::IPreferencesService *prefService = berry::Platform::GetPreferencesService(); + + berry::IPreferences::Pointer prefNode = + prefService->GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID.c_str()); + + prefNode->PutBool(mitk::NodeSelectionConstants::SHOW_HISTORY_INSPECTOR.c_str(), show); + prefNode->Flush(); +} + +bool mitk::GetShowHistoryInspector() +{ + berry::IPreferencesService *prefService = berry::Platform::GetPreferencesService(); + + berry::IPreferences::Pointer prefNode = + prefService->GetSystemPreferences()->Node(mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID.c_str()); + + return prefNode->GetBool(mitk::NodeSelectionConstants::SHOW_HISTORY_INSPECTOR.c_str(), true); +} diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionPreferenceHelper.h b/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionPreferenceHelper.h index a6508c6efb..1963bff7b3 100644 --- a/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionPreferenceHelper.h +++ b/Plugins/org.mitk.gui.qt.common/src/QmitkNodeSelectionPreferenceHelper.h @@ -1,42 +1,55 @@ /*============================================================================ 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 namespace mitk { using DataStorageInspectorIDType = std::string; /** map containing the IDs of all inspectors that should be visible. The map key is the order of appareance of the respective inspector.*/ using VisibleDataStorageInspectorMapType = std::map; /** Stores the given ID as favorite inspector.*/ - void PutFavoriteDataStorageInspector(const DataStorageInspectorIDType& id); + void PutPreferredDataStorageInspector(const DataStorageInspectorIDType& id); /** Gets the ID of the current favorite data storage inspector. * If empty string is returned, no favorite is set.*/ - DataStorageInspectorIDType GetFavoriteDataStorageInspector(); + DataStorageInspectorIDType GetPreferredDataStorageInspector(); /** Stores the given map of visible inspectors.*/ void PutVisibleDataStorageInspectors(const VisibleDataStorageInspectorMapType& inspectors); /** Gets the map of current visible inspectors.*/ VisibleDataStorageInspectorMapType GetVisibleDataStorageInspectors(); + + + /** Stores the given show state of the favorite inspector.*/ + void PutShowFavoritesInspector(bool show); + + /** Indicates if the favorites inspector should be shown. */ + bool GetShowFavoritesInspector(); + + /** Stores the given show state of the history inspector.*/ + void PutShowHistoryInspector(bool show); + + /** Indicates if the history inspector should be shown. */ + bool GetShowHistoryInspector(); } #endif diff --git a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionConstants.cpp b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionConstants.cpp index 4692c11a9e..b5419d7458 100644 --- a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionConstants.cpp +++ b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionConstants.cpp @@ -1,18 +1,20 @@ /*============================================================================ 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 "QmitkNodeSelectionConstants.h" const std::string mitk::NodeSelectionConstants::ROOT_PREFERENCE_NODE_ID = "/NODESELECTION/UI"; const std::string mitk::NodeSelectionConstants::VISIBLE_INSPECTORS_NODE_ID = "visibleInspectors"; -const std::string mitk::NodeSelectionConstants::FAVORITE_INSPECTOR_ID = "inspectorID"; +const std::string mitk::NodeSelectionConstants::PREFERRED_INSPECTOR_ID = "inspectorID"; const std::string mitk::NodeSelectionConstants::VISIBLE_INSPECTOR_ID = "inspectorID"; +const std::string mitk::NodeSelectionConstants::SHOW_FAVORITE_INSPECTOR = "showFavoriteInspector"; +const std::string mitk::NodeSelectionConstants::SHOW_HISTORY_INSPECTOR = "showHistoryInspector"; \ No newline at end of file diff --git a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionConstants.h b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionConstants.h index 61196de261..7aa5326fd1 100644 --- a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionConstants.h +++ b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionConstants.h @@ -1,38 +1,42 @@ /*============================================================================ 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_CONSTANTS_H_ #define _QMITK_NODE_SELECTION_CONSTANTS_H_ #include #include "org_mitk_gui_qt_common_Export.h" namespace mitk { struct MITK_QT_COMMON NodeSelectionConstants { /** ID/Path of main preference node for node selections. */ static const std::string ROOT_PREFERENCE_NODE_ID; /** ID of main preference node where all visible inspectors are stored (e.g. ROOT_PREFERENCE_NODE_ID+"/"+VISIBLE_INSPECTORS_NODE_ID+"/[orderering #]"). The sub node naming encodes the ordering number of the visible inspector.*/ static const std::string VISIBLE_INSPECTORS_NODE_ID; - /** ID for the value that stores the favorite inspector ID in the root preference node.*/ - static const std::string FAVORITE_INSPECTOR_ID; + /** ID for the value that stores the preferred inspector ID in the root preference node.*/ + static const std::string PREFERRED_INSPECTOR_ID; /** ID for the value that stores the inspector ID in the preference node.*/ static const std::string VISIBLE_INSPECTOR_ID; + /** ID for the value that stores if the favorite inspector should be visible.*/ + static const std::string SHOW_FAVORITE_INSPECTOR; + /** ID for the value that stores if the history inspector should be visible.*/ + static const std::string SHOW_HISTORY_INSPECTOR; }; } #endif diff --git a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionPreferencePage.cpp b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionPreferencePage.cpp index 552a8a99a8..204d0f6e16 100644 --- a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionPreferencePage.cpp +++ b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionPreferencePage.cpp @@ -1,200 +1,215 @@ /*============================================================================ 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 "QmitkNodeSelectionPreferencePage.h" #include "QmitkNodeSelectionPreferenceHelper.h" #include #include //----------------------------------------------------------------------------- QmitkNodeSelectionPreferencePage::QmitkNodeSelectionPreferencePage() : m_MainControl(nullptr), m_Controls(nullptr) { } //----------------------------------------------------------------------------- QmitkNodeSelectionPreferencePage::~QmitkNodeSelectionPreferencePage() { delete m_Controls; } //----------------------------------------------------------------------------- void QmitkNodeSelectionPreferencePage::Init(berry::IWorkbench::Pointer ) { } //----------------------------------------------------------------------------- void QmitkNodeSelectionPreferencePage::CreateQtControl(QWidget* parent) { m_MainControl = new QWidget(parent); m_Controls = new Ui::QmitkNodeSelectionPreferencePage; m_Controls->setupUi( m_MainControl ); - connect(m_Controls->comboFavorite, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateWidgets())); + connect(m_Controls->comboPreferred, SIGNAL(currentIndexChanged(int)), this, SLOT(UpdateWidgets())); connect(m_Controls->btnUp, SIGNAL(clicked(bool)), this, SLOT(MoveUp())); connect(m_Controls->btnDown, SIGNAL(clicked(bool)), this, SLOT(MoveDown())); connect(m_Controls->listInspectors, SIGNAL(itemSelectionChanged()), this, SLOT(UpdateWidgets())); this->Update(); } //----------------------------------------------------------------------------- QWidget* QmitkNodeSelectionPreferencePage::GetQtControl() const { return m_MainControl; } //----------------------------------------------------------------------------- bool QmitkNodeSelectionPreferencePage::PerformOk() { //store favorite - auto id = m_Controls->comboFavorite->currentData().toString(); - mitk::PutFavoriteDataStorageInspector(id.toStdString()); + auto id = m_Controls->comboPreferred->currentData().toString(); + mitk::PutPreferredDataStorageInspector(id.toStdString()); //store visible mitk::VisibleDataStorageInspectorMapType visibles; unsigned int visiblePos = 0; for (int i = 0; i < m_Controls->listInspectors->count(); ++i) { auto item = m_Controls->listInspectors->item(i); if (item->checkState() == Qt::Checked) { visibles.insert(std::make_pair(visiblePos++, item->data(Qt::UserRole).toString().toStdString())); } } mitk::PutVisibleDataStorageInspectors(visibles); + mitk::PutShowFavoritesInspector(m_Controls->checkShowFav->isChecked()); + mitk::PutShowHistoryInspector(m_Controls->checkShowHistory->isChecked()); return true; } //----------------------------------------------------------------------------- void QmitkNodeSelectionPreferencePage::PerformCancel() { } //----------------------------------------------------------------------------- void QmitkNodeSelectionPreferencePage::Update() { m_Providers = mitk::DataStorageInspectorGenerator::GetProviders(); auto visibleProviders = mitk::GetVisibleDataStorageInspectors(); auto allProviders = mitk::DataStorageInspectorGenerator::GetProviders(); - auto favorite = mitk::GetFavoriteDataStorageInspector(); + auto favorite = mitk::GetPreferredDataStorageInspector(); auto finding = m_Providers.find(favorite); if (finding == m_Providers.cend()) { favorite = m_Providers.begin()->first; } //fill favorite combo int index = 0; int currentIndex = 0; - m_Controls->comboFavorite->clear(); + m_Controls->comboPreferred->clear(); for (auto iter : m_Providers) { - m_Controls->comboFavorite->addItem(QString::fromStdString(iter.second->GetInspectorDisplayName()),QVariant::fromValue(QString::fromStdString(iter.first))); + m_Controls->comboPreferred->addItem(QString::fromStdString(iter.second->GetInspectorDisplayName()),QVariant::fromValue(QString::fromStdString(iter.first))); if (iter.first == favorite) { currentIndex = index; }; ++index; } - m_Controls->comboFavorite->setCurrentIndex(currentIndex); + m_Controls->comboPreferred->setCurrentIndex(currentIndex); //fill inspector list m_Controls->listInspectors->clear(); for (const auto iter : allProviders) { if (iter.first != QmitkDataStorageFavoriteNodesInspector::INSPECTOR_ID() && iter.first != QmitkDataStorageSelectionHistoryInspector::INSPECTOR_ID()) { auto currentID = iter.first; QListWidgetItem* item = new QListWidgetItem; item->setText(QString::fromStdString(iter.second->GetInspectorDisplayName())); item->setData(Qt::UserRole, QVariant::fromValue(QString::fromStdString(currentID))); item->setToolTip(QString::fromStdString(iter.second->GetInspectorDescription())); auto finding = std::find_if(visibleProviders.cbegin(), visibleProviders.cend(), [¤tID](auto v) {return v.second == currentID; }); if (finding == visibleProviders.cend()) { item->setCheckState(Qt::Unchecked); m_Controls->listInspectors->addItem(item); } else { item->setCheckState(Qt::Checked); m_Controls->listInspectors->insertItem(finding->first, item); } } } + m_Controls->checkShowFav->setChecked(mitk::GetShowFavoritesInspector()); + m_Controls->checkShowHistory->setChecked(mitk::GetShowHistoryInspector()); + this->UpdateWidgets(); } void QmitkNodeSelectionPreferencePage::UpdateWidgets() { int currentIndex = m_Controls->listInspectors->currentRow(); m_Controls->btnUp->setEnabled(!m_Controls->listInspectors->selectedItems().empty() && currentIndex > 0); m_Controls->btnDown->setEnabled(!m_Controls->listInspectors->selectedItems().empty() && currentIndex + 1 < m_Controls->listInspectors->count()); for (int i = 0; i < m_Controls->listInspectors->count(); ++i) { auto item = m_Controls->listInspectors->item(i); - if (item->data(Qt::UserRole).toString() == m_Controls->comboFavorite->currentData().toString()) + if (item->data(Qt::UserRole).toString() == m_Controls->comboPreferred->currentData().toString()) { - //favorites are always visible. + //preferred inspector is always visible. item->setCheckState(Qt::Checked); item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled); } else { item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled | Qt::ItemIsUserCheckable); } } + + if (QmitkDataStorageFavoriteNodesInspector::INSPECTOR_ID() == m_Controls->comboPreferred->currentData().toString()) + { + m_Controls->checkShowFav->setChecked(true); + } + if (QmitkDataStorageSelectionHistoryInspector::INSPECTOR_ID() == m_Controls->comboPreferred->currentData().toString()) + { + m_Controls->checkShowHistory->setChecked(true); + } + }; void QmitkNodeSelectionPreferencePage::MoveDown() { int currentIndex = m_Controls->listInspectors->currentRow(); if (currentIndex+1 < m_Controls->listInspectors->count()) { QListWidgetItem *currentItem = m_Controls->listInspectors->takeItem(currentIndex); m_Controls->listInspectors->insertItem(currentIndex + 1, currentItem); m_Controls->listInspectors->setCurrentRow(currentIndex + 1); } this->UpdateWidgets(); }; void QmitkNodeSelectionPreferencePage::MoveUp() { int currentIndex = m_Controls->listInspectors->currentRow(); if (currentIndex > 0) { QListWidgetItem *currentItem = m_Controls->listInspectors->takeItem(currentIndex); m_Controls->listInspectors->insertItem(currentIndex - 1, currentItem); m_Controls->listInspectors->setCurrentRow(currentIndex - 1); } this->UpdateWidgets(); }; diff --git a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionPreferencePage.ui b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionPreferencePage.ui index c88f7330f2..1599ef75ad 100644 --- a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionPreferencePage.ui +++ b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionPreferencePage.ui @@ -1,145 +1,165 @@ QmitkNodeSelectionPreferencePage 0 0 715 713 Form Up Down - - - - Favorite inspector: - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - + - <html><head/><body><p>The favorite inspector is always visible.</p><p>Additionally the favorite inspector has always the focus when opening a node selection dialoge.</p></body></html> + <html><head/><body><p>The preferred inspector is always visible.</p><p>Additionally the preferred inspector has always the focus when opening a node selection dialoge.</p></body></html> Neues Element 2 - + <html><head/><body><p><span style=" font-weight:600;">Instruction:</span><br/>Only checked inspectors will be shown in node selection dialogs.<br/>You may change the order in the inspector list, to change the order of the tabs in the node selection dialog.</p></body></html> true Inspector visiblitiy and order: 16777215 16777215 List of all available inspectors. Checked inspectores will be display TreeInspector ffffff Checked List Checked + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Preferred inspector: + + + + + + + Show favorites inspector + + + true + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + Show history inspector + + + true + + +