Qt: add option to add games to the main menu

This commit is contained in:
Megamouse 2018-10-27 02:17:43 +02:00
parent 586c0ea1d0
commit 1cf62e9ded
2 changed files with 23 additions and 0 deletions

View File

@ -1163,6 +1163,22 @@ void main_window::CreateConnects()
connect(ui->bootGameAct, &QAction::triggered, this, &main_window::BootGame);
connect(ui->actionopen_rsx_capture, &QAction::triggered, [this](){ BootRsxCapture(); });
connect(ui->addGamesAct, &QAction::triggered, [this]() {
QStringList paths;
// Only select one folder for now
paths << QFileDialog::getExistingDirectory(this, tr("Select a folder containing one or more games"), qstr(fs::get_config_dir()), QFileDialog::ShowDirsOnly);
if (!paths.isEmpty())
{
for (const QString& path : paths)
{
AddGamesFromDir(path);
}
m_gameListFrame->Refresh(true);
}
});
connect(ui->bootRecentMenu, &QMenu::aboutToShow, [=]
{
// Enable/Disable Recent Games List

View File

@ -169,6 +169,8 @@
<addaction name="bootGameAct"/>
<addaction name="bootRecentMenu"/>
<addaction name="separator"/>
<addaction name="addGamesAct"/>
<addaction name="separator"/>
<addaction name="bootInstallPkgAct"/>
<addaction name="bootInstallPupAct"/>
<addaction name="separator"/>
@ -913,6 +915,11 @@
<string>Open RSX Capture</string>
</property>
</action>
<action name="addGamesAct">
<property name="text">
<string>Add Games</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources>