mirror of
https://github.com/UltimMC/Launcher.git
synced 2025-10-04 09:08:42 +00:00
Huge Java detection refactor, version dialogs on first run (no JavaPath set) and "auto detect" button
This commit is contained in:
23
MultiMC.cpp
23
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())
|
||||
{
|
||||
|
Reference in New Issue
Block a user