MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / createSetupWizard

Method createSetupWizard

launcher/Application.cpp:879–933  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

877}
878
879bool Application::createSetupWizard()
880{
881 bool javaRequired = [&]()
882 {
883 bool ignoreJavaWizard = m_settings->get("IgnoreJavaWizard").toBool();
884 if(ignoreJavaWizard) {
885 return false;
886 }
887 QString currentHostName = QHostInfo::localHostName();
888 QString oldHostName = settings()->get("LastHostname").toString();
889 if (currentHostName != oldHostName)
890 {
891 settings()->set("LastHostname", currentHostName);
892 return true;
893 }
894 QString currentJavaPath = settings()->get("JavaPath").toString();
895 QString actualPath = FS::ResolveExecutable(currentJavaPath);
896 if (actualPath.isNull())
897 {
898 return true;
899 }
900 return false;
901 }();
902 bool languageRequired = [&]()
903 {
904 if (settings()->get("Language").toString().isEmpty())
905 return true;
906 return false;
907 }();
908 bool pasteInterventionRequired = settings()->get("PastebinURL") != "";
909 bool wizardRequired = javaRequired || languageRequired || pasteInterventionRequired;
910
911 if(wizardRequired)
912 {
913 m_setupWizard = new SetupWizard(nullptr);
914 if (languageRequired)
915 {
916 m_setupWizard->addPage(new LanguageWizardPage(m_setupWizard));
917 }
918
919 if (javaRequired)
920 {
921 m_setupWizard->addPage(new JavaWizardPage(m_setupWizard));
922 }
923
924 if (pasteInterventionRequired)
925 {
926 m_setupWizard->addPage(new PasteWizardPage(m_setupWizard));
927 }
928 connect(m_setupWizard, &QDialog::finished, this, &Application::setupWizardFinished);
929 m_setupWizard->show();
930 return true;
931 }
932 return false;
933}
934
935bool Application::event(QEvent* event) {
936#ifdef Q_OS_MACOS

Callers

nothing calls this directly

Calls 7

ResolveExecutableFunction · 0.85
isEmptyMethod · 0.80
addPageMethod · 0.80
showMethod · 0.80
getMethod · 0.45
toStringMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected