Duckstation/src/duckstation-qt/settingsdialog.h

70 lines
2 KiB
C
Raw Normal View History

2019-12-31 06:17:17 +00:00
#pragma once
#include "ui_settingsdialog.h"
#include <QtCore/QMap>
2020-01-05 02:46:03 +00:00
#include <QtWidgets/QDialog>
2019-12-31 06:17:17 +00:00
class QtHostInterface;
class GeneralSettingsWidget;
2020-01-05 02:46:03 +00:00
class GameListSettingsWidget;
class HotkeySettingsWidget;
2019-12-31 06:17:17 +00:00
class ConsoleSettingsWidget;
2020-01-05 02:46:03 +00:00
class PortSettingsWidget;
class GPUSettingsWidget;
2020-01-24 04:51:13 +00:00
class AudioSettingsWidget;
2019-12-31 06:17:17 +00:00
class SettingsDialog final : public QDialog
2019-12-31 06:17:17 +00:00
{
Q_OBJECT
public:
enum class Category
{
GeneralSettings,
2020-01-24 04:50:51 +00:00
ConsoleSettings,
2019-12-31 06:17:17 +00:00
GameListSettings,
2020-01-05 02:46:03 +00:00
HotkeySettings,
PortSettings,
2019-12-31 06:17:17 +00:00
GPUSettings,
AudioSettings,
Count
};
2020-01-05 02:46:03 +00:00
SettingsDialog(QtHostInterface* host_interface, QWidget* parent = nullptr);
2019-12-31 06:17:17 +00:00
~SettingsDialog();
GeneralSettingsWidget* getGeneralSettingsWidget() const { return m_general_settings; }
ConsoleSettingsWidget* getConsoleSettingsWidget() const { return m_console_settings; }
GameListSettingsWidget* getGameListSettingsWidget() const { return m_game_list_settings; }
HotkeySettingsWidget* getHotkeySettingsWidget() const { return m_hotkey_settings; }
PortSettingsWidget* getPortSettingsWidget() const { return m_port_settings; }
GPUSettingsWidget* getGPUSettingsWidget() const { return m_gpu_settings; }
2020-01-24 04:51:13 +00:00
AudioSettingsWidget* getAudioSettingsWidget() const { return m_audio_settings; }
void registerWidgetHelp(QObject* object, const char* title, const char* recommended_value, const char* text);
bool eventFilter(QObject* object, QEvent* event) override;
2019-12-31 06:17:17 +00:00
public Q_SLOTS:
void setCategory(Category category);
private Q_SLOTS:
void onCategoryCurrentRowChanged(int row);
private:
Ui::SettingsDialog m_ui;
QtHostInterface* m_host_interface;
GeneralSettingsWidget* m_general_settings = nullptr;
2020-01-24 04:50:51 +00:00
ConsoleSettingsWidget* m_console_settings = nullptr;
2020-01-05 02:46:03 +00:00
GameListSettingsWidget* m_game_list_settings = nullptr;
HotkeySettingsWidget* m_hotkey_settings = nullptr;
PortSettingsWidget* m_port_settings = nullptr;
GPUSettingsWidget* m_gpu_settings = nullptr;
2020-01-24 04:51:13 +00:00
AudioSettingsWidget* m_audio_settings = nullptr;
QObject* m_current_help_widget = nullptr;
QMap<QObject*, QString> m_widget_help_text_map;
2019-12-31 06:17:17 +00:00
};