summaryrefslogtreecommitdiffstats
path: root/application/InstanceWindow.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-10-28 03:36:29 +0200
committerPetr Mrázek <peterix@gmail.com>2016-10-28 03:42:34 +0200
commit8731318fefad35acb8a2df408ef809dead1c7c07 (patch)
tree73faa6aa84e4562c63ae69b3b1241c2cc2189521 /application/InstanceWindow.cpp
parentdd0e996081ae820a0f16b5a6854a8a6274c5edf5 (diff)
downloadMultiMC-8731318fefad35acb8a2df408ef809dead1c7c07.tar
MultiMC-8731318fefad35acb8a2df408ef809dead1c7c07.tar.gz
MultiMC-8731318fefad35acb8a2df408ef809dead1c7c07.tar.lz
MultiMC-8731318fefad35acb8a2df408ef809dead1c7c07.tar.xz
MultiMC-8731318fefad35acb8a2df408ef809dead1c7c07.zip
GH-1652 save all instance settings on launch if instance window is already open
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;