Debian Codegraph @

src/Gui/PreferencePages/DlgSettingsSelection.cpp

raw
1 /***************************************************************************
2 * Copyright (c) 2021 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
24 #include <App/Application.h>
25
26 #include "DlgSettingsSelection.h"
27 #include "ui_DlgSettingsSelection.h"
28
29
30 using namespace Gui::Dialog;
31
32 /* TRANSLATOR Gui::Dialog::DlgSettingsSelection */
33
34 DlgSettingsSelection::DlgSettingsSelection(QWidget* parent)
35 : PreferencePage(parent)
36 , ui(new Ui_DlgSettingsSelection)
37 {
38 ui->setupUi(this);
39 }
40
41 DlgSettingsSelection::~DlgSettingsSelection() = default;
42
43 void DlgSettingsSelection::saveSettings()
44 {
45 ui->checkBoxPreselection->onSave();
46 ui->checkBoxSelection->onSave();
47 ui->HighlightColor->onSave();
48 ui->SelectionColor->onSave();
49 ui->spinPickRadius->onSave();
50 ui->checkBoxAutoSwitch->onSave();
51 ui->checkBoxAutoExpand->onSave();
52 ui->checkBoxPreselect->onSave();
53 ui->checkBoxRecord->onSave();
54 ui->checkBoxSelectionCheckBoxes->onSave();
55 }
56
57 void DlgSettingsSelection::loadSettings()
58 {
59 ui->checkBoxPreselection->onRestore();
60 ui->checkBoxSelection->onRestore();
61 ui->HighlightColor->onRestore();
62 ui->SelectionColor->onRestore();
63 ui->spinPickRadius->onRestore();
64 ui->checkBoxAutoSwitch->onRestore();
65 ui->checkBoxAutoExpand->onRestore();
66 ui->checkBoxPreselect->onRestore();
67 ui->checkBoxRecord->onRestore();
68 ui->checkBoxSelectionCheckBoxes->onRestore();
69 }
70
71 void DlgSettingsSelection::changeEvent(QEvent* e)
72 {
73 if (e->type() == QEvent::LanguageChange) {
74 ui->retranslateUi(this);
75 }
76 else {
77 QWidget::changeEvent(e);
78 }
79 }
80
81 #include "moc_DlgSettingsSelection.cpp"