aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/setupwizard/JavaWizardPage.cpp
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2023-08-05 19:09:10 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2023-08-05 19:09:10 +0300
commitb2fdd8359405c93d0d93aa8c68971c986a1f68cb (patch)
tree59859119373213ce04b2f5e2d7a95227b57be609 /launcher/ui/setupwizard/JavaWizardPage.cpp
parent149b6d59cf848a3b3cd50b3aee1c112e9c47e633 (diff)
parentae793f6cf11658c9abc5111e82d5ba7b3e6af127 (diff)
downloadPrismLauncher-b2fdd8359405c93d0d93aa8c68971c986a1f68cb.tar.gz
PrismLauncher-b2fdd8359405c93d0d93aa8c68971c986a1f68cb.tar.bz2
PrismLauncher-b2fdd8359405c93d0d93aa8c68971c986a1f68cb.zip
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into download_threads
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/ui/setupwizard/JavaWizardPage.cpp')
-rw-r--r--launcher/ui/setupwizard/JavaWizardPage.cpp40
1 files changed, 16 insertions, 24 deletions
diff --git a/launcher/ui/setupwizard/JavaWizardPage.cpp b/launcher/ui/setupwizard/JavaWizardPage.cpp
index 2b70c47c..e2c44437 100644
--- a/launcher/ui/setupwizard/JavaWizardPage.cpp
+++ b/launcher/ui/setupwizard/JavaWizardPage.cpp
@@ -1,29 +1,27 @@
#include "JavaWizardPage.h"
#include "Application.h"
-#include <QVBoxLayout>
+#include <QFileDialog>
#include <QGroupBox>
-#include <QSpinBox>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
+#include <QSpinBox>
#include <QToolButton>
-#include <QFileDialog>
+#include <QVBoxLayout>
#include <sys.h>
#include "FileSystem.h"
+#include "JavaCommon.h"
#include "java/JavaInstall.h"
#include "java/JavaUtils.h"
-#include "JavaCommon.h"
-#include "ui/widgets/VersionSelectWidget.h"
#include "ui/dialogs/CustomMessageBox.h"
#include "ui/widgets/JavaSettingsWidget.h"
+#include "ui/widgets/VersionSelectWidget.h"
-
-JavaWizardPage::JavaWizardPage(QWidget *parent)
- :BaseWizardPage(parent)
+JavaWizardPage::JavaWizardPage(QWidget* parent) : BaseWizardPage(parent)
{
setupUi();
}
@@ -31,7 +29,7 @@ JavaWizardPage::JavaWizardPage(QWidget *parent)
void JavaWizardPage::setupUi()
{
setObjectName(QStringLiteral("javaPage"));
- QVBoxLayout * layout = new QVBoxLayout(this);
+ QVBoxLayout* layout = new QVBoxLayout(this);
m_java_widget = new JavaSettingsWidget(this);
layout->addWidget(m_java_widget);
@@ -59,30 +57,23 @@ bool JavaWizardPage::validatePage()
{
auto settings = APPLICATION->settings();
auto result = m_java_widget->validate();
- switch(result)
- {
+ switch (result) {
default:
- case JavaSettingsWidget::ValidationStatus::Bad:
- {
+ case JavaSettingsWidget::ValidationStatus::Bad: {
return false;
}
- case JavaSettingsWidget::ValidationStatus::AllOK:
- {
+ case JavaSettingsWidget::ValidationStatus::AllOK: {
settings->set("JavaPath", m_java_widget->javaPath());
return true;
}
- case JavaSettingsWidget::ValidationStatus::JavaBad:
- {
+ case JavaSettingsWidget::ValidationStatus::JavaBad: {
// Memory
auto s = APPLICATION->settings();
s->set("MinMemAlloc", m_java_widget->minHeapSize());
s->set("MaxMemAlloc", m_java_widget->maxHeapSize());
- if (m_java_widget->permGenEnabled())
- {
+ if (m_java_widget->permGenEnabled()) {
s->set("PermGen", m_java_widget->permGenSize());
- }
- else
- {
+ } else {
s->reset("PermGen");
}
return true;
@@ -93,7 +84,8 @@ bool JavaWizardPage::validatePage()
void JavaWizardPage::retranslate()
{
setTitle(tr("Java"));
- setSubTitle(tr("You do not have a working Java set up yet or it went missing.\n"
- "Please select one of the following or browse for a Java executable."));
+ setSubTitle(
+ tr("You do not have a working Java set up yet or it went missing.\n"
+ "Please select one of the following or browse for a Java executable."));
m_java_widget->retranslate();
}