summaryrefslogtreecommitdiff
path: root/src/organizercore.cpp
diff options
context:
space:
mode:
authorAl <gabriel.cortesi@outlook.com>2019-02-16 20:41:27 +0100
committerGitHub <noreply@github.com>2019-02-16 20:41:27 +0100
commitee266e52209fc9fce32031fd5ae0c9703b64cada (patch)
treeadf38e2c6e7baebd1cf56011567ad733d7a363c1 /src/organizercore.cpp
parentc19ba153376f5d8f4026a46701bb0f7c115c1651 (diff)
parentd0a6321a39a4b8511dc36e5023c8787cfa1356dc (diff)
Merge pull request #655 from przester/double-install-fix
Reject new mod installations if another one is already running
Diffstat (limited to 'src/organizercore.cpp')
-rw-r--r--src/organizercore.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/organizercore.cpp b/src/organizercore.cpp
index 4dceefbf..a668de6b 100644
--- a/src/organizercore.cpp
+++ b/src/organizercore.cpp
@@ -988,6 +988,13 @@ MOBase::IModInterface *OrganizerCore::installMod(const QString &fileName,
return nullptr;
}
+ if (m_InstallationManager.isRunning()) {
+ QMessageBox::information(
+ qApp->activeWindow(), tr("Installation cancelled"),
+ tr("Another installation is currently in progress."), QMessageBox::Ok);
+ return nullptr;
+ }
+
bool hasIniTweaks = false;
GuessedValue<QString> modName;
if (!initModName.isEmpty()) {
@@ -1029,6 +1036,13 @@ MOBase::IModInterface *OrganizerCore::installMod(const QString &fileName,
void OrganizerCore::installDownload(int index)
{
+ if (m_InstallationManager.isRunning()) {
+ QMessageBox::information(
+ qApp->activeWindow(), tr("Installation cancelled"),
+ tr("Another installation is currently in progress."), QMessageBox::Ok);
+ return;
+ }
+
try {
QString fileName = m_DownloadManager.getFilePath(index);
QString gameName = m_DownloadManager.getGameName(index);