summaryrefslogtreecommitdiffstats
path: root/application/MainWindow.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/MainWindow.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/MainWindow.cpp')
-rw-r--r--application/MainWindow.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp
index 3a297784..e07686dd 100644
--- a/application/MainWindow.cpp
+++ b/application/MainWindow.cpp
@@ -1463,6 +1463,15 @@ void MainWindow::launch(InstancePtr instance, bool online, BaseProfilerFactory *
{
if(instance->canLaunch())
{
+ // FIXME: duplicate logic between MainWindow and InstanceWindow
+ auto window = m_instanceWindows.find(instance->id());
+ if(window != m_instanceWindows.end())
+ {
+ if(!(*window)->saveAll())
+ {
+ return;
+ }
+ }
m_launchController.reset(new LaunchController());
m_launchController->setInstance(instance);
m_launchController->setOnline(online);