all repos — mgba @ 7ed4f38bdda9bc22d41a34ad01abe21e67934781

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;
20
21class SettingsView : public QDialog {
22Q_OBJECT
23
24public:
25	SettingsView(ConfigController* controller, InputController* inputController, ShortcutController* shortcutController, QWidget* parent = nullptr);
26
27signals:
28	void biosLoaded(int platform, const QString&);
29	void audioDriverChanged();
30	void displayDriverChanged();
31	void pathsChanged();
32
33private slots:
34	void selectBios(QLineEdit*);
35	void updateConfig();
36	void reloadConfig();
37
38private:
39	Ui::SettingsView m_ui;
40
41	ConfigController* m_controller;
42	InputController* m_input;
43
44	void saveSetting(const char* key, const QAbstractButton*);
45	void saveSetting(const char* key, const QComboBox*);
46	void saveSetting(const char* key, const QDoubleSpinBox*);
47	void saveSetting(const char* key, const QLineEdit*);
48	void saveSetting(const char* key, const QSlider*);
49	void saveSetting(const char* key, const QSpinBox*);
50	void saveSetting(const char* key, const QVariant&);
51
52	void loadSetting(const char* key, QAbstractButton*);
53	void loadSetting(const char* key, QComboBox*);
54	void loadSetting(const char* key, QDoubleSpinBox*);
55	void loadSetting(const char* key, QLineEdit*);
56	void loadSetting(const char* key, QSlider*);
57	void loadSetting(const char* key, QSpinBox*);
58	QString loadSetting(const char* key);
59};
60
61}
62
63#endif