openPilotLog
settingswidget.h
1 /*
2  *openPilotLog - A FOSS Pilot Logbook Application
3  *Copyright (C) 2020-2021 Felix Turowsky
4  *
5  *This program is free software: you can redistribute it and/or modify
6  *it under the terms of the GNU General Public License as published by
7  *the Free Software Foundation, either version 3 of the License, or
8  *(at your option) any later version.
9  *
10  *This program is distributed in the hope that it will be useful,
11  *but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  *GNU General Public License for more details.
14  *
15  *You should have received a copy of the GNU General Public License
16  *along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 #ifndef SETTINGSWIDGET_H
19 #define SETTINGSWIDGET_H
20 
21 #include <QWidget>
22 #include <QButtonGroup>
23 #include <QValidator>
24 #include <QProcess>
25 #include <QDebug>
26 #include <QFontDialog>
27 
28 namespace Ui {
29 class SettingsWidget;
30 }
31 
40 class SettingsWidget : public QWidget
41 {
42  Q_OBJECT
43 
44 public:
45  explicit SettingsWidget(QWidget *parent = nullptr);
46  ~SettingsWidget();
47 
52 
53 private slots:
54 
55  void on_aboutPushButton_clicked();
56  void on_acftSortComboBox_currentIndexChanged(int index);
57  void on_acAllowIncompleteComboBox_currentIndexChanged(int index);
58  void on_prefixLineEdit_textChanged(const QString &arg1);
59  void on_lastnameLineEdit_editingFinished();
60  void on_firstnameLineEdit_editingFinished();
61  void on_employeeidLineEdit_editingFinished();
62  void on_emailLineEdit_editingFinished();
63  void on_phoneLineEdit_editingFinished();
64  void on_aliasComboBox_currentIndexChanged(int index);
65  void on_functionComboBox_currentIndexChanged(const QString &arg1);
66  void on_rulesComboBox_currentIndexChanged(const QString &arg1);
67  void on_approachComboBox_currentIndexChanged(const QString &arg1);
68  void on_nightComboBox_currentIndexChanged(int index);
69  void on_pilotSortComboBox_currentIndexChanged(int index);
70  void on_logbookViewComboBox_currentIndexChanged(int index);
71  void on_companyLineEdit_editingFinished();
72  void on_styleComboBox_currentTextChanged(const QString& new_style_setting);
73 
74  void on_fontComboBox_currentFontChanged(const QFont &f);
75 
76  void on_fontSpinBox_valueChanged(int arg1);
77 
78  void on_fontCheckBox_stateChanged(int arg1);
79 
80  void on_resetStylePushButton_clicked();
81 
82  void on_currLicDateEdit_userDateChanged(const QDate &date);
83 
84  void on_currTrDateEdit_userDateChanged(const QDate &date);
85 
86  void on_currLckDateEdit_userDateChanged(const QDate &date);
87 
88  void on_currMedDateEdit_userDateChanged(const QDate &date);
89 
90  void on_currCustom1DateEdit_userDateChanged(const QDate &date);
91 
92  void on_currCustom2DateEdit_userDateChanged(const QDate &date);
93 
94  void on_currToLdgCheckBox_stateChanged(int arg1);
95 
96  void on_currLicCheckBox_stateChanged(int arg1);
97 
98  void on_currTrCheckBox_stateChanged(int arg1);
99 
100  void on_currLckCheckBox_stateChanged(int arg1);
101 
102  void on_currMedCheckBox_stateChanged(int arg1);
103 
104  void on_currCustom1CheckBox_stateChanged(int arg1);
105 
106  void on_currCustom2CheckBox_stateChanged(int arg1);
107 
108  void on_currWarningCheckBox_stateChanged(int arg1);
109 
110  void on_currWarningThresholdSpinBox_valueChanged(int arg1);
111 
112  void on_currCustom1LineEdit_editingFinished();
113 
114  void on_currCustom2LineEdit_editingFinished();
115 
116  void on_dateFormatComboBox_currentIndexChanged(int index);
117 
118  void on_languageComboBox_activated(const QString &arg1);
119 
120 private:
121  Ui::SettingsWidget *ui;
122 
123  void readSettings();
124 
125  void setupValidators();
126 
127  void setupComboBoxes();
128 
129  void setupDateEdits();
130 
131  void updatePersonalDetails();
132 
133  bool usingStylesheet();
134 
135 signals:
136 
142 
143 protected:
147  void changeEvent(QEvent* event) override;
148 };
149 
150 #endif // SETTINGSWIDGET_H
LogbookWidget
The LogbookWidget displays data from the database in a QSqlTableView fed by a QSqlQuery Model.
Definition: logbookwidget.h:46
SettingsWidget
The SettingsWidget is used to to display and alter Settings.
Definition: settingswidget.h:41
SettingsWidget::settingChanged
void settingChanged(SettingSignal widget)
settingChanged is emitted when a setting change occurs that needs to trigger an update (repaint) to a...
PilotsWidget
The PilotsWidget is used to view, edit, delete or add new pilots.
Definition: pilotswidget.h:54
HomeWidget
The HomeWidget is the welcome screen of the application.
Definition: homewidget.h:44
SettingsWidget::SettingSignal
SettingSignal
enumerates Widgets that need to receive a signal when a setting is updated.
Definition: settingswidget.h:51
SettingsWidget::changeEvent
void changeEvent(QEvent *event) override
Handles change events, like updating the UI to new localisation.
Definition: settingswidget.cpp:70
AircraftWidget
The AircraftWidget is used to view, edit, delete or add new tails.
Definition: aircraftwidget.h:53