Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
stenzek
GitHub Repository: stenzek/duckstation
Path: blob/master/src/duckstation-qt/advancedsettingswidget.h
4246 views
1
// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <[email protected]>
2
// SPDX-License-Identifier: CC-BY-NC-ND-4.0
3
4
#pragma once
5
#include <QtCore/QVector>
6
#include <QtWidgets/QWidget>
7
8
#include "ui_advancedsettingswidget.h"
9
10
class SettingsWindow;
11
12
class AdvancedSettingsWidget : public QWidget
13
{
14
Q_OBJECT
15
16
public:
17
explicit AdvancedSettingsWidget(SettingsWindow* dialog, QWidget* parent);
18
~AdvancedSettingsWidget();
19
20
Q_SIGNALS:
21
void onShowDebugOptionsChanged(bool enabled);
22
23
private Q_SLOTS:
24
void onLogChannelsButtonClicked();
25
void onAnyLogSinksChanged();
26
void onShowDebugOptionsStateChanged();
27
28
private:
29
struct TweakOption
30
{
31
enum class Type
32
{
33
Boolean,
34
IntRange
35
};
36
37
Type type;
38
QString description;
39
std::string key;
40
std::string section;
41
42
union
43
{
44
struct
45
{
46
bool default_value;
47
} boolean;
48
49
struct
50
{
51
int min_value;
52
int max_value;
53
int default_value;
54
} int_range;
55
};
56
};
57
58
SettingsWindow* m_dialog;
59
60
Ui::AdvancedSettingsWidget m_ui;
61
62
QVector<TweakOption> m_tweak_options;
63
64
void addTweakOptions();
65
void onResetToDefaultClicked();
66
};
67
68