FreeCAD

Форк
0
/
DlgSettingsObjectColor.cpp 
105 строк · 3.9 Кб
1
/***************************************************************************
2
 *   Copyright (c) 2013 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 "DlgSettingsObjectColor.h"
26
#include "ui_DlgSettingsObjectColor.h"
27

28

29
using namespace PartGui;
30

31
/* TRANSLATOR PartGui::DlgSettingsObjectColor */
32

33
/**
34
 *  Constructs a DlgSettingsObjectColor which is a child of 'parent', with the
35
 *  name 'name' and widget flags set to 'f'
36
 */
37
DlgSettingsObjectColor::DlgSettingsObjectColor(QWidget* parent)
38
    : PreferencePage(parent)
39
    , ui(new Ui_DlgSettingsObjectColor)
40
{
41
    ui->setupUi(this);
42
    ui->DefaultShapeColor->setDisabled(ui->checkRandomColor->isChecked());
43
}
44

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

50
void DlgSettingsObjectColor::saveSettings()
51
{
52
    // Part
53
    ui->DefaultShapeColor->onSave();
54
    ui->DefaultAmbientColor->onSave();
55
    ui->DefaultEmissiveColor->onSave();
56
    ui->DefaultSpecularColor->onSave();
57
    ui->checkRandomColor->onSave();
58
    ui->DefaultShapeTransparency->onSave();
59
    ui->DefaultShapeShininess->onSave();
60
    ui->DefaultShapeLineColor->onSave();
61
    ui->DefaultShapeLineWidth->onSave();
62
    ui->DefaultShapeVertexColor->onSave();
63
    ui->DefaultShapeVertexSize->onSave();
64
    ui->BoundingBoxColor->onSave();
65
    ui->BoundingBoxFontSize->onSave();
66
    ui->twosideRendering->onSave();
67
    // Annotations
68
    ui->AnnotationTextColor->onSave();
69
}
70

71
void DlgSettingsObjectColor::loadSettings()
72
{
73
    // Part
74
    ui->DefaultShapeColor->onRestore();
75
    ui->DefaultAmbientColor->onRestore();
76
    ui->DefaultEmissiveColor->onRestore();
77
    ui->DefaultSpecularColor->onRestore();
78
    ui->checkRandomColor->onRestore();
79
    ui->DefaultShapeTransparency->onRestore();
80
    ui->DefaultShapeShininess->onRestore();
81
    ui->DefaultShapeLineColor->onRestore();
82
    ui->DefaultShapeLineWidth->onRestore();
83
    ui->DefaultShapeVertexColor->onRestore();
84
    ui->DefaultShapeVertexSize->onRestore();
85
    ui->BoundingBoxColor->onRestore();
86
    ui->BoundingBoxFontSize->onRestore();
87
    ui->twosideRendering->onRestore();
88
    // Annotations
89
    ui->AnnotationTextColor->onRestore();
90
}
91

92
/**
93
 * Sets the strings of the subwidgets using the current language.
94
 */
95
void DlgSettingsObjectColor::changeEvent(QEvent *e)
96
{
97
    if (e->type() == QEvent::LanguageChange) {
98
        ui->retranslateUi(this);
99
    }
100
    else {
101
        QWidget::changeEvent(e);
102
    }
103
}
104

105
#include "moc_DlgSettingsObjectColor.cpp"
106

107

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

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

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

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