summaryrefslogtreecommitdiffstats
path: root/MultiMC.cpp
diff options
context:
space:
mode:
authorSky <git@bunnies.cc>2013-10-14 02:59:21 +0100
committerSky <git@bunnies.cc>2013-10-14 03:00:06 +0100
commit40a2456646df96e0dd8731ab78cba920a734a8e3 (patch)
treec73b382b68c739ab1605eddc095f0cd9a4ca4cc7 /MultiMC.cpp
parent0ae8073d41de014beb8fd386cfb4713ad86c4766 (diff)
downloadMultiMC-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 'MultiMC.cpp')
-rw-r--r--MultiMC.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/MultiMC.cpp b/MultiMC.cpp
index be1b86da..481bb0bb 100644
--- a/MultiMC.cpp
+++ b/MultiMC.cpp
@@ -5,8 +5,10 @@
#include <QNetworkAccessManager>
#include <QTranslator>
#include <QLibraryInfo>
+#include <QMessageBox>
#include "gui/mainwindow.h"
+#include "gui/versionselectdialog.h"
#include "logic/lists/InstanceList.h"
#include "logic/lists/IconList.h"
#include "logic/lists/LwjglVersionList.h"
@@ -263,17 +265,6 @@ void MultiMC::initGlobalSettings()
// Java Settings
m_settings->registerSetting(new Setting("JavaPath", ""));
- QString currentJavaPath = m_settings->get("JavaPath").toString();
- if(currentJavaPath.isEmpty())
- {
- QLOG_INFO() << "Java path not set, attempting to set it automatically...";
-
- JavaUtils jut;
- auto javas = jut.FindJavaPaths();
-
- m_settings->set("JavaPath", std::get<JI_PATH>(javas.at(0)));
- }
-
m_settings->registerSetting(new Setting("JvmArgs", ""));
// Custom Commands
@@ -342,6 +333,15 @@ std::shared_ptr<MinecraftVersionList> MultiMC::minecraftlist()
return m_minecraftlist;
}
+std::shared_ptr<JavaVersionList> MultiMC::javalist()
+{
+ if (!m_javalist)
+ {
+ m_javalist.reset(new JavaVersionList());
+ }
+ return m_javalist;
+}
+
int main(int argc, char *argv[])
{
// initialize Qt
@@ -350,6 +350,7 @@ int main(int argc, char *argv[])
// show main window
MainWindow mainWin;
mainWin.show();
+ mainWin.checkSetDefaultJava();
switch (app.status())
{