MCPcopy Create free account
hub / github.com/MultiMC/Launcher / validate

Method validate

launcher/ui/widgets/JavaSettingsWidget.cpp:139–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139JavaSettingsWidget::ValidationStatus JavaSettingsWidget::validate()
140{
141 switch(javaStatus)
142 {
143 default:
144 case JavaStatus::NotSet:
145 case JavaStatus::DoesNotExist:
146 case JavaStatus::DoesNotStart:
147 case JavaStatus::ReturnedInvalidData:
148 {
149 int button = CustomMessageBox::selectable(
150 this,
151 tr("No Java version selected"),
152 tr("You didn't select a Java version or selected something that doesn't work.\n"
153 "%1 will not be able to start Minecraft.\n"
154 "Do you wish to proceed without any Java?"
155 "\n\n"
156 "You can change the Java version in the settings later.\n"
157 ).arg(BuildConfig.LAUNCHER_NAME),
158 QMessageBox::Warning,
159 QMessageBox::Yes | QMessageBox::No,
160 QMessageBox::NoButton
161 )->exec();
162 if(button == QMessageBox::No)
163 {
164 return ValidationStatus::Bad;
165 }
166 return ValidationStatus::JavaBad;
167 }
168 break;
169 case JavaStatus::Pending:
170 {
171 return ValidationStatus::Bad;
172 }
173 case JavaStatus::Good:
174 {
175 return ValidationStatus::AllOK;
176 }
177 }
178}
179
180QString JavaSettingsWidget::javaPath() const
181{

Callers 3

startMethod · 0.45
replaceMethod · 0.45
validatePageMethod · 0.45

Calls 2

selectableFunction · 0.85
execMethod · 0.45

Tested by

no test coverage detected