Qt: Allow to add iso files from menu

This commit is contained in:
Megamouse 2026-01-10 06:58:59 +01:00
parent f2afdee40c
commit 41a5c69db4
2 changed files with 22 additions and 0 deletions

View file

@ -2531,6 +2531,22 @@ void main_window::CreateConnects()
AddGamesFromDirs(std::move(paths));
});
connect(ui->addIsoGamesAct, &QAction::triggered, this, [this]()
{
if (!m_gui_settings->GetBootConfirmation(this))
{
return;
}
QStringList paths = QFileDialog::getOpenFileNames(this, tr("Select ISO files to add"), QString::fromStdString(fs::get_config_dir()), tr("ISO files (*.iso);;All files (*.*)"));
if (paths.isEmpty())
{
return;
}
AddGamesFromDirs(std::move(paths));
});
connect(ui->bootRecentMenu, &QMenu::aboutToShow, this, [this]()
{
// Enable/Disable Recent Games List

View file

@ -218,6 +218,7 @@
<addaction name="bootRecentMenu"/>
<addaction name="separator"/>
<addaction name="addGamesAct"/>
<addaction name="addIsoGamesAct"/>
<addaction name="bootInstallPkgAct"/>
<addaction name="bootInstallPupAct"/>
<addaction name="separator"/>
@ -1513,6 +1514,11 @@
<string>Download Update</string>
</property>
</action>
<action name="addIsoGamesAct">
<property name="text">
<string>Add ISO Games</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources>