diff options
author | Affe Ali <affe-ali@web.de> | 2017-04-26 20:51:50 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@users.noreply.github.com> | 2017-05-01 23:18:00 +0200 |
commit | 0132fd99291e359aae4af184c5f57ace21bf9863 (patch) | |
tree | 2d1e84f25b011f7fc3409ab34dd793a45baed730 /application | |
parent | 9bde1c8512de8c93b407ec73c9a10f849043c433 (diff) | |
download | MultiMC-0132fd99291e359aae4af184c5f57ace21bf9863.tar MultiMC-0132fd99291e359aae4af184c5f57ace21bf9863.tar.gz MultiMC-0132fd99291e359aae4af184c5f57ace21bf9863.tar.lz MultiMC-0132fd99291e359aae4af184c5f57ace21bf9863.tar.xz MultiMC-0132fd99291e359aae4af184c5f57ace21bf9863.zip |
GH-1855 add launch offline button to instance UI
Diffstat (limited to 'application')
-rw-r--r-- | application/InstanceWindow.cpp | 14 | ||||
-rw-r--r-- | application/InstanceWindow.h | 2 |
2 files changed, 15 insertions, 1 deletions
diff --git a/application/InstanceWindow.cpp b/application/InstanceWindow.cpp index eab021e1..dd643f47 100644 --- a/application/InstanceWindow.cpp +++ b/application/InstanceWindow.cpp @@ -67,9 +67,14 @@ InstanceWindow::InstanceWindow(InstancePtr instance, QWidget *parent) m_killButton = new QPushButton(); horizontalLayout->addWidget(m_killButton); - setKillButton(m_instance->isRunning()); connect(m_killButton, SIGNAL(clicked(bool)), SLOT(on_btnKillMinecraft_clicked())); + m_launchOfflineButton = new QPushButton(); + horizontalLayout->addWidget(m_launchOfflineButton); + m_launchOfflineButton->setText(tr("Launch Offline")); + setKillButton(m_instance->isRunning()); + connect(m_launchOfflineButton, SIGNAL(clicked(bool)), SLOT(on_btnLaunchMinecraftOffline_clicked())); + m_closeButton = new QPushButton(); m_closeButton->setText(tr("Close")); horizontalLayout->addWidget(m_closeButton); @@ -114,16 +119,23 @@ void InstanceWindow::setKillButton(bool kill) { if(kill) { + m_launchOfflineButton->setEnabled(false); m_killButton->setText(tr("Kill")); m_killButton->setToolTip(tr("Kill the running instance")); } else { + m_launchOfflineButton->setEnabled(true); m_killButton->setText(tr("Launch")); m_killButton->setToolTip(tr("Launch the instance")); } } +void InstanceWindow::on_btnLaunchMinecraftOffline_clicked() +{ + MMC->launch(m_instance, false, nullptr); +} + void InstanceWindow::on_InstanceLaunchTask_changed(std::shared_ptr<LaunchTask> proc) { m_proc = proc; diff --git a/application/InstanceWindow.h b/application/InstanceWindow.h index 2daddba9..8e272e09 100644 --- a/application/InstanceWindow.h +++ b/application/InstanceWindow.h @@ -47,6 +47,7 @@ private slots: void on_closeButton_clicked(); void on_btnKillMinecraft_clicked(); + void on_btnLaunchMinecraftOffline_clicked(); void on_InstanceLaunchTask_changed(std::shared_ptr<LaunchTask> proc); void on_RunningState_changed(bool running); @@ -65,4 +66,5 @@ private: PageContainer *m_container = nullptr; QPushButton *m_closeButton = nullptr; QPushButton *m_killButton = nullptr; + QPushButton *m_launchOfflineButton = nullptr; }; |