| 145 | } |
| 146 | |
| 147 | void InstanceWindow::updateLaunchButtons() |
| 148 | { |
| 149 | if(m_instance->isRunning()) |
| 150 | { |
| 151 | m_launchOfflineButton->setEnabled(false); |
| 152 | m_launchDemoButton->setEnabled(false); |
| 153 | m_killButton->setText(tr("Kill")); |
| 154 | m_killButton->setObjectName("killButton"); |
| 155 | m_killButton->setToolTip(tr("Kill the running instance")); |
| 156 | } |
| 157 | else if(!m_instance->canLaunch()) |
| 158 | { |
| 159 | m_launchOfflineButton->setEnabled(false); |
| 160 | m_launchDemoButton->setEnabled(false); |
| 161 | m_killButton->setText(tr("Launch")); |
| 162 | m_killButton->setObjectName("launchButton"); |
| 163 | m_killButton->setToolTip(tr("Launch the instance")); |
| 164 | m_killButton->setEnabled(false); |
| 165 | } |
| 166 | else |
| 167 | { |
| 168 | m_launchOfflineButton->setEnabled(true); |
| 169 | |
| 170 | // Disable demo-mode if not available. |
| 171 | auto instance = dynamic_cast<MinecraftInstance*>(m_instance.get()); |
| 172 | if (instance) { |
| 173 | m_launchDemoButton->setEnabled(instance->supportsDemo()); |
| 174 | } |
| 175 | |
| 176 | m_killButton->setText(tr("Launch")); |
| 177 | m_killButton->setObjectName("launchButton"); |
| 178 | m_killButton->setToolTip(tr("Launch the instance")); |
| 179 | } |
| 180 | // NOTE: this is a hack to force the button to recalculate its style |
| 181 | m_killButton->setStyleSheet("/* */"); |
| 182 | m_killButton->setStyleSheet(QString()); |
| 183 | } |
| 184 | |
| 185 | void InstanceWindow::on_btnLaunchMinecraftOffline_clicked() |
| 186 | { |
nothing calls this directly
no test coverage detected