| 50 | } |
| 51 | |
| 52 | bool JavaWizardPage::validatePage() |
| 53 | { |
| 54 | auto settings = APPLICATION->settings(); |
| 55 | auto result = m_java_widget->validate(); |
| 56 | settings->set("AutomaticJavaSwitch", m_java_widget->autoDetectJava()); |
| 57 | settings->set("AutomaticJavaDownload", m_java_widget->autoDownloadJava()); |
| 58 | settings->set("UserAskedAboutAutomaticJavaDownload", true); |
| 59 | switch (result) { |
| 60 | default: |
| 61 | case JavaSettingsWidget::ValidationStatus::Bad: { |
| 62 | return false; |
| 63 | } |
| 64 | case JavaSettingsWidget::ValidationStatus::AllOK: { |
| 65 | settings->set("JavaPath", m_java_widget->javaPath()); |
| 66 | } /* fallthrough */ |
| 67 | case JavaSettingsWidget::ValidationStatus::JavaBad: { |
| 68 | // Memory |
| 69 | auto s = APPLICATION->settings(); |
| 70 | s->set("MinMemAlloc", m_java_widget->minHeapSize()); |
| 71 | s->set("MaxMemAlloc", m_java_widget->maxHeapSize()); |
| 72 | if (m_java_widget->permGenEnabled()) { |
| 73 | s->set("PermGen", m_java_widget->permGenSize()); |
| 74 | } else { |
| 75 | s->reset("PermGen"); |
| 76 | } |
| 77 | return true; |
| 78 | } |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | void JavaWizardPage::retranslate() |
| 83 | { |
nothing calls this directly
no test coverage detected