diff options
author | Petr Mrázek <peterix@gmail.com> | 2016-11-01 01:25:04 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2016-11-01 01:25:04 +0100 |
commit | fe68d5946073d92bc585b2b5372c420218807c91 (patch) | |
tree | d85c710d4f3844e8ab04e94575f6244c151f4bd5 /application/InstanceWindow.cpp | |
parent | 4b03dfcbd77f50d1f8fa3eb9d661ebcba764b9ba (diff) | |
download | MultiMC-fe68d5946073d92bc585b2b5372c420218807c91.tar MultiMC-fe68d5946073d92bc585b2b5372c420218807c91.tar.gz MultiMC-fe68d5946073d92bc585b2b5372c420218807c91.tar.lz MultiMC-fe68d5946073d92bc585b2b5372c420218807c91.tar.xz MultiMC-fe68d5946073d92bc585b2b5372c420218807c91.zip |
GH-1645 reimplement open/close instance window based on settings
Diffstat (limited to 'application/InstanceWindow.cpp')
-rw-r--r-- | application/InstanceWindow.cpp | 49 |
1 files changed, 2 insertions, 47 deletions
diff --git a/application/InstanceWindow.cpp b/application/InstanceWindow.cpp index 1c7731bd..f76ae18d 100644 --- a/application/InstanceWindow.cpp +++ b/application/InstanceWindow.cpp @@ -90,10 +90,8 @@ InstanceWindow::InstanceWindow(InstancePtr instance, QWidget *parent) { auto launchTask = m_instance->getLaunchTask(); on_InstanceLaunchTask_changed(launchTask); - connect(m_instance.get(), &BaseInstance::launchTaskChanged, - this, &InstanceWindow::on_InstanceLaunchTask_changed); - connect(m_instance.get(), &BaseInstance::runningStatusChanged, - this, &InstanceWindow::on_RunningState_changed); + connect(m_instance.get(), &BaseInstance::launchTaskChanged, this, &InstanceWindow::on_InstanceLaunchTask_changed); + connect(m_instance.get(), &BaseInstance::runningStatusChanged, this, &InstanceWindow::on_RunningState_changed); } // set up instance destruction detection @@ -128,22 +126,7 @@ void InstanceWindow::setKillButton(bool kill) void InstanceWindow::on_InstanceLaunchTask_changed(std::shared_ptr<LaunchTask> proc) { - if(m_proc) - { - disconnect(m_proc.get(), &LaunchTask::succeeded, this, &InstanceWindow::onSucceeded); - disconnect(m_proc.get(), &LaunchTask::failed, this, &InstanceWindow::onFailed); - disconnect(m_proc.get(), &LaunchTask::requestProgress, this, &InstanceWindow::onProgressRequested); - } - m_proc = proc; - - if(m_proc) - { - // Set up signal connections - connect(m_proc.get(), &LaunchTask::succeeded, this, &InstanceWindow::onSucceeded); - connect(m_proc.get(), &LaunchTask::failed, this, &InstanceWindow::onFailed); - connect(m_proc.get(), &LaunchTask::requestProgress, this, &InstanceWindow::onProgressRequested); - } } void InstanceWindow::on_RunningState_changed(bool running) @@ -202,34 +185,6 @@ void InstanceWindow::on_btnKillMinecraft_clicked() } } -void InstanceWindow::onSucceeded() -{ - if (m_instance->settings()->get("AutoCloseConsole").toBool() && m_container->prepareToClose()) - { - this->close(); - return; - } - // Raise Window - if (MMC->settings()->get("RaiseConsole").toBool()) - { - show(); - raise(); - activateWindow(); - } -} - -void InstanceWindow::onFailed(QString reason) -{ -} - -void InstanceWindow::onProgressRequested(Task* task) -{ - ProgressDialog progDialog(this); - progDialog.setSkipButton(true, tr("Abort")); - m_proc->proceed(); - progDialog.execWithTask(task); -} - QString InstanceWindow::instanceId() { return m_instance->id(); |