From 3cfa7bbe74e0f72a08a6f9f1c366f4ed21aca6d5 Mon Sep 17 00:00:00 2001 From: Chris Bessent Date: Fri, 10 Jan 2020 16:55:19 -0700 Subject: Don't ask for the game when there's only one game --- src/downloadmanager.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index fa2c959c..34eebf0c 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -951,13 +951,20 @@ void DownloadManager::queryInfo(int index) SelectionDialog selection(tr("Please select the source game code for %1").arg(getFileName(index))); std::vector> choices = m_NexusInterface->getGameChoices(m_ManagedGame); - for (auto choice : choices) { - selection.addChoice(choice.first, choice.second, choice.first); + if (choices.size() == 1) + { + info->m_FileInfo->gameName = choices[0].first; } - if (selection.exec() == QDialog::Accepted) { - info->m_FileInfo->gameName = selection.getChoiceData().toString(); - } else { - info->m_FileInfo->gameName = m_ManagedGame->gameShortName(); + else { + for (auto choice : choices) { + selection.addChoice(choice.first, choice.second, choice.first); + } + if (selection.exec() == QDialog::Accepted) { + info->m_FileInfo->gameName = selection.getChoiceData().toString(); + } + else { + info->m_FileInfo->gameName = m_ManagedGame->gameShortName(); + } } } info->m_ReQueried = true; -- cgit v1.3.1