summaryrefslogtreecommitdiffstats
path: root/api/logic/java/launch
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2017-01-01 19:59:46 +0100
committerPetr Mrázek <peterix@gmail.com>2017-01-01 20:04:08 +0100
commita666dc0a1afa69b5b42aa3a487c8fa971c01cde1 (patch)
treee226954e1af8f1dce0f9e73898331aef2481503b /api/logic/java/launch
parent722896d41f15a8bc78a864f7adcfd0527648073c (diff)
downloadMultiMC-a666dc0a1afa69b5b42aa3a487c8fa971c01cde1.tar
MultiMC-a666dc0a1afa69b5b42aa3a487c8fa971c01cde1.tar.gz
MultiMC-a666dc0a1afa69b5b42aa3a487c8fa971c01cde1.tar.lz
MultiMC-a666dc0a1afa69b5b42aa3a487c8fa971c01cde1.tar.xz
MultiMC-a666dc0a1afa69b5b42aa3a487c8fa971c01cde1.zip
NOISSUE fix up translation selection in settings and add OS/sys arch reporting
Diffstat (limited to 'api/logic/java/launch')
-rw-r--r--api/logic/java/launch/CheckJava.cpp20
-rw-r--r--api/logic/java/launch/CheckJava.h1
2 files changed, 21 insertions, 0 deletions
diff --git a/api/logic/java/launch/CheckJava.cpp b/api/logic/java/launch/CheckJava.cpp
index 41bb6398..717fad49 100644
--- a/api/logic/java/launch/CheckJava.cpp
+++ b/api/logic/java/launch/CheckJava.cpp
@@ -18,6 +18,7 @@
#include <FileSystem.h>
#include <QStandardPaths>
#include <QFileInfo>
+#include <sys.h>
void CheckJava::executeTask()
{
@@ -83,6 +84,7 @@ void CheckJava::checkJavaFinished(JavaCheckResult result)
emit logLine(tr("Could not start java:"), MessageLevel::Error);
emit logLines(result.errorLog.split('\n'), MessageLevel::Error);
emit logLine("\nCheck your MultiMC Java settings.", MessageLevel::MultiMC);
+ printSystemInfo(false, false);
emitFailed(tr("Could not start java!"));
}
else
@@ -99,4 +101,22 @@ void CheckJava::checkJavaFinished(JavaCheckResult result)
void CheckJava::printJavaInfo(const QString& version, const QString& architecture)
{
emit logLine(tr("Java is version %1, using %2-bit architecture.\n\n").arg(version, architecture), MessageLevel::MultiMC);
+ printSystemInfo(true, architecture == "64");
+}
+
+void CheckJava::printSystemInfo(bool javaIsKnown, bool javaIs64bit)
+{
+ auto cpu64 = Sys::isCPU64bit();
+ auto system64 = Sys::isSystem64bit();
+ if(cpu64 != system64)
+ {
+ emit logLine(tr("Your CPU architecture is not matching your system architecture. You might want to install a 64bit Operating System.\n\n"), MessageLevel::Error);
+ }
+ if(javaIsKnown)
+ {
+ if(javaIs64bit != system64)
+ {
+ emit logLine(tr("Your Java architecture is not matching your system architecture. You might want to install a 64bit Java version.\n\n"), MessageLevel::Error);
+ }
+ }
}
diff --git a/api/logic/java/launch/CheckJava.h b/api/logic/java/launch/CheckJava.h
index 7126f4c4..9e16cbd2 100644
--- a/api/logic/java/launch/CheckJava.h
+++ b/api/logic/java/launch/CheckJava.h
@@ -36,6 +36,7 @@ private slots:
private:
void printJavaInfo(const QString & version, const QString & architecture);
+ void printSystemInfo(bool javaIsKnown, bool javaIs64bit);
private:
QString m_javaPath;