summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 0f6d7048..275845e2 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -377,13 +377,30 @@ MOBase::IPluginGame *determineCurrentGame(QString const &moPath, QSettings &sett
if (!gamePath.isEmpty()) {
QDir gameDir(gamePath);
+ QList<IPluginGame *> possibleGames;
for (IPluginGame * const game : plugins.plugins<IPluginGame>()) {
if (game->looksValid(gameDir)) {
- return selectGame(settings, gameDir, game);
+ possibleGames.append(game);
+ //return selectGame(settings, gameDir, game);
+ }
+ }
+ if (possibleGames.count() > 1) {
+ SelectionDialog browseSelection(QObject::tr("Please select the game to manage"), nullptr, QSize(32, 32));
+ for (IPluginGame *game : possibleGames) {
+ QString path = game->gameDirectory().absolutePath();
+ browseSelection.addChoice(game->gameIcon(), game->gameName(), path, QVariant::fromValue(game));
}
+ if (browseSelection.exec() == QDialog::Accepted) {
+ return selectGame(settings, gameDir, browseSelection.getChoiceData().value<IPluginGame *>());
+ } else {
+ reportError(QObject::tr("Canceled finding game in \"%1\".").arg(gamePath));
+ }
+ } else if(possibleGames.count() == 1) {
+ return selectGame(settings, gameDir, possibleGames[0]);
+ } else {
+ reportError(QObject::tr("No game identified in \"%1\". The directory is required to contain "
+ "the game binary.").arg(gamePath));
}
- reportError(QObject::tr("No game identified in \"%1\". The directory is required to contain "
- "the game binary.").arg(gamePath));
}
}