2019-12-31 06:17:17 +00:00
|
|
|
#include "settingsdialog.h"
|
2020-01-24 04:51:13 +00:00
|
|
|
#include "audiosettingswidget.h"
|
2019-12-31 06:17:17 +00:00
|
|
|
#include "consolesettingswidget.h"
|
|
|
|
#include "gamelistsettingswidget.h"
|
2020-01-03 07:51:58 +00:00
|
|
|
#include "gpusettingswidget.h"
|
2020-01-05 02:46:03 +00:00
|
|
|
#include "hotkeysettingswidget.h"
|
2020-01-02 06:13:03 +00:00
|
|
|
#include "portsettingswidget.h"
|
2019-12-31 06:17:17 +00:00
|
|
|
#include "qthostinterface.h"
|
|
|
|
#include <QtWidgets/QTextEdit>
|
|
|
|
|
|
|
|
SettingsDialog::SettingsDialog(QtHostInterface* host_interface, QWidget* parent /* = nullptr */)
|
|
|
|
: QDialog(parent), m_host_interface(host_interface)
|
|
|
|
{
|
|
|
|
m_ui.setupUi(this);
|
|
|
|
|
2020-01-24 04:50:51 +00:00
|
|
|
m_console_settings = new ConsoleSettingsWidget(host_interface, m_ui.settingsContainer);
|
2019-12-31 06:17:17 +00:00
|
|
|
m_game_list_settings = new GameListSettingsWidget(host_interface, m_ui.settingsContainer);
|
2020-01-05 02:46:03 +00:00
|
|
|
m_hotkey_settings = new HotkeySettingsWidget(host_interface, m_ui.settingsContainer);
|
2020-01-02 06:13:03 +00:00
|
|
|
m_port_settings = new PortSettingsWidget(host_interface, m_ui.settingsContainer);
|
2020-01-03 07:51:58 +00:00
|
|
|
m_gpu_settings = new GPUSettingsWidget(host_interface, m_ui.settingsContainer);
|
2020-01-24 04:51:13 +00:00
|
|
|
m_audio_settings = new AudioSettingsWidget(host_interface, m_ui.settingsContainer);
|
2019-12-31 06:17:17 +00:00
|
|
|
|
2020-01-24 04:50:51 +00:00
|
|
|
m_ui.settingsContainer->insertWidget(0, m_console_settings);
|
|
|
|
m_ui.settingsContainer->insertWidget(1, m_game_list_settings);
|
|
|
|
m_ui.settingsContainer->insertWidget(2, m_hotkey_settings);
|
2020-01-05 02:46:03 +00:00
|
|
|
m_ui.settingsContainer->insertWidget(3, m_port_settings);
|
|
|
|
m_ui.settingsContainer->insertWidget(4, m_gpu_settings);
|
|
|
|
m_ui.settingsContainer->insertWidget(5, m_audio_settings);
|
2019-12-31 06:17:17 +00:00
|
|
|
|
|
|
|
m_ui.settingsCategory->setCurrentRow(0);
|
|
|
|
m_ui.settingsContainer->setCurrentIndex(0);
|
|
|
|
connect(m_ui.settingsCategory, &QListWidget::currentRowChanged, this, &SettingsDialog::onCategoryCurrentRowChanged);
|
|
|
|
}
|
|
|
|
|
|
|
|
SettingsDialog::~SettingsDialog() = default;
|
|
|
|
|
|
|
|
void SettingsDialog::setCategory(Category category)
|
|
|
|
{
|
|
|
|
if (category >= Category::Count)
|
|
|
|
return;
|
|
|
|
|
|
|
|
m_ui.settingsCategory->setCurrentRow(static_cast<int>(category));
|
|
|
|
}
|
|
|
|
|
|
|
|
void SettingsDialog::onCategoryCurrentRowChanged(int row)
|
|
|
|
{
|
|
|
|
m_ui.settingsContainer->setCurrentIndex(row);
|
|
|
|
}
|