From 412855ae3d967ff81a383688397c4d9448a4ee15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 30 Oct 2016 02:37:38 +0100 Subject: NOISSUE refactor window management and launch, make MultiMC a single instance application. --- application/LaunchController.cpp | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'application/LaunchController.cpp') 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(m_parentWidget); - auto instanceWindow = qobject_cast(m_parentWidget); - if(mainWindow) + auto console = qobject_cast(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); -- cgit v1.2.3