Qt: Allow to boot iso files from menu

This commit is contained in:
Megamouse 2026-01-10 07:06:09 +01:00
parent 41a5c69db4
commit 6bd4f52173
3 changed files with 36 additions and 1 deletions

View file

@ -700,6 +700,34 @@ void main_window::BootGame()
Boot(dir_path.toStdString(), "", false, true);
}
void main_window::BootISO()
{
bool stopped = false;
if (Emu.IsRunning())
{
Emu.Pause();
stopped = true;
}
const QString path_last_game = m_gui_settings->GetValue(gui::fd_boot_game).toString();
const QString path = QFileDialog::getOpenFileName(this, tr("Select ISO"), path_last_game, tr("ISO files (*.iso);;All files (*.*)"));
if (path.isEmpty())
{
if (stopped)
{
Emu.Resume();
}
return;
}
m_gui_settings->SetValue(gui::fd_boot_game, QFileInfo(path).dir().path());
gui_log.notice("Booting from BootISO...");
Boot(path.toStdString(), "", true, true);
}
void main_window::BootVSH()
{
gui_log.notice("Booting from BootVSH...");
@ -2479,6 +2507,7 @@ void main_window::CreateConnects()
connect(ui->bootElfAct, &QAction::triggered, this, &main_window::BootElf);
connect(ui->bootTestAct, &QAction::triggered, this, &main_window::BootTest);
connect(ui->bootGameAct, &QAction::triggered, this, &main_window::BootGame);
connect(ui->bootIsoAct, &QAction::triggered, this, &main_window::BootISO);
connect(ui->bootVSHAct, &QAction::triggered, this, &main_window::BootVSH);
connect(ui->actionopen_rsx_capture, &QAction::triggered, this, [this](){ BootRsxCapture(); });
connect(ui->actionCreate_RSX_Capture, &QAction::triggered, this, []()

View file

@ -104,6 +104,7 @@ private Q_SLOTS:
void BootElf();
void BootTest();
void BootGame();
void BootISO();
void BootVSH();
void BootSavestate();
void BootRsxCapture(std::string path = "");

View file

@ -62,7 +62,6 @@
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
@ -211,6 +210,7 @@
<addaction name="separator"/>
</widget>
<addaction name="bootGameAct"/>
<addaction name="bootIsoAct"/>
<addaction name="bootVSHAct"/>
<addaction name="bootElfMenu"/>
<addaction name="bootSavestateAct"/>
@ -1519,6 +1519,11 @@
<string>Add ISO Games</string>
</property>
</action>
<action name="bootIsoAct">
<property name="text">
<string>Boot ISO</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources>