|
|
|
@ -1,5 +1,8 @@
|
|
|
|
|
#include "consolesettingswidget.h"
|
|
|
|
|
#include "settingwidgetbinder.h"
|
|
|
|
|
#include <QtWidgets/QFileDialog>
|
|
|
|
|
|
|
|
|
|
static constexpr char BIOS_IMAGE_FILTER[] = "Binary Images (*.bin);;All Files (*.*)";
|
|
|
|
|
|
|
|
|
|
ConsoleSettingsWidget::ConsoleSettingsWidget(QtHostInterface* host_interface, QWidget* parent /* = nullptr */)
|
|
|
|
|
: QWidget(parent), m_host_interface(host_interface)
|
|
|
|
@ -14,6 +17,20 @@ ConsoleSettingsWidget::ConsoleSettingsWidget(QtHostInterface* host_interface, QW
|
|
|
|
|
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.enableSpeedLimiter,
|
|
|
|
|
"General/SpeedLimiterEnabled");
|
|
|
|
|
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.pauseOnStart, "General/StartPaused");
|
|
|
|
|
|
|
|
|
|
connect(m_ui.biosPathBrowse, &QPushButton::pressed, this, &ConsoleSettingsWidget::onBrowseBIOSPathButtonClicked);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ConsoleSettingsWidget::~ConsoleSettingsWidget() = default;
|
|
|
|
|
|
|
|
|
|
void ConsoleSettingsWidget::onBrowseBIOSPathButtonClicked()
|
|
|
|
|
{
|
|
|
|
|
QString path = QFileDialog::getOpenFileName(this, tr("Select BIOS Image"), QString(), tr(BIOS_IMAGE_FILTER));
|
|
|
|
|
if (path.isEmpty())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
m_ui.biosPath->setText(path);
|
|
|
|
|
|
|
|
|
|
m_host_interface->putSettingValue("BIOS/Path", path);
|
|
|
|
|
m_host_interface->applySettings();
|
|
|
|
|
}
|
|
|
|
|