| 208 | } |
| 209 | |
| 210 | void InstanceSettingsPage::loadSettings() |
| 211 | { |
| 212 | // Console |
| 213 | ui->consoleSettingsBox->setChecked(m_settings->get("OverrideConsole").toBool()); |
| 214 | ui->showConsoleCheck->setChecked(m_settings->get("ShowConsole").toBool()); |
| 215 | ui->autoCloseConsoleCheck->setChecked(m_settings->get("AutoCloseConsole").toBool()); |
| 216 | ui->showConsoleErrorCheck->setChecked(m_settings->get("ShowConsoleOnError").toBool()); |
| 217 | |
| 218 | // Window Size |
| 219 | ui->windowSizeGroupBox->setChecked(m_settings->get("OverrideWindow").toBool()); |
| 220 | ui->maximizedCheckBox->setChecked(m_settings->get("LaunchMaximized").toBool()); |
| 221 | ui->windowWidthSpinBox->setValue(m_settings->get("MinecraftWinWidth").toInt()); |
| 222 | ui->windowHeightSpinBox->setValue(m_settings->get("MinecraftWinHeight").toInt()); |
| 223 | |
| 224 | // Memory |
| 225 | ui->memoryGroupBox->setChecked(m_settings->get("OverrideMemory").toBool()); |
| 226 | int min = m_settings->get("MinMemAlloc").toInt(); |
| 227 | int max = m_settings->get("MaxMemAlloc").toInt(); |
| 228 | if(min < max) |
| 229 | { |
| 230 | ui->minMemSpinBox->setValue(min); |
| 231 | ui->maxMemSpinBox->setValue(max); |
| 232 | } |
| 233 | else |
| 234 | { |
| 235 | ui->minMemSpinBox->setValue(max); |
| 236 | ui->maxMemSpinBox->setValue(min); |
| 237 | } |
| 238 | ui->permGenSpinBox->setValue(m_settings->get("PermGen").toInt()); |
| 239 | bool permGenVisible = m_settings->get("PermGenVisible").toBool(); |
| 240 | ui->permGenSpinBox->setVisible(permGenVisible); |
| 241 | ui->labelPermGen->setVisible(permGenVisible); |
| 242 | ui->labelPermgenNote->setVisible(permGenVisible); |
| 243 | |
| 244 | |
| 245 | // Java Settings |
| 246 | bool overrideJava = m_settings->get("OverrideJava").toBool(); |
| 247 | bool overrideLocation = m_settings->get("OverrideJavaLocation").toBool() || overrideJava; |
| 248 | bool overrideArgs = m_settings->get("OverrideJavaArgs").toBool() || overrideJava; |
| 249 | |
| 250 | ui->javaSettingsGroupBox->setChecked(overrideLocation); |
| 251 | ui->javaPathTextBox->setText(m_settings->get("JavaPath").toString()); |
| 252 | |
| 253 | ui->javaArgumentsGroupBox->setChecked(overrideArgs); |
| 254 | ui->jvmArgsTextBox->setPlainText(m_settings->get("JvmArgs").toString()); |
| 255 | |
| 256 | // Custom commands |
| 257 | ui->customCommands->initialize( |
| 258 | true, |
| 259 | m_settings->get("OverrideCommands").toBool(), |
| 260 | m_settings->get("PreLaunchCommand").toString(), |
| 261 | m_settings->get("WrapperCommand").toString(), |
| 262 | m_settings->get("PostExitCommand").toString() |
| 263 | ); |
| 264 | |
| 265 | // Workarounds |
| 266 | ui->nativeWorkaroundsGroupBox->setChecked(m_settings->get("OverrideNativeWorkarounds").toBool()); |
| 267 | ui->useNativeGLFWCheck->setChecked(m_settings->get("UseNativeGLFW").toBool()); |
nothing calls this directly
no test coverage detected