all repos — mgba @ 2b5da04d9c5acf7ac152c903ac73d229ae79d343

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