GH-1874 Do not allow launching instances during an update

This commit is contained in:
Petr Mrázek
2017-05-02 23:29:47 +02:00
parent 6a8bb3691b
commit 907aa36704
3 changed files with 21 additions and 1 deletions

View File

@ -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());