summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2025-06-07 17:24:50 +0200
committerGitHub <noreply@github.com>2025-06-07 17:24:50 +0200
commit1b1ca019a4523ab798be40cf01b856d7e8b3d700 (patch)
treeed10eed9a657b62ffc8d003aa334d6b3d9547cb2 /Source/Core
parent185b080f0388c4e39c4c5669f9ae13ddad4c3e63 (diff)
parent2de9122b5f19e8f0c25762e431a7254999a07177 (diff)
Merge pull request #13724 from SuperSamus/gamelist-properties-noduplicates
GameList: Prevent opening Properties multiple times for the same game
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinQt/Config/PropertiesDialog.cpp2
-rw-r--r--Source/Core/DolphinQt/Config/PropertiesDialog.h4
-rw-r--r--Source/Core/DolphinQt/GameList/GameList.cpp9
3 files changed, 14 insertions, 1 deletions
diff --git a/Source/Core/DolphinQt/Config/PropertiesDialog.cpp b/Source/Core/DolphinQt/Config/PropertiesDialog.cpp
index f95edf40c6..7957380bbe 100644
--- a/Source/Core/DolphinQt/Config/PropertiesDialog.cpp
+++ b/Source/Core/DolphinQt/Config/PropertiesDialog.cpp
@@ -25,7 +25,7 @@
#include "UICommon/GameFile.h"
PropertiesDialog::PropertiesDialog(QWidget* parent, const UICommon::GameFile& game)
- : StackedSettingsWindow{parent}
+ : StackedSettingsWindow{parent}, m_filepath(game.GetFilePath())
{
setWindowTitle(QStringLiteral("%1: %2 - %3")
.arg(QString::fromStdString(game.GetFileName()),
diff --git a/Source/Core/DolphinQt/Config/PropertiesDialog.h b/Source/Core/DolphinQt/Config/PropertiesDialog.h
index 9079ed925a..3d8236bbe4 100644
--- a/Source/Core/DolphinQt/Config/PropertiesDialog.h
+++ b/Source/Core/DolphinQt/Config/PropertiesDialog.h
@@ -17,6 +17,7 @@ class PropertiesDialog final : public StackedSettingsWindow
Q_OBJECT
public:
explicit PropertiesDialog(QWidget* parent, const UICommon::GameFile& game);
+ const std::string& GetFilePath() const { return m_filepath; }
signals:
void OpenGeneralSettings();
@@ -24,4 +25,7 @@ signals:
#ifdef USE_RETRO_ACHIEVEMENTS
void OpenAchievementSettings();
#endif // USE_RETRO_ACHIEVEMENTS
+
+private:
+ const std::string m_filepath;
};
diff --git a/Source/Core/DolphinQt/GameList/GameList.cpp b/Source/Core/DolphinQt/GameList/GameList.cpp
index 81805c219d..7ec2f1f263 100644
--- a/Source/Core/DolphinQt/GameList/GameList.cpp
+++ b/Source/Core/DolphinQt/GameList/GameList.cpp
@@ -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);