all repos — mgba @ 53690f7a83e6f7b99eae1b4bbde66b5716935ed1

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 InputIndex;
20class ShortcutView;
21
22class SettingsView : public QDialog {
23Q_OBJECT
24
25public:
26	SettingsView(ConfigController* controller, InputController* inputController, QWidget* parent = nullptr);
27
28signals:
29	void biosLoaded(int platform, const QString&);
30	void audioDriverChanged();
31	void displayDriverChanged();
32	void pathsChanged();
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	ShortcutView* m_shortcutView;
46	ShortcutView* m_keyView;
47
48	void saveSetting(const char* key, const QAbstractButton*);
49	void saveSetting(const char* key, const QComboBox*);
50	void saveSetting(const char* key, const QDoubleSpinBox*);
51	void saveSetting(const char* key, const QLineEdit*);
52	void saveSetting(const char* key, const QSlider*);
53	void saveSetting(const char* key, const QSpinBox*);
54	void saveSetting(const char* key, const QVariant&);
55
56	void loadSetting(const char* key, QAbstractButton*);
57	void loadSetting(const char* key, QComboBox*);
58	void loadSetting(const char* key, QDoubleSpinBox*);
59	void loadSetting(const char* key, QLineEdit*);
60	void loadSetting(const char* key, QSlider*);
61	void loadSetting(const char* key, QSpinBox*);
62	QString loadSetting(const char* key);
63};
64
65}
66
67#endif