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

Method validate

launcher/ui/widgets/JavaSettingsWidget.cpp:144–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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