diff --git a/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkAppInstancesPreferencePage.cpp b/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkAppInstancesPreferencePage.cpp index 30b3422b74..1fc1168d01 100644 --- a/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkAppInstancesPreferencePage.cpp +++ b/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkAppInstancesPreferencePage.cpp @@ -1,75 +1,75 @@ /*============================================================================ 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 "QmitkAppInstancesPreferencePage.h" +#include #include #include #include namespace { mitk::IPreferences* GetPreferences() { auto* preferencesService = mitk::CoreServices::GetPreferencesService(); return preferencesService->GetSystemPreferences()->Node("General"); } } QmitkAppInstancesPreferencePage::QmitkAppInstancesPreferencePage() + : controls(new Ui::QmitkAppInstancesPreferencePage) { - } void QmitkAppInstancesPreferencePage::Init(berry::IWorkbench::Pointer ) { - } void QmitkAppInstancesPreferencePage::CreateQtControl(QWidget* parent) { mainWidget = new QWidget(parent); - controls.setupUi(mainWidget); + controls->setupUi(mainWidget); Update(); } QWidget* QmitkAppInstancesPreferencePage::GetQtControl() const { return mainWidget; } bool QmitkAppInstancesPreferencePage::PerformOk() { auto* prefs = GetPreferences(); - prefs->PutBool("newInstance.always", controls.newInstanceAlways->isChecked()); - prefs->PutBool("newInstance.scene", controls.newInstanceScene->isChecked()); + prefs->PutBool("newInstance.always", controls->newInstanceAlways->isChecked()); + prefs->PutBool("newInstance.scene", controls->newInstanceScene->isChecked()); return true; } void QmitkAppInstancesPreferencePage::PerformCancel() { } void QmitkAppInstancesPreferencePage::Update() { auto* prefs = GetPreferences(); bool always = prefs->GetBool("newInstance.always", false); bool scene = prefs->GetBool("newInstance.scene", true); - controls.newInstanceAlways->setChecked(always); - controls.newInstanceScene->setChecked(scene); + controls->newInstanceAlways->setChecked(always); + controls->newInstanceScene->setChecked(scene); } diff --git a/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkAppInstancesPreferencePage.h b/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkAppInstancesPreferencePage.h index 64e2162497..5a154f0d97 100644 --- a/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkAppInstancesPreferencePage.h +++ b/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkAppInstancesPreferencePage.h @@ -1,47 +1,49 @@ /*============================================================================ 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 QmitkAppInstancesPreferencePage_h #define QmitkAppInstancesPreferencePage_h #include -#include +namespace Ui +{ + class QmitkAppInstancesPreferencePage; +} class QmitkAppInstancesPreferencePage : public QObject, public berry::IQtPreferencePage { Q_OBJECT Q_INTERFACES(berry::IPreferencePage) public: QmitkAppInstancesPreferencePage(); - QmitkAppInstancesPreferencePage(const QmitkAppInstancesPreferencePage& other); void Init(berry::IWorkbench::Pointer workbench) override; void CreateQtControl(QWidget* parent) override; QWidget* GetQtControl() const override; bool PerformOk() override; void PerformCancel() override; void Update() override; private: - Ui::QmitkAppInstancesPreferencePage controls; + Ui::QmitkAppInstancesPreferencePage* controls; QWidget* mainWidget; }; #endif