mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-25 15:15:40 +00:00
Qt: Remove BIOS search directory from per-game settings
Rather than just disabling it and confusing the user.
This commit is contained in:
parent
b4136d2834
commit
2938602d75
|
@ -64,24 +64,33 @@ BIOSSettingsWidget::BIOSSettingsWidget(SettingsWindow* dialog, QWidget* parent)
|
||||||
|
|
||||||
connect(m_ui.refresh, &QPushButton::clicked, this, &BIOSSettingsWidget::refreshList);
|
connect(m_ui.refresh, &QPushButton::clicked, this, &BIOSSettingsWidget::refreshList);
|
||||||
|
|
||||||
m_ui.searchDirectory->setText(QString::fromStdString(EmuFolders::Bios));
|
if (!m_dialog->isPerGameSettings())
|
||||||
SettingWidgetBinder::BindWidgetToFolderSetting(sif, m_ui.searchDirectory, m_ui.browseSearchDirectory,
|
{
|
||||||
m_ui.openSearchDirectory, nullptr, "BIOS", "SearchDirectory",
|
SettingWidgetBinder::BindWidgetToFolderSetting(sif, m_ui.searchDirectory, m_ui.browseSearchDirectory,
|
||||||
Path::Combine(EmuFolders::DataRoot, "bios"));
|
m_ui.openSearchDirectory, nullptr, "BIOS", "SearchDirectory",
|
||||||
connect(m_ui.searchDirectory, &QLineEdit::textChanged, this, &BIOSSettingsWidget::refreshList);
|
Path::Combine(EmuFolders::DataRoot, "bios"));
|
||||||
|
connect(m_ui.searchDirectory, &QLineEdit::textChanged, this, &BIOSSettingsWidget::refreshList);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_ui.mainLayout->removeWidget(m_ui.directoryGroupBox);
|
||||||
|
delete m_ui.directoryGroupBox;
|
||||||
|
m_ui.directoryGroupBox = nullptr;
|
||||||
|
m_ui.directoryGroupBoxLabel = nullptr;
|
||||||
|
m_ui.directoryGroupBoxLayout = nullptr;
|
||||||
|
m_ui.directoryGroupBoxHorizontalLayout = nullptr;
|
||||||
|
m_ui.searchDirectory = nullptr;
|
||||||
|
m_ui.browseSearchDirectory = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
refreshList();
|
refreshList();
|
||||||
}
|
}
|
||||||
|
|
||||||
BIOSSettingsWidget::~BIOSSettingsWidget() = default;
|
BIOSSettingsWidget::~BIOSSettingsWidget() = default;
|
||||||
|
|
||||||
std::vector<std::pair<std::string, const BIOS::ImageInfo*>> BIOSSettingsWidget::getList(const char* directory)
|
|
||||||
{
|
|
||||||
return BIOS::FindBIOSImagesInDirectory(directory);
|
|
||||||
}
|
|
||||||
|
|
||||||
void BIOSSettingsWidget::refreshList()
|
void BIOSSettingsWidget::refreshList()
|
||||||
{
|
{
|
||||||
auto images = getList(m_ui.searchDirectory->text().toUtf8().constData());
|
auto images = BIOS::FindBIOSImagesInDirectory(EmuFolders::Bios.c_str());
|
||||||
populateDropDownForRegion(ConsoleRegion::NTSC_J, m_ui.imageNTSCJ, images, m_dialog->isPerGameSettings());
|
populateDropDownForRegion(ConsoleRegion::NTSC_J, m_ui.imageNTSCJ, images, m_dialog->isPerGameSettings());
|
||||||
populateDropDownForRegion(ConsoleRegion::NTSC_U, m_ui.imageNTSCU, images, m_dialog->isPerGameSettings());
|
populateDropDownForRegion(ConsoleRegion::NTSC_U, m_ui.imageNTSCU, images, m_dialog->isPerGameSettings());
|
||||||
populateDropDownForRegion(ConsoleRegion::PAL, m_ui.imagePAL, images, m_dialog->isPerGameSettings());
|
populateDropDownForRegion(ConsoleRegion::PAL, m_ui.imagePAL, images, m_dialog->isPerGameSettings());
|
||||||
|
|
|
@ -26,7 +26,6 @@ public:
|
||||||
std::vector<std::pair<std::string, const BIOS::ImageInfo*>>& images,
|
std::vector<std::pair<std::string, const BIOS::ImageInfo*>>& images,
|
||||||
bool per_game);
|
bool per_game);
|
||||||
static void setDropDownValue(QComboBox* cb, const std::optional<std::string>& name, bool per_game);
|
static void setDropDownValue(QComboBox* cb, const std::optional<std::string>& name, bool per_game);
|
||||||
static std::vector<std::pair<std::string, const BIOS::ImageInfo*>> getList(const char* directory);
|
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void refreshList();
|
void refreshList();
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<height>330</height>
|
<height>330</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="mainLayout">
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
|
@ -115,13 +115,13 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox_3">
|
<widget class="QGroupBox" name="directoryGroupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>BIOS Directory</string>
|
<string>BIOS Directory</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="directoryGroupBoxLayout">
|
||||||
<item row="0" column="0" colspan="2">
|
<item row="0" column="0" colspan="2">
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="directoryGroupBoxLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>DuckStation will search for BIOS images in this directory.</string>
|
<string>DuckStation will search for BIOS images in this directory.</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -131,7 +131,7 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" colspan="2">
|
<item row="1" column="0" colspan="2">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="directoryGroupBoxHorizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="searchDirectory"/>
|
<widget class="QLineEdit" name="searchDirectory"/>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -61,7 +61,7 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsWindow* dialog, QWidget
|
||||||
if (!m_dialog->isPerGameSettings())
|
if (!m_dialog->isPerGameSettings())
|
||||||
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.startFullscreen, "Main", "StartFullscreen", false);
|
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.startFullscreen, "Main", "StartFullscreen", false);
|
||||||
else
|
else
|
||||||
m_ui.startFullscreen->setEnabled(false);
|
SettingWidgetBinder::SetAvailability(m_ui.startFullscreen, false);
|
||||||
|
|
||||||
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.doubleClickTogglesFullscreen, "Main",
|
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.doubleClickTogglesFullscreen, "Main",
|
||||||
"DoubleClickTogglesFullscreen", true);
|
"DoubleClickTogglesFullscreen", true);
|
||||||
|
|
|
@ -223,7 +223,7 @@ void SetupWizardDialog::setupBIOSPage()
|
||||||
|
|
||||||
void SetupWizardDialog::refreshBiosList()
|
void SetupWizardDialog::refreshBiosList()
|
||||||
{
|
{
|
||||||
auto list = BIOSSettingsWidget::getList(m_ui.biosSearchDirectory->text().toUtf8().constData());
|
auto list = BIOS::FindBIOSImagesInDirectory(m_ui.biosSearchDirectory->text().toUtf8().constData());
|
||||||
BIOSSettingsWidget::populateDropDownForRegion(ConsoleRegion::NTSC_U, m_ui.imageNTSCU, list, false);
|
BIOSSettingsWidget::populateDropDownForRegion(ConsoleRegion::NTSC_U, m_ui.imageNTSCU, list, false);
|
||||||
BIOSSettingsWidget::populateDropDownForRegion(ConsoleRegion::NTSC_J, m_ui.imageNTSCJ, list, false);
|
BIOSSettingsWidget::populateDropDownForRegion(ConsoleRegion::NTSC_J, m_ui.imageNTSCJ, list, false);
|
||||||
BIOSSettingsWidget::populateDropDownForRegion(ConsoleRegion::PAL, m_ui.imagePAL, list, false);
|
BIOSSettingsWidget::populateDropDownForRegion(ConsoleRegion::PAL, m_ui.imagePAL, list, false);
|
||||||
|
|
Loading…
Reference in a new issue