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 /MultiMC.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 'MultiMC.cpp')
-rw-r--r-- | MultiMC.cpp | 23 |
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()) { |