diff options
author | Sky <git@bunnies.cc> | 2013-10-14 02:59:21 +0100 |
---|---|---|
committer | Sky <git@bunnies.cc> | 2013-10-14 03:00:06 +0100 |
commit | 40a2456646df96e0dd8731ab78cba920a734a8e3 (patch) | |
tree | c73b382b68c739ab1605eddc095f0cd9a4ca4cc7 /gui/settingsdialog.cpp | |
parent | 0ae8073d41de014beb8fd386cfb4713ad86c4766 (diff) | |
download | MultiMC-40a2456646df96e0dd8731ab78cba920a734a8e3.tar MultiMC-40a2456646df96e0dd8731ab78cba920a734a8e3.tar.gz MultiMC-40a2456646df96e0dd8731ab78cba920a734a8e3.tar.lz MultiMC-40a2456646df96e0dd8731ab78cba920a734a8e3.tar.xz MultiMC-40a2456646df96e0dd8731ab78cba920a734a8e3.zip |
Huge Java detection refactor, version dialogs on first run (no JavaPath set) and "auto detect" button
Diffstat (limited to 'gui/settingsdialog.cpp')
-rw-r--r-- | gui/settingsdialog.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gui/settingsdialog.cpp b/gui/settingsdialog.cpp index 011925b7..a3347680 100644 --- a/gui/settingsdialog.cpp +++ b/gui/settingsdialog.cpp @@ -17,6 +17,8 @@ #include "settingsdialog.h" #include "ui_settingsdialog.h" #include "logic/JavaUtils.h" +#include "gui/versionselectdialog.h" +#include "logic/lists/JavaVersionList.h" #include <settingsobject.h> #include <QFileDialog> @@ -184,10 +186,17 @@ void SettingsDialog::loadSettings(SettingsObject *s) void SettingsDialog::on_pushButton_clicked() { - JavaUtils jut; - auto javas = jut.FindJavaPaths(); + JavaVersionPtr java; - ui->javaPathTextBox->setText(std::get<JI_PATH>(javas.at(0))); + VersionSelectDialog vselect(MMC->javalist().get(), tr("Select a Java version"), this, true); + vselect.setResizeOn(2); + vselect.exec(); + + if (vselect.result() == QDialog::Accepted && vselect.selectedVersion()) + { + java = std::dynamic_pointer_cast<JavaVersion>(vselect.selectedVersion()); + ui->javaPathTextBox->setText(java->path); + } } void SettingsDialog::on_btnBrowse_clicked() |