-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsettingsdialog.h
More file actions
69 lines (53 loc) · 1.6 KB
/
settingsdialog.h
File metadata and controls
69 lines (53 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// SPDX-FileCopyrightText: 2025 Thorsten Roth
// SPDX-License-Identifier: GPL-3.0-or-later
#ifndef SETTINGSDIALOG_H_
#define SETTINGSDIALOG_H_
#include <QDialog>
#include "./settings.h"
class QComboBox;
class QLabel;
class QLineEdit;
namespace Ui {
class SettingsDialog;
}
class SettingsDialog : public QDialog {
Q_OBJECT
public:
explicit SettingsDialog(QWidget *pParent, const QString &userDataDir);
virtual ~SettingsDialog();
public slots:
void accept() override;
void reject() override;
void updateUiLang();
signals:
void newGame(const QString &s);
void changeLang(const QString &sLang);
protected:
void showEvent(QShowEvent *pEvent) override;
bool eventFilter(QObject *pObj, QEvent *pEvent) override;
private slots:
void changeNumOfPlayers();
void changedSettings();
void changedStyle(int nIndex);
void clickedStyleCell(int nRow, int nCol);
private:
void readSettings();
auto searchTranslations() const -> QStringList;
void searchCpuScripts(const QString &sUserDataDir);
auto getCpuStrength(const QString &sFilename) -> QString;
void searchBoardStyles(const QString &sStyleDir);
void fillStyleTable();
void saveBoardStyle();
auto getStyleColorFromTable(QColor color, const int nRow) -> QColor;
void searchBoards(const QString &sUserDataDir);
void updateStartPlayerCombo();
Ui::SettingsDialog *m_pUi;
Settings *m_pSettings;
QList<QLabel *> m_listColorLbls;
QList<QLabel *> m_listHumCpuLbls;
QList<QLineEdit *> m_listColorEdit;
QList<QComboBox *> m_listPlayerCombo;
QStringList m_sListBoards;
bool m_bSettingChanged{};
};
#endif // SETTINGSDIALOG_H_