Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkDataManagerPreferencePage.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
18 #include "QmitkDataManagerView.h"
19 
20 #include <QLabel>
21 #include <QPushButton>
22 #include <QFormLayout>
23 #include <QCheckBox>
24 
26 #include <berryPlatform.h>
27 
29 : m_MainControl(nullptr)
30 {
31 
32 }
33 
35 {
36 
37 }
38 
40 {
42 
44 
45  m_MainControl = new QWidget(parent);
46  m_EnableSingleEditing = new QCheckBox;
47  m_PlaceNewNodesOnTop = new QCheckBox;
48  m_ShowHelperObjects = new QCheckBox;
49  m_ShowNodesContainingNoData = new QCheckBox;
50  m_GlobalReinitOnNodeDelete = new QCheckBox;
51  m_GlobalReinitOnNodeAdded = new QCheckBox;
52  m_UseSurfaceDecimation = new QCheckBox;
53  m_AllowParentChange = new QCheckBox;
54 
55  auto formLayout = new QFormLayout;
56  formLayout->addRow("&Single click property editing:", m_EnableSingleEditing);
57  formLayout->addRow("&Place new nodes on top:", m_PlaceNewNodesOnTop);
58  formLayout->addRow("&Show helper objects:", m_ShowHelperObjects);
59  formLayout->addRow("&Show nodes containing no data", m_ShowNodesContainingNoData);
60  formLayout->addRow("&Call global reinit if node is deleted", m_GlobalReinitOnNodeDelete);
61  formLayout->addRow("&Call global reinit if node is added", m_GlobalReinitOnNodeAdded);
62  formLayout->addRow("&Use surface decimation:", m_UseSurfaceDecimation);
63  formLayout->addRow("&Allow changing of parent node:", m_AllowParentChange);
64 
65  m_MainControl->setLayout(formLayout);
66  this->Update();
67 }
68 
70 {
71  return m_MainControl;
72 }
73 
75 {
76  m_DataManagerPreferencesNode->PutBool("Single click property editing"
77  , m_EnableSingleEditing->isChecked());
78  m_DataManagerPreferencesNode->PutBool("Place new nodes on top"
79  , m_PlaceNewNodesOnTop->isChecked());
80  m_DataManagerPreferencesNode->PutBool("Show helper objects"
81  , m_ShowHelperObjects->isChecked());
82  m_DataManagerPreferencesNode->PutBool("Show nodes containing no data"
83  , m_ShowNodesContainingNoData->isChecked());
84  m_DataManagerPreferencesNode->PutBool("Call global reinit if node is deleted"
85  , m_GlobalReinitOnNodeDelete->isChecked());
86  m_DataManagerPreferencesNode->PutBool("Call global reinit if node is added"
87  , m_GlobalReinitOnNodeAdded->isChecked());
88  m_DataManagerPreferencesNode->PutBool("Use surface decimation"
89  , m_UseSurfaceDecimation->isChecked());
90  m_DataManagerPreferencesNode->PutBool("Allow changing of parent node"
91  , m_AllowParentChange->isChecked());
92  return true;
93 }
94 
96 {
97 
98 }
99 
101 {
102  m_EnableSingleEditing->setChecked(m_DataManagerPreferencesNode->GetBool("Single click property editing", true));
103  m_PlaceNewNodesOnTop->setChecked(m_DataManagerPreferencesNode->GetBool("Place new nodes on top", true));
104  m_ShowHelperObjects->setChecked(m_DataManagerPreferencesNode->GetBool("Show helper objects", false));
105  m_ShowNodesContainingNoData->setChecked(m_DataManagerPreferencesNode->GetBool("Show nodes containing no data", false));
106  m_UseSurfaceDecimation->setChecked(m_DataManagerPreferencesNode->GetBool("Use surface decimation", true));
107  m_GlobalReinitOnNodeDelete->setChecked(m_DataManagerPreferencesNode->GetBool("Call global reinit if node is deleted", true));
108  m_GlobalReinitOnNodeAdded->setChecked(m_DataManagerPreferencesNode->GetBool("Call global reinit if node is added", true));
109  m_AllowParentChange->setChecked(m_DataManagerPreferencesNode->GetBool("Allow changing of parent node", false));
110 }
berry::IPreferences::Pointer m_DataManagerPreferencesNode
virtual SmartPointer< IPreferences > GetSystemPreferences()=0
static const QString VIEW_ID
void Init(berry::IWorkbench::Pointer workbench) override
void CreateQtControl(QWidget *widget) override
static IPreferencesService * GetPreferencesService()