all repos — mgba @ 70204e410c18785a27a39af538642cd3f54e2528

mGBA Game Boy Advance Emulator

src/platform/qt/SettingsView.h (view raw)

 1/* Copyright (c) 2013-2014 Jeffrey Pfau
 2 *
 3 * This Source Code Form is subject to the terms of the Mozilla Public
 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 6#ifndef QGBA_SETTINGS_VIEW
 7#define QGBA_SETTINGS_VIEW
 8
 9#include <QDialog>
10
11#include <mgba/core/core.h>
12
13#include "ui_SettingsView.h"
14
15namespace QGBA {
16
17class ConfigController;
18class InputController;
19class ShortcutController;
20class ShaderSelector;
21
22class SettingsView : public QDialog {
23Q_OBJECT
24
25public:
26	SettingsView(ConfigController* controller, InputController* inputController, ShortcutController* shortcutController, QWidget* parent = nullptr);
27	~SettingsView();
28
29	void setShaderSelector(ShaderSelector* shaderSelector);
30
31signals:
32	void biosLoaded(int platform, const QString&);
33	void audioDriverChanged();
34	void displayDriverChanged();
35	void pathsChanged();
36	void languageChanged();
37	void libraryCleared();
38
39private slots:
40	void selectBios(QLineEdit*);
41	void updateConfig();
42	void reloadConfig();
43
44private:
45	Ui::SettingsView m_ui;
46
47	ConfigController* m_controller;
48	InputController* m_input;
49	ShaderSelector* m_shader = nullptr;
50
51	void saveSetting(const char* key, const QAbstractButton*);
52	void saveSetting(const char* key, const QComboBox*);
53	void saveSetting(const char* key, const QDoubleSpinBox*);
54	void saveSetting(const char* key, const QLineEdit*);
55	void saveSetting(const char* key, const QSlider*);
56	void saveSetting(const char* key, const QSpinBox*);
57	void saveSetting(const char* key, const QVariant&);
58
59	void loadSetting(const char* key, QAbstractButton*);
60	void loadSetting(const char* key, QComboBox*);
61	void loadSetting(const char* key, QDoubleSpinBox*);
62	void loadSetting(const char* key, QLineEdit*);
63	void loadSetting(const char* key, QSlider*);
64	void loadSetting(const char* key, QSpinBox*);
65	QString loadSetting(const char* key);
66};
67
68}
69
70#endif