all repos — mgba @ e3b5711295b5ddb5ccc1bb8c0b29f37fe81636c0

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	void languageChanged();
33	void libraryCleared();
34
35private slots:
36	void selectBios(QLineEdit*);
37	void updateConfig();
38	void reloadConfig();
39
40private:
41	Ui::SettingsView m_ui;
42
43	ConfigController* m_controller;
44	InputController* m_input;
45
46	void saveSetting(const char* key, const QAbstractButton*);
47	void saveSetting(const char* key, const QComboBox*);
48	void saveSetting(const char* key, const QDoubleSpinBox*);
49	void saveSetting(const char* key, const QLineEdit*);
50	void saveSetting(const char* key, const QSlider*);
51	void saveSetting(const char* key, const QSpinBox*);
52	void saveSetting(const char* key, const QVariant&);
53
54	void loadSetting(const char* key, QAbstractButton*);
55	void loadSetting(const char* key, QComboBox*);
56	void loadSetting(const char* key, QDoubleSpinBox*);
57	void loadSetting(const char* key, QLineEdit*);
58	void loadSetting(const char* key, QSlider*);
59	void loadSetting(const char* key, QSpinBox*);
60	QString loadSetting(const char* key);
61};
62
63}
64
65#endif