diff options
author | Petr Mrázek <peterix@gmail.com> | 2016-10-30 02:37:38 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2016-10-30 02:37:38 +0100 |
commit | 412855ae3d967ff81a383688397c4d9448a4ee15 (patch) | |
tree | 78d6225067f39a2696dfb9ca0d40eaed237fe9ee /application/LaunchController.cpp | |
parent | deabfa78f8e66d1af40d0ecfd787d034cffd5431 (diff) | |
download | MultiMC-412855ae3d967ff81a383688397c4d9448a4ee15.tar MultiMC-412855ae3d967ff81a383688397c4d9448a4ee15.tar.gz MultiMC-412855ae3d967ff81a383688397c4d9448a4ee15.tar.lz MultiMC-412855ae3d967ff81a383688397c4d9448a4ee15.tar.xz MultiMC-412855ae3d967ff81a383688397c4d9448a4ee15.zip |
NOISSUE refactor window management and launch, make MultiMC a single instance application.
Diffstat (limited to 'application/LaunchController.cpp')
-rw-r--r-- | application/LaunchController.cpp | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/application/LaunchController.cpp b/application/LaunchController.cpp index bc7f976a..4dce6708 100644 --- a/application/LaunchController.cpp +++ b/application/LaunchController.cpp @@ -205,21 +205,10 @@ void LaunchController::launchInstance() return; } - auto mainWindow = qobject_cast<MainWindow *>(m_parentWidget); - auto instanceWindow = qobject_cast<InstanceWindow *>(m_parentWidget); - if(mainWindow) + auto console = qobject_cast<InstanceWindow *>(m_parentWidget); + if(!console) { - m_console = mainWindow->showInstanceWindow(m_instance); - } - else if(instanceWindow) - { - // NOOP - } - else - { - // this is used when launching directly from command line - m_console = new InstanceWindow(m_instance); - m_console->setQuitOnClose(true); + MMC->showInstanceWindow(m_instance); } connect(m_launcher.get(), &LaunchTask::readyForLaunch, this, &LaunchController::readyForLaunch); |