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