| 300 | } |
| 301 | |
| 302 | void InstanceSettingsPage::loadSettings() |
| 303 | { |
| 304 | // Miscellaneous |
| 305 | ui->miscellaneousSettingsBox->setChecked(m_settings->get("OverrideMiscellaneous").toBool()); |
| 306 | ui->closeAfterLaunchCheck->setChecked(m_settings->get("CloseAfterLaunch").toBool()); |
| 307 | ui->quitAfterGameStopCheck->setChecked(m_settings->get("QuitAfterGameStop").toBool()); |
| 308 | |
| 309 | // Console |
| 310 | ui->consoleSettingsBox->setChecked(m_settings->get("OverrideConsole").toBool()); |
| 311 | ui->showConsoleCheck->setChecked(m_settings->get("ShowConsole").toBool()); |
| 312 | ui->autoCloseConsoleCheck->setChecked(m_settings->get("AutoCloseConsole").toBool()); |
| 313 | ui->showConsoleErrorCheck->setChecked(m_settings->get("ShowConsoleOnError").toBool()); |
| 314 | |
| 315 | // Window Size |
| 316 | ui->windowSizeGroupBox->setChecked(m_settings->get("OverrideWindow").toBool()); |
| 317 | ui->maximizedCheckBox->setChecked(m_settings->get("LaunchMaximized").toBool()); |
| 318 | ui->windowWidthSpinBox->setValue(m_settings->get("MinecraftWinWidth").toInt()); |
| 319 | ui->windowHeightSpinBox->setValue(m_settings->get("MinecraftWinHeight").toInt()); |
| 320 | |
| 321 | // Memory |
| 322 | ui->memoryGroupBox->setChecked(m_settings->get("OverrideMemory").toBool()); |
| 323 | int min = m_settings->get("MinMemAlloc").toInt(); |
| 324 | int max = m_settings->get("MaxMemAlloc").toInt(); |
| 325 | if(min < max) |
| 326 | { |
| 327 | ui->minMemSpinBox->setValue(min); |
| 328 | ui->maxMemSpinBox->setValue(max); |
| 329 | } |
| 330 | else |
| 331 | { |
| 332 | ui->minMemSpinBox->setValue(max); |
| 333 | ui->maxMemSpinBox->setValue(min); |
| 334 | } |
| 335 | ui->permGenSpinBox->setValue(m_settings->get("PermGen").toInt()); |
| 336 | bool permGenVisible = m_settings->get("PermGenVisible").toBool(); |
| 337 | ui->permGenSpinBox->setVisible(permGenVisible); |
| 338 | ui->labelPermGen->setVisible(permGenVisible); |
| 339 | ui->labelPermgenNote->setVisible(permGenVisible); |
| 340 | |
| 341 | |
| 342 | // Java Settings |
| 343 | bool overrideJava = m_settings->get("OverrideJava").toBool(); |
| 344 | bool overrideLocation = m_settings->get("OverrideJavaLocation").toBool() || overrideJava; |
| 345 | bool overrideArgs = m_settings->get("OverrideJavaArgs").toBool() || overrideJava; |
| 346 | |
| 347 | ui->javaSettingsGroupBox->setChecked(overrideLocation); |
| 348 | ui->javaPathTextBox->setText(m_settings->get("JavaPath").toString()); |
| 349 | ui->skipCompatibilityCheckbox->setChecked(m_settings->get("IgnoreJavaCompatibility").toBool()); |
| 350 | |
| 351 | ui->javaArgumentsGroupBox->setChecked(overrideArgs); |
| 352 | ui->jvmArgsTextBox->setPlainText(m_settings->get("JvmArgs").toString()); |
| 353 | |
| 354 | // Custom commands |
| 355 | ui->customCommands->initialize( |
| 356 | true, |
| 357 | m_settings->get("OverrideCommands").toBool(), |
| 358 | m_settings->get("PreLaunchCommand").toString(), |
| 359 | m_settings->get("WrapperCommand").toString(), |
nothing calls this directly
no test coverage detected