summaryrefslogtreecommitdiffstats
path: root/application/InstanceWindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'application/InstanceWindow.cpp')
-rw-r--r--application/InstanceWindow.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/application/InstanceWindow.cpp b/application/InstanceWindow.cpp
index 9fdd3ca8..7b3e1d10 100644
--- a/application/InstanceWindow.cpp
+++ b/application/InstanceWindow.cpp
@@ -162,7 +162,7 @@ void InstanceWindow::closeEvent(QCloseEvent *event)
bool proceed = true;
if(!m_doNotSave)
{
- proceed &= m_container->requestClose(event);
+ proceed &= m_container->prepareToClose();
}
if(!proceed)
@@ -181,6 +181,11 @@ void InstanceWindow::closeEvent(QCloseEvent *event)
}
}
+bool InstanceWindow::saveAll()
+{
+ return m_container->prepareToClose();
+}
+
void InstanceWindow::on_btnKillMinecraft_clicked()
{
if(m_instance->isRunning())
@@ -195,7 +200,8 @@ void InstanceWindow::on_btnKillMinecraft_clicked()
m_proc->abort();
}
}
- else
+ // FIXME: duplicate logic between MainWindow and InstanceWindow
+ else if(saveAll())
{
m_launchController.reset(new LaunchController());
m_launchController->setInstance(m_instance);
@@ -207,7 +213,7 @@ void InstanceWindow::on_btnKillMinecraft_clicked()
void InstanceWindow::onSucceeded()
{
- if (m_instance->settings()->get("AutoCloseConsole").toBool() && m_container->requestClose(nullptr))
+ if (m_instance->settings()->get("AutoCloseConsole").toBool() && m_container->prepareToClose())
{
this->close();
return;