summaryrefslogtreecommitdiffstats
path: root/gui/dialogs/SettingsDialog.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-11-24 06:36:16 +0100
committerPetr Mrázek <peterix@gmail.com>2013-11-24 06:36:16 +0100
commitca297fca79a7b1b96e41ba5abed4956af9383c16 (patch)
tree5c6cf2a486c4015f5e52842acb412e39b8498acd /gui/dialogs/SettingsDialog.cpp
parent4124faf474908e4d79d93b0f624bf8fd81bd9972 (diff)
downloadMultiMC-ca297fca79a7b1b96e41ba5abed4956af9383c16.tar
MultiMC-ca297fca79a7b1b96e41ba5abed4956af9383c16.tar.gz
MultiMC-ca297fca79a7b1b96e41ba5abed4956af9383c16.tar.lz
MultiMC-ca297fca79a7b1b96e41ba5abed4956af9383c16.tar.xz
MultiMC-ca297fca79a7b1b96e41ba5abed4956af9383c16.zip
Prepare for rework of instance launch/update
Added missing licenses Added a Java functionality checker (detects 32/64bit java) Refactor of *Update - no longer based on BaseUpdate, but Task directly Fixed runner script to not derp up on 32bit linux. Could add more detection and error reporting there. Resources are now split into graphics and generated. Generated resources are placed in the build tree and included from there. Used the Java checker in the main settings dialog (TODO: instance settings). Partial support for ${arch}-using libraries - both 32 and 64 variants of ${arch} are downloaded.
Diffstat (limited to 'gui/dialogs/SettingsDialog.cpp')
-rw-r--r--gui/dialogs/SettingsDialog.cpp40
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."));
+ }
+}