diff options
Diffstat (limited to 'gui/dialogs/SettingsDialog.cpp')
-rw-r--r-- | gui/dialogs/SettingsDialog.cpp | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/gui/dialogs/SettingsDialog.cpp b/gui/dialogs/SettingsDialog.cpp index e4f22d83..57e15a5b 100644 --- a/gui/dialogs/SettingsDialog.cpp +++ b/gui/dialogs/SettingsDialog.cpp @@ -25,6 +25,7 @@ #include "logic/JavaUtils.h" #include "logic/NagUtils.h" #include "logic/lists/JavaVersionList.h" +#include <logic/JavaChecker.h> #include <settingsobject.h> #include <pathutils.h> @@ -98,12 +99,6 @@ void SettingsDialog::on_lwjglDirBrowseBtn_clicked() } } -void SettingsDialog::on_compatModeCheckBox_clicked(bool checked) -{ - Q_UNUSED(checked); - updateCheckboxStuff(); -} - void SettingsDialog::on_maximizedCheckBox_clicked(bool checked) { Q_UNUSED(checked); @@ -235,7 +230,7 @@ void SettingsDialog::loadSettings(SettingsObject *s) ui->postExitCmdTextBox->setText(s->get("PostExitCommand").toString()); } -void SettingsDialog::on_pushButton_clicked() +void SettingsDialog::on_javaDetectBtn_clicked() { JavaVersionPtr java; @@ -250,7 +245,7 @@ void SettingsDialog::on_pushButton_clicked() } } -void SettingsDialog::on_btnBrowse_clicked() +void SettingsDialog::on_javaBrowseBtn_clicked() { QString dir = QFileDialog::getOpenFileName(this, tr("Find Java executable")); if (!dir.isNull()) @@ -258,3 +253,32 @@ void SettingsDialog::on_btnBrowse_clicked() ui->javaPathTextBox->setText(dir); } } + +void SettingsDialog::on_javaTestBtn_clicked() +{ + checker.reset(new JavaChecker()); + connect(checker.get(), SIGNAL(checkFinished(JavaCheckResult)), this, + SLOT(checkFinished(JavaCheckResult))); + checker->performCheck(ui->javaPathTextBox->text()); +} + +void SettingsDialog::checkFinished(JavaCheckResult result) +{ + if (result.valid) + { + QString text; + text += "Java test succeeded!\n"; + if (result.is_64bit) + text += "Using 64bit java.\n"; + text += "\n"; + text += "Platform reported: " + result.realPlatform; + QMessageBox::information(this, tr("Java test success"), text); + } + else + { + QMessageBox::information( + this, tr("Java test failure"), + tr("The specified java binary didn't work. You should use the auto-detect feature, " + "or set the path to the java executable.")); + } +} |