2019-12-31 06:17:17 +00:00
|
|
|
#pragma once
|
|
|
|
#include "ui_settingsdialog.h"
|
2020-03-22 03:16:56 +00:00
|
|
|
#include <QtCore/QMap>
|
2020-07-28 09:32:07 +00:00
|
|
|
#include <QtCore/QString>
|
2020-01-05 02:46:03 +00:00
|
|
|
#include <QtWidgets/QDialog>
|
2020-07-28 09:32:07 +00:00
|
|
|
#include <array>
|
2019-12-31 06:17:17 +00:00
|
|
|
|
|
|
|
class QtHostInterface;
|
|
|
|
|
2020-03-22 03:16:32 +00:00
|
|
|
class GeneralSettingsWidget;
|
2020-09-22 13:08:07 +00:00
|
|
|
class BIOSSettingsWidget;
|
2020-01-05 02:46:03 +00:00
|
|
|
class GameListSettingsWidget;
|
|
|
|
class HotkeySettingsWidget;
|
2019-12-31 06:17:17 +00:00
|
|
|
class ConsoleSettingsWidget;
|
2021-01-23 07:33:36 +00:00
|
|
|
class EmulationSettingsWidget;
|
2020-05-20 13:26:24 +00:00
|
|
|
class ControllerSettingsWidget;
|
|
|
|
class MemoryCardSettingsWidget;
|
2020-09-10 14:18:12 +00:00
|
|
|
class DisplaySettingsWidget;
|
|
|
|
class EnhancementSettingsWidget;
|
2020-09-13 12:24:20 +00:00
|
|
|
class PostProcessingSettingsWidget;
|
2020-01-24 04:51:13 +00:00
|
|
|
class AudioSettingsWidget;
|
2020-04-30 14:59:31 +00:00
|
|
|
class AdvancedSettingsWidget;
|
2019-12-31 06:17:17 +00:00
|
|
|
|
2020-03-22 03:16:56 +00:00
|
|
|
class SettingsDialog final : public QDialog
|
2019-12-31 06:17:17 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
enum class Category
|
|
|
|
{
|
2020-03-22 03:16:32 +00:00
|
|
|
GeneralSettings,
|
2020-09-22 13:08:07 +00:00
|
|
|
BIOSSettings,
|
2020-01-24 04:50:51 +00:00
|
|
|
ConsoleSettings,
|
2021-01-23 07:33:36 +00:00
|
|
|
EmulationSettings,
|
2019-12-31 06:17:17 +00:00
|
|
|
GameListSettings,
|
2020-01-05 02:46:03 +00:00
|
|
|
HotkeySettings,
|
2020-05-20 13:26:24 +00:00
|
|
|
ControllerSettings,
|
|
|
|
MemoryCardSettings,
|
2020-09-10 14:18:12 +00:00
|
|
|
DisplaySettings,
|
|
|
|
EnhancementSettings,
|
2020-09-13 12:24:20 +00:00
|
|
|
PostProcessingSettings,
|
2019-12-31 06:17:17 +00:00
|
|
|
AudioSettings,
|
2020-04-30 14:59:31 +00:00
|
|
|
AdvancedSettings,
|
2019-12-31 06:17:17 +00:00
|
|
|
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();
|
|
|
|
|
2020-03-22 03:16:32 +00:00
|
|
|
GeneralSettingsWidget* getGeneralSettingsWidget() const { return m_general_settings; }
|
2020-09-22 13:08:07 +00:00
|
|
|
BIOSSettingsWidget* getBIOSSettingsWidget() const { return m_bios_settings; }
|
2020-01-24 04:50:53 +00:00
|
|
|
ConsoleSettingsWidget* getConsoleSettingsWidget() const { return m_console_settings; }
|
2021-01-23 07:33:36 +00:00
|
|
|
EmulationSettingsWidget* getEmulationSettingsWidget() const { return m_emulation_settings; }
|
2020-01-24 04:50:53 +00:00
|
|
|
GameListSettingsWidget* getGameListSettingsWidget() const { return m_game_list_settings; }
|
|
|
|
HotkeySettingsWidget* getHotkeySettingsWidget() const { return m_hotkey_settings; }
|
2020-05-20 13:26:24 +00:00
|
|
|
ControllerSettingsWidget* getControllerSettingsWidget() const { return m_controller_settings; }
|
|
|
|
MemoryCardSettingsWidget* getMemoryCardSettingsWidget() const { return m_memory_card_settings; }
|
2020-09-10 14:18:12 +00:00
|
|
|
DisplaySettingsWidget* getDisplaySettingsWidget() const { return m_display_settings; }
|
|
|
|
EnhancementSettingsWidget* getEnhancementSettingsWidget() const { return m_enhancement_settings; }
|
2020-01-24 04:51:13 +00:00
|
|
|
AudioSettingsWidget* getAudioSettingsWidget() const { return m_audio_settings; }
|
2020-04-30 14:59:31 +00:00
|
|
|
AdvancedSettingsWidget* getAdvancedSettingsWidget() const { return m_advanced_settings; }
|
2020-09-13 12:24:20 +00:00
|
|
|
PostProcessingSettingsWidget* getPostProcessingSettingsWidget() { return m_post_processing_settings; }
|
2020-01-24 04:50:53 +00:00
|
|
|
|
2020-07-28 09:42:14 +00:00
|
|
|
void registerWidgetHelp(QObject* object, QString title, QString recommended_value, QString text);
|
2020-03-22 03:16:56 +00:00
|
|
|
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:
|
2020-07-28 09:32:07 +00:00
|
|
|
void setCategoryHelpTexts();
|
|
|
|
|
2019-12-31 06:17:17 +00:00
|
|
|
Ui::SettingsDialog m_ui;
|
|
|
|
|
|
|
|
QtHostInterface* m_host_interface;
|
|
|
|
|
2020-03-22 03:16:32 +00:00
|
|
|
GeneralSettingsWidget* m_general_settings = nullptr;
|
2020-09-22 13:08:07 +00:00
|
|
|
BIOSSettingsWidget* m_bios_settings = nullptr;
|
2020-01-24 04:50:51 +00:00
|
|
|
ConsoleSettingsWidget* m_console_settings = nullptr;
|
2021-01-23 07:33:36 +00:00
|
|
|
EmulationSettingsWidget* m_emulation_settings = nullptr;
|
2020-01-05 02:46:03 +00:00
|
|
|
GameListSettingsWidget* m_game_list_settings = nullptr;
|
|
|
|
HotkeySettingsWidget* m_hotkey_settings = nullptr;
|
2020-05-20 13:26:24 +00:00
|
|
|
ControllerSettingsWidget* m_controller_settings = nullptr;
|
|
|
|
MemoryCardSettingsWidget* m_memory_card_settings = nullptr;
|
2020-09-10 14:18:12 +00:00
|
|
|
DisplaySettingsWidget* m_display_settings = nullptr;
|
|
|
|
EnhancementSettingsWidget* m_enhancement_settings = nullptr;
|
2020-09-22 13:08:07 +00:00
|
|
|
PostProcessingSettingsWidget* m_post_processing_settings = nullptr;
|
2020-01-24 04:51:13 +00:00
|
|
|
AudioSettingsWidget* m_audio_settings = nullptr;
|
2020-04-30 14:59:31 +00:00
|
|
|
AdvancedSettingsWidget* m_advanced_settings = nullptr;
|
2020-03-22 03:16:56 +00:00
|
|
|
|
2020-07-28 09:32:07 +00:00
|
|
|
std::array<QString, static_cast<int>(Category::Count)> m_category_help_text;
|
|
|
|
|
2020-03-22 03:16:56 +00:00
|
|
|
QObject* m_current_help_widget = nullptr;
|
|
|
|
QMap<QObject*, QString> m_widget_help_text_map;
|
2019-12-31 06:17:17 +00:00
|
|
|
};
|