MCPcopy Create free account
hub / github.com/MultiMC/Launcher / loadSettings

Method loadSettings

launcher/ui/pages/instance/InstanceSettingsPage.cpp:211–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

setVisibleMethod · 0.80
getMethod · 0.45
setTextMethod · 0.45
toStringMethod · 0.45
initializeMethod · 0.45

Tested by

no test coverage detected