diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-05-02 23:29:47 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-05-02 23:29:47 +0200 |
commit | 907aa367046bde6ad05893917cff11320019ddda (patch) | |
tree | c937c84bb16ae224b38a0ca9b6f489bf8ee1580b /application/MultiMC.cpp | |
parent | 6a8bb3691b9e30bcb90003eead34b287010cf17f (diff) | |
download | MultiMC-907aa367046bde6ad05893917cff11320019ddda.tar MultiMC-907aa367046bde6ad05893917cff11320019ddda.tar.gz MultiMC-907aa367046bde6ad05893917cff11320019ddda.tar.lz MultiMC-907aa367046bde6ad05893917cff11320019ddda.tar.xz MultiMC-907aa367046bde6ad05893917cff11320019ddda.zip |
GH-1874 Do not allow launching instances during an update
Diffstat (limited to 'application/MultiMC.cpp')
-rw-r--r-- | application/MultiMC.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/application/MultiMC.cpp b/application/MultiMC.cpp index 6d83fd07..d9d59aa6 100644 --- a/application/MultiMC.cpp +++ b/application/MultiMC.cpp @@ -939,7 +939,11 @@ bool MultiMC::openJsonEditor(const QString &filename) bool MultiMC::launch(InstancePtr instance, bool online, BaseProfilerFactory *profiler) { - if(instance->canLaunch()) + if(m_updateRunning) + { + qDebug() << "Cannot launch instances while an update is running."; + } + else if(instance->canLaunch()) { auto & extras = m_instanceExtras[instance->id()]; auto & window = extras.window; @@ -1027,6 +1031,12 @@ bool MultiMC::updatesAreAllowed() return m_runningInstances == 0; } +void MultiMC::updateIsRunning(bool running) +{ + m_updateRunning = running; +} + + void MultiMC::controllerSucceeded() { auto controller = qobject_cast<LaunchController *>(QObject::sender()); |