FreeCAD

Форк
0
/
DlgPrefsTechDrawHLRImp.cpp 
90 строк · 3.2 Кб
1
/***************************************************************************
2
 *   Copyright (c) 2015 FreeCAD Developers                                 *
3
 *   Author: WandererFan <wandererfan@gmail.com>                           *
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 "DlgPrefsTechDrawHLRImp.h"
28
#include "ui_DlgPrefsTechDrawHLR.h"
29

30

31
using namespace TechDrawGui;
32

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

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

45
void DlgPrefsTechDrawHLRImp::saveSettings()
46
{
47
    ui->pcbSeamViz->onSave();
48
    ui->pcbSmoothViz->onSave();
49
    ui->pcbHardViz->onSave();
50
    ui->pcbPolygon->onSave();
51
    ui->pcbIsoViz->onSave();
52
    ui->pcbSmoothHid->onSave();
53
    ui->pcbSeamHid->onSave();
54
    ui->pcbIsoHid->onSave();
55
    ui->psbIsoCount->onSave();
56
    ui->pcbHardHid->onSave();
57
}
58

59
void DlgPrefsTechDrawHLRImp::loadSettings()
60
{
61
    // set defaults for HLR
62
    ui->pcbSeamViz->onRestore();
63

64
    ui->pcbSmoothViz->onRestore();
65
    ui->pcbHardViz->onRestore();
66
    ui->pcbPolygon->onRestore();
67
    ui->pcbIsoViz->onRestore();
68
    ui->pcbSmoothHid->onRestore();
69
    ui->pcbSeamHid->onRestore();
70
    ui->pcbIsoHid->onRestore();
71
    ui->psbIsoCount->onRestore();
72
    ui->pcbHardHid->onRestore();
73
}
74

75
/**
76
 * Sets the strings of the subwidgets using the current language.
77
 */
78
void DlgPrefsTechDrawHLRImp::changeEvent(QEvent *e)
79
{
80
    if (e->type() == QEvent::LanguageChange) {
81
        saveSettings();
82
        ui->retranslateUi(this);
83
        loadSettings();
84
    }
85
    else {
86
        QWidget::changeEvent(e);
87
    }
88
}
89

90
#include <Mod/TechDraw/Gui/moc_DlgPrefsTechDrawHLRImp.cpp>
91

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

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

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

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