FreeCAD

Форк
0
/
DlgPrefsTechDrawColorsImp.cpp 
112 строк · 4.1 Кб
1
/***************************************************************************
2
 *   Copyright (c) 2020 FreeCAD Developers                                 *
3
 *   Author: Uwe Stöhr <uwestoehr@lyx.org>                                 *
4
 *   Based on src/Mod/FEM/Gui/DlgSettingsFEMImp.cpp                        *
5
 *                                                                         *
6
 *   This file is part of the FreeCAD CAx development system.              *
7
 *                                                                         *
8
 *   This library is free software; you can redistribute it and/or         *
9
 *   modify it under the terms of the GNU Library General Public           *
10
 *   License as published by the Free Software Foundation; either          *
11
 *   version 2 of the License, or (at your option) any later version.      *
12
 *                                                                         *
13
 *   This library  is distributed in the hope that it will be useful,      *
14
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
15
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
16
 *   GNU Library General Public License for more details.                  *
17
 *                                                                         *
18
 *   You should have received a copy of the GNU Library General Public     *
19
 *   License along with this library; see the file COPYING.LIB. If not,    *
20
 *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
21
 *   Suite 330, Boston, MA  02111-1307, USA                                *
22
 *                                                                         *
23
 ***************************************************************************/
24

25
#include "PreCompiled.h"
26

27
#include "DlgPrefsTechDrawColorsImp.h"
28
#include "ui_DlgPrefsTechDrawColors.h"
29

30

31
using namespace TechDrawGui;
32

33
DlgPrefsTechDrawColorsImp::DlgPrefsTechDrawColorsImp( QWidget* parent )
34
  : PreferencePage( parent )
35
  , ui(new Ui_DlgPrefsTechDrawColorsImp)
36
{
37
    ui->setupUi(this);
38
}
39

40
DlgPrefsTechDrawColorsImp::~DlgPrefsTechDrawColorsImp()
41
{
42
    // no need to delete child widgets, Qt does it all for us
43
}
44

45
void DlgPrefsTechDrawColorsImp::saveSettings()
46
{
47
    ui->pcbDimColor->onSave();
48
    ui->pcb_Hatch->onSave();
49
    ui->pcb_Background->onSave();
50
    ui->pcb_PreSelect->onSave();
51
    ui->pcb_Hidden->onSave();
52
    ui->pcb_Select->onSave();
53
    ui->pcb_Normal->onSave();
54
    ui->pcb_Surface->onSave();
55
    ui->pcb_GeomHatch->onSave();
56
    ui->pcb_Face->onSave();
57
    ui->pcb_PaintFaces->onSave();
58
    ui->pcbSectionLine->onSave();
59
    ui->pcbCenterColor->onSave();
60
    ui->pcbVertexColor->onSave();
61
    ui->pcbMarkup->onSave();
62
    ui->pcbHighlight->onSave();
63
    ui->pcb_Grid->onSave();
64
    ui->pcbPageColor->onSave();
65
    ui->pcbLightOnDark->onSave();
66
    ui->pcbMonochrome->onSave();
67
    ui->pcbLightTextColor->onSave();
68
    ui->pcbUnderline->onSave();
69
}
70

71
void DlgPrefsTechDrawColorsImp::loadSettings()
72
{
73
    ui->pcbDimColor->onRestore();
74
    ui->pcb_Hatch->onRestore();
75
    ui->pcb_Background->onRestore();
76
    ui->pcb_PreSelect->onRestore();
77
    ui->pcb_Hidden->onRestore();
78
    ui->pcb_Select->onRestore();
79
    ui->pcb_Normal->onRestore();
80
    ui->pcb_Surface->onRestore();
81
    ui->pcb_GeomHatch->onRestore();
82
    ui->pcb_Face->onRestore();
83
    ui->pcb_PaintFaces->onRestore();
84
    ui->pcbSectionLine->onRestore();
85
    ui->pcbCenterColor->onRestore();
86
    ui->pcbVertexColor->onRestore();
87
    ui->pcbMarkup->onRestore();
88
    ui->pcbHighlight->onRestore();
89
    ui->pcb_Grid->onRestore();
90
    ui->pcbPageColor->onRestore();
91
    ui->pcbLightOnDark->onRestore();
92
    ui->pcbMonochrome->onRestore();
93
    ui->pcbLightTextColor->onRestore();
94
    ui->pcbUnderline->onRestore();
95
}
96

97
/**
98
 * Sets the strings of the subwidgets using the current language.
99
 */
100
void DlgPrefsTechDrawColorsImp::changeEvent(QEvent *e)
101
{
102
    if (e->type() == QEvent::LanguageChange) {
103
        saveSettings();
104
        ui->retranslateUi(this);
105
        loadSettings();
106
    }
107
    else {
108
        QWidget::changeEvent(e);
109
    }
110
}
111

112
#include <Mod/TechDraw/Gui/moc_DlgPrefsTechDrawColorsImp.cpp>
113

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

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

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

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