GameList: Prevent opening Properties multiple times for the same game

This commit is contained in:
Martino Fontana
2025-06-02 14:00:06 +02:00
parent 8665b22822
commit 2de9122b5f
3 changed files with 14 additions and 1 deletions

View File

@ -566,6 +566,15 @@ void GameList::OpenProperties()
if (!game)
return;
auto property_windows = this->findChildren<PropertiesDialog*>();
auto it =
std::ranges::find(property_windows, game->GetFilePath(), &PropertiesDialog::GetFilePath);
if (it != property_windows.end())
{
(*it)->raise();
return;
}
PropertiesDialog* properties = new PropertiesDialog(this, *game);
connect(properties, &PropertiesDialog::OpenGeneralSettings, this, &GameList::OpenGeneralSettings);