Huge Java detection refactor, version dialogs on first run (no JavaPath set) and "auto detect" button
This commit is contained in:
parent
0ae8073d41
commit
40a2456646
13 changed files with 421 additions and 50 deletions
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())
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue