1
/***************************************************************************
2
* Copyright (c) 2009 Werner Mayer <wmayer[at]users.sourceforge.net> *
4
* This file is part of the FreeCAD CAx development system. *
6
* This library is free software; you can redistribute it and/or *
7
* modify it under the terms of the GNU Library General Public *
8
* License as published by the Free Software Foundation; either *
9
* version 2 of the License, or (at your option) any later version. *
11
* This library is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
* GNU Library General Public License for more details. *
16
* You should have received a copy of the GNU Library General Public *
17
* License along with this library; see the file COPYING.LIB. If not, *
18
* write to the Free Software Foundation, Inc., 59 Temple Place, *
19
* Suite 330, Boston, MA 02111-1307, USA *
21
***************************************************************************/
23
#include "PreCompiled.h"
25
#include <Gui/Window.h>
27
#include "DlgSettingsMeshView.h"
28
#include "ui_DlgSettingsMeshView.h"
31
using namespace MeshGui;
34
* Constructs a DlgSettingsMeshView which is a child of 'parent'.
36
DlgSettingsMeshView::DlgSettingsMeshView(QWidget* parent)
37
: PreferencePage(parent)
38
, ui(new Ui_DlgSettingsMeshView)
41
ui->labelBackfaceColor->hide();
42
ui->buttonBackfaceColor->hide();
46
* Destroys the object and frees any allocated resources
48
DlgSettingsMeshView::~DlgSettingsMeshView() = default;
50
void DlgSettingsMeshView::saveSettings()
52
ui->checkboxRendering->onSave();
53
ui->checkboxBoundbox->onSave();
54
ui->buttonMeshColor->onSave();
55
ui->buttonLineColor->onSave();
56
ui->buttonBackfaceColor->onSave();
57
ui->spinMeshTransparency->onSave();
58
ui->spinLineTransparency->onSave();
59
ui->checkboxNormal->onSave();
60
ui->spinboxAngle->onSave();
63
void DlgSettingsMeshView::loadSettings()
65
Base::Reference<ParameterGrp> hGrp = Gui::WindowParameter::getDefaultParameter();
66
hGrp = hGrp->GetGroup("View");
67
if (!hGrp->GetBool("EnablePreselection", true) && !hGrp->GetBool("EnableSelection", true)) {
68
ui->checkboxBoundbox->setDisabled(true);
70
ui->checkboxRendering->onRestore();
71
ui->checkboxBoundbox->onRestore();
72
ui->buttonMeshColor->onRestore();
73
ui->buttonLineColor->onRestore();
74
ui->buttonBackfaceColor->onRestore();
75
ui->spinMeshTransparency->onRestore();
76
ui->spinLineTransparency->onRestore();
77
ui->checkboxNormal->onRestore();
78
ui->spinboxAngle->onRestore();
82
* Sets the strings of the subwidgets using the current language.
84
void DlgSettingsMeshView::changeEvent(QEvent* e)
86
if (e->type() == QEvent::LanguageChange) {
87
ui->retranslateUi(this);
90
QWidget::changeEvent(e);
94
#include "moc_DlgSettingsMeshView.cpp"