Medical Imaging Interaction Toolkit  2018.4.99-3e3f1a6e
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
14 #include "QmitkDataManagerView.h"
15 
16 #include <QLabel>
17 #include <QPushButton>
18 #include <QFormLayout>
19 #include <QCheckBox>
20 
22 #include <berryPlatform.h>
23 
25  : m_MainControl(nullptr)
26 {
27  // nothing here
28 }
29 
31 {
32  // nothing here
33 }
34 
36 {
38 
40 
41  m_MainControl = new QWidget(parent);
42  m_EnableSingleEditing = new QCheckBox;
43  m_PlaceNewNodesOnTop = new QCheckBox;
44  m_ShowHelperObjects = new QCheckBox;
45  m_ShowNodesContainingNoData = new QCheckBox;
46 
47  m_UseSurfaceDecimation = new QCheckBox;
48  m_AllowParentChange = new QCheckBox;
49 
50  auto formLayout = new QFormLayout;
51  formLayout->addRow("&Single click property editing:", m_EnableSingleEditing);
52  formLayout->addRow("&Place new nodes on top:", m_PlaceNewNodesOnTop);
53  formLayout->addRow("&Show helper objects:", m_ShowHelperObjects);
54  formLayout->addRow("&Show nodes containing no data", m_ShowNodesContainingNoData);
55  formLayout->addRow("&Use surface decimation:", m_UseSurfaceDecimation);
56  formLayout->addRow("&Allow changing of parent node:", m_AllowParentChange);
57 
58  m_MainControl->setLayout(formLayout);
59  Update();
60 }
61 
63 {
64  return m_MainControl;
65 }
66 
68 {
69  m_DataManagerPreferencesNode->PutBool("Single click property editing", m_EnableSingleEditing->isChecked());
70  m_DataManagerPreferencesNode->PutBool("Place new nodes on top", m_PlaceNewNodesOnTop->isChecked());
71  m_DataManagerPreferencesNode->PutBool("Show helper objects", m_ShowHelperObjects->isChecked());
72  m_DataManagerPreferencesNode->PutBool("Show nodes containing no data", m_ShowNodesContainingNoData->isChecked());
73  m_DataManagerPreferencesNode->PutBool("Use surface decimation", m_UseSurfaceDecimation->isChecked());
74  m_DataManagerPreferencesNode->PutBool("Allow changing of parent node", m_AllowParentChange->isChecked());
75 
76  return true;
77 }
78 
80 {
81  // nothing here
82 }
83 
85 {
86  m_EnableSingleEditing->setChecked(m_DataManagerPreferencesNode->GetBool("Single click property editing", true));
87  m_PlaceNewNodesOnTop->setChecked(m_DataManagerPreferencesNode->GetBool("Place new nodes on top", true));
88  m_ShowHelperObjects->setChecked(m_DataManagerPreferencesNode->GetBool("Show helper objects", false));
89  m_ShowNodesContainingNoData->setChecked(m_DataManagerPreferencesNode->GetBool("Show nodes containing no data", false));
90  m_UseSurfaceDecimation->setChecked(m_DataManagerPreferencesNode->GetBool("Use surface decimation", true));
91  m_AllowParentChange->setChecked(m_DataManagerPreferencesNode->GetBool("Allow changing of parent node", false));
92 }
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()