FreeCAD

Форк
0
/
DlgSettingsMeshView.cpp 
94 строки · 3.5 Кб
1
/***************************************************************************
2
 *   Copyright (c) 2009 Werner Mayer <wmayer[at]users.sourceforge.net>     *
3
 *                                                                         *
4
 *   This file is part of the FreeCAD CAx development system.              *
5
 *                                                                         *
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.      *
10
 *                                                                         *
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.                  *
15
 *                                                                         *
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                                *
20
 *                                                                         *
21
 ***************************************************************************/
22

23
#include "PreCompiled.h"
24

25
#include <Gui/Window.h>
26

27
#include "DlgSettingsMeshView.h"
28
#include "ui_DlgSettingsMeshView.h"
29

30

31
using namespace MeshGui;
32

33
/**
34
 *  Constructs a DlgSettingsMeshView which is a child of 'parent'.
35
 */
36
DlgSettingsMeshView::DlgSettingsMeshView(QWidget* parent)
37
    : PreferencePage(parent)
38
    , ui(new Ui_DlgSettingsMeshView)
39
{
40
    ui->setupUi(this);
41
    ui->labelBackfaceColor->hide();
42
    ui->buttonBackfaceColor->hide();
43
}
44

45
/**
46
 *  Destroys the object and frees any allocated resources
47
 */
48
DlgSettingsMeshView::~DlgSettingsMeshView() = default;
49

50
void DlgSettingsMeshView::saveSettings()
51
{
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();
61
}
62

63
void DlgSettingsMeshView::loadSettings()
64
{
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);
69
    }
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();
79
}
80

81
/**
82
 * Sets the strings of the subwidgets using the current language.
83
 */
84
void DlgSettingsMeshView::changeEvent(QEvent* e)
85
{
86
    if (e->type() == QEvent::LanguageChange) {
87
        ui->retranslateUi(this);
88
    }
89
    else {
90
        QWidget::changeEvent(e);
91
    }
92
}
93

94
#include "moc_DlgSettingsMeshView.cpp"
95

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.