summaryrefslogtreecommitdiffstats
path: root/api
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
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')
-rw-r--r--api/logic/CMakeLists.txt2
-rw-r--r--api/logic/java/launch/CheckJava.cpp20
-rw-r--r--api/logic/java/launch/CheckJava.h1
3 files changed, 22 insertions, 1 deletions
diff --git a/api/logic/CMakeLists.txt b/api/logic/CMakeLists.txt
index ffecb073..bcf4b65a 100644
--- a/api/logic/CMakeLists.txt
+++ b/api/logic/CMakeLists.txt
@@ -490,7 +490,7 @@ set_target_properties(MultiMC_logic PROPERTIES CXX_VISIBILITY_PRESET hidden VISI
generate_export_header(MultiMC_logic)
# Link
-target_link_libraries(MultiMC_logic xz-embedded unpack200 ${QUAZIP_LIBRARIES} ${NBT_NAME} ${ZLIB_LIBRARIES})
+target_link_libraries(MultiMC_logic xz-embedded unpack200 systeminfo ${QUAZIP_LIBRARIES} ${NBT_NAME} ${ZLIB_LIBRARIES})
qt5_use_modules(MultiMC_logic Core Xml Network Concurrent)
add_dependencies(MultiMC_logic QuaZIP)
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;