MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / on_javaBrowseBtn_clicked

Method on_javaBrowseBtn_clicked

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

Source from the content-addressed store, hash-verified

459}
460
461void InstanceSettingsPage::on_javaBrowseBtn_clicked()
462{
463 QString raw_path = QFileDialog::getOpenFileName(this, tr("Find Java executable"));
464
465 // do not allow current dir - it's dirty. Do not allow dirs that don't exist
466 if(raw_path.isEmpty())
467 {
468 return;
469 }
470 QString cooked_path = FS::NormalizePath(raw_path);
471
472 QFileInfo javaInfo(cooked_path);
473 if(!javaInfo.exists() || !javaInfo.isExecutable())
474 {
475 return;
476 }
477 ui->javaPathTextBox->setText(cooked_path);
478
479 // custom Java could be anything... enable perm gen option
480 ui->permGenSpinBox->setVisible(true);
481 ui->labelPermGen->setVisible(true);
482 ui->labelPermgenNote->setVisible(true);
483 m_settings->set("PermGenVisible", true);
484}
485
486void InstanceSettingsPage::on_javaTestBtn_clicked()
487{

Callers

nothing calls this directly

Calls 6

NormalizePathFunction · 0.85
isEmptyMethod · 0.80
existsMethod · 0.80
setVisibleMethod · 0.80
setTextMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected