Debian Codegraph @

src/Gui/PreferencePages/DlgSettingsReportView.cpp

raw
1 /***************************************************************************
2 * Copyright (c) 2004 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 "DlgSettingsReportView.h"
25 #include "ui_DlgSettingsReportView.h"
26
27
28 using namespace Gui::Dialog;
29
30 /* TRANSLATOR Gui::Dialog::DlgSettingsReportView */
31
32 /**
33 * Constructs a DlgSettingsReportView which is a child of 'parent', with the
34 * name 'name' and widget flags set to 'f'
35 *
36 * The dialog will by default be modeless, unless you set 'modal' to
37 * true to construct a modal dialog.
38 */
39 DlgSettingsReportView::DlgSettingsReportView(QWidget* parent)
40 : PreferencePage(parent)
41 , ui(new Ui_DlgSettingsReportView)
42 {
43 ui->setupUi(this);
44 ui->colorText->setColor(qApp->palette().windowText().color());
45 }
46
47 /**
48 * Destroys the object and frees any allocated resources
49 */
50 DlgSettingsReportView::~DlgSettingsReportView() = default;
51
52 void DlgSettingsReportView::saveSettings()
53 {
54 ui->checkMessage->onSave();
55 ui->checkLogging->onSave();
56 ui->checkWarning->onSave();
57 ui->checkError->onSave();
58 ui->checkShowReportViewOnWarning->onSave();
59 ui->checkShowReportViewOnError->onSave();
60 ui->checkShowReportViewOnNormalMessage->onSave();
61 ui->checkShowReportViewOnLogMessage->onSave();
62 ui->checkShowReportTimecode->onSave();
63 ui->colorText->onSave();
64 ui->colorLogging->onSave();
65 ui->colorWarning->onSave();
66 ui->colorError->onSave();
67 ui->pythonOutput->onSave();
68 ui->pythonError->onSave();
69 }
70
71 void DlgSettingsReportView::loadSettings()
72 {
73 ui->checkMessage->onRestore();
74 ui->checkLogging->onRestore();
75 ui->checkWarning->onRestore();
76 ui->checkError->onRestore();
77 ui->checkShowReportViewOnWarning->onRestore();
78 ui->checkShowReportViewOnError->onRestore();
79 ui->checkShowReportViewOnNormalMessage->onRestore();
80 ui->checkShowReportViewOnLogMessage->onRestore();
81 ui->checkShowReportTimecode->onRestore();
82 ui->colorText->onRestore();
83 ui->colorLogging->onRestore();
84 ui->colorWarning->onRestore();
85 ui->colorError->onRestore();
86 ui->pythonOutput->blockSignals(true);
87 ui->pythonOutput->onRestore();
88 ui->pythonOutput->blockSignals(false);
89 ui->pythonError->blockSignals(true);
90 ui->pythonError->onRestore();
91 ui->pythonError->blockSignals(false);
92 }
93
94 /**
95 * Sets the strings of the subwidgets using the current language.
96 */
97 void DlgSettingsReportView::changeEvent(QEvent* e)
98 {
99 if (e->type() == QEvent::LanguageChange) {
100 ui->retranslateUi(this);
101 }
102 else {
103 QWidget::changeEvent(e);
104 }
105 }
106
107 #include "moc_DlgSettingsReportView.cpp"