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