aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages/global/JavaPage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/ui/pages/global/JavaPage.cpp')
-rw-r--r--launcher/ui/pages/global/JavaPage.cpp44
1 files changed, 17 insertions, 27 deletions
diff --git a/launcher/ui/pages/global/JavaPage.cpp b/launcher/ui/pages/global/JavaPage.cpp
index 81dd4cc1..77563840 100644
--- a/launcher/ui/pages/global/JavaPage.cpp
+++ b/launcher/ui/pages/global/JavaPage.cpp
@@ -38,22 +38,22 @@
#include "JavaCommon.h"
#include "ui_JavaPage.h"
+#include <QDir>
#include <QFileDialog>
#include <QMessageBox>
-#include <QDir>
#include <QTabBar>
#include "ui/dialogs/VersionSelectDialog.h"
-#include "java/JavaUtils.h"
#include "java/JavaInstallList.h"
+#include "java/JavaUtils.h"
-#include "settings/SettingsObject.h"
#include <FileSystem.h>
-#include "Application.h"
#include <sys.h>
+#include "Application.h"
+#include "settings/SettingsObject.h"
-JavaPage::JavaPage(QWidget *parent) : QWidget(parent), ui(new Ui::JavaPage)
+JavaPage::JavaPage(QWidget* parent) : QWidget(parent), ui(new Ui::JavaPage)
{
ui->setupUi(this);
ui->tabWidget->tabBar()->hide();
@@ -80,13 +80,10 @@ void JavaPage::applySettings()
// Memory
int min = ui->minMemSpinBox->value();
int max = ui->maxMemSpinBox->value();
- if(min < max)
- {
+ if (min < max) {
s->set("MinMemAlloc", min);
s->set("MaxMemAlloc", max);
- }
- else
- {
+ } else {
s->set("MinMemAlloc", max);
s->set("MaxMemAlloc", min);
}
@@ -105,13 +102,10 @@ void JavaPage::loadSettings()
// Memory
int min = s->get("MinMemAlloc").toInt();
int max = s->get("MaxMemAlloc").toInt();
- if(min < max)
- {
+ if (min < max) {
ui->minMemSpinBox->setValue(min);
ui->maxMemSpinBox->setValue(max);
- }
- else
- {
+ } else {
ui->minMemSpinBox->setValue(max);
ui->maxMemSpinBox->setValue(min);
}
@@ -137,8 +131,7 @@ void JavaPage::on_javaDetectBtn_clicked()
vselect.setResizeOn(2);
vselect.exec();
- if (vselect.result() == QDialog::Accepted && vselect.selectedVersion())
- {
+ if (vselect.result() == QDialog::Accepted && vselect.selectedVersion()) {
java = std::dynamic_pointer_cast<JavaInstall>(vselect.selectedVersion());
ui->javaPathTextBox->setText(java->path);
}
@@ -149,15 +142,14 @@ void JavaPage::on_javaBrowseBtn_clicked()
QString raw_path = QFileDialog::getOpenFileName(this, tr("Find Java executable"));
// do not allow current dir - it's dirty. Do not allow dirs that don't exist
- if(raw_path.isEmpty())
- {
+ if (raw_path.isEmpty()) {
return;
}
QString cooked_path = FS::NormalizePath(raw_path);
- QFileInfo javaInfo(cooked_path);;
- if(!javaInfo.exists() || !javaInfo.isExecutable())
- {
+ QFileInfo javaInfo(cooked_path);
+ ;
+ if (!javaInfo.exists() || !javaInfo.isExecutable()) {
return;
}
ui->javaPathTextBox->setText(cooked_path);
@@ -165,13 +157,11 @@ void JavaPage::on_javaBrowseBtn_clicked()
void JavaPage::on_javaTestBtn_clicked()
{
- if(checker)
- {
+ if (checker) {
return;
}
- checker.reset(new JavaCommon::TestCheck(
- this, ui->javaPathTextBox->text(), ui->jvmArgsTextBox->toPlainText().replace("\n", " "),
- ui->minMemSpinBox->value(), ui->maxMemSpinBox->value(), ui->permGenSpinBox->value()));
+ checker.reset(new JavaCommon::TestCheck(this, ui->javaPathTextBox->text(), ui->jvmArgsTextBox->toPlainText().replace("\n", " "),
+ ui->minMemSpinBox->value(), ui->maxMemSpinBox->value(), ui->permGenSpinBox->value()));
connect(checker.get(), SIGNAL(finished()), SLOT(checkerFinished()));
checker->run();
}