diff options
author | Bastien Bouclet | 2019-05-03 20:48:06 +0200 |
---|---|---|
committer | Filippos Karapetis | 2019-05-12 11:44:51 +0300 |
commit | c5b92bcb2eae79b13991b51954b46f06fa9e5bf2 (patch) | |
tree | 32bbffdad2533aa2e786d9367c63e3aad294d51b /gui/launcher.cpp | |
parent | e2f68e24035245ec0f453c49b28207d32def4789 (diff) | |
download | scummvm-rg350-c5b92bcb2eae79b13991b51954b46f06fa9e5bf2.tar.gz scummvm-rg350-c5b92bcb2eae79b13991b51954b46f06fa9e5bf2.tar.bz2 scummvm-rg350-c5b92bcb2eae79b13991b51954b46f06fa9e5bf2.zip |
GUI: Better integration for the unknown game dialog when adding games
* The list of candidates now includes unknown variants. When an unknown
variant is selected, the unknown game dialog is shown.
* On the unknown game dialog, users are given the choice to add the game
when that is possible, or to cancel.
The goal of those changes is to make the unknown game dialog less
confusing for users, especially when both known and unknown games
variants are found.
Diffstat (limited to 'gui/launcher.cpp')
-rw-r--r-- | gui/launcher.cpp | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 14e0e96a3b..b09f650fc9 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -563,12 +563,9 @@ bool LauncherDialog::doGameDetection(const Common::String &path) { if (detectionResults.foundUnknownGames()) { Common::String report = detectionResults.generateUnknownGameReport(false, 80); g_system->logMessage(LogMessageType::kInfo, report.c_str()); - - UnknownGameDialog dialog(detectionResults); - dialog.runModal(); } - Common::Array<DetectedGame> candidates = detectionResults.listRecognizedGames(); + Common::Array<DetectedGame> candidates = detectionResults.listDetectedGames(); int idx; if (candidates.empty()) { @@ -583,16 +580,37 @@ bool LauncherDialog::doGameDetection(const Common::String &path) { } else { // Display the candidates to the user and let her/him pick one StringArray list; - for (idx = 0; idx < (int)candidates.size(); idx++) - list.push_back(candidates[idx].description); + for (idx = 0; idx < (int)candidates.size(); idx++) { + Common::String description = candidates[idx].description; + + if (candidates[idx].hasUnknownFiles) { + description += " - "; + description += _("Unknown variant"); + } + + list.push_back(description); + } ChooserDialog dialog(_("Pick the game:")); dialog.setList(list); idx = dialog.runModal(); } + if (0 <= idx && idx < (int)candidates.size()) { const DetectedGame &result = candidates[idx]; + if (result.hasUnknownFiles) { + UnknownGameDialog dialog(result); + + bool cancel = dialog.runModal() == -1; + if (cancel) { + idx = -1; + } + } + } + + if (0 <= idx && idx < (int)candidates.size()) { + const DetectedGame &result = candidates[idx]; Common::String domain = EngineMan.createTargetForGame(result); // Display edit dialog for the new entry |