Compare commits

...
1 Commits
Author SHA1 Message Date
huangyuhui 63ca5dd409 Fixed #296 2018-05-20 19:48:43 +08:00
2 changed files with 9 additions and 2 deletions

No files matched your search

@@ -17,6 +17,7 @@ import org.jackhuang.hmcl.task.Schedulers;
import org.jackhuang.hmcl.task.Task;
import org.jackhuang.hmcl.ui.animation.ContainerAnimations;
import org.jackhuang.hmcl.ui.animation.TransitionHandler;
import org.jackhuang.hmcl.ui.construct.URLValidator;
import org.jackhuang.hmcl.ui.wizard.DecoratorPage;
import org.jackhuang.hmcl.util.Logging;
import org.jackhuang.hmcl.util.NetworkUtils;
@@ -45,6 +46,9 @@ public class AuthlibInjectorServersPage extends StackPane implements DecoratorPa
@FXML private JFXProgressBar progressBar;
@FXML private JFXButton btnAddNext;
@FXML private URLValidator validatorURL;
@FXML private URLValidator validatorHttp;
private final TransitionHandler transitionHandler;
{
@@ -55,6 +59,9 @@ public class AuthlibInjectorServersPage extends StackPane implements DecoratorPa
getChildren().remove(dialog);
dialog.setDialogContainer(this);
validatorURL.setMessage(Launcher.i18n("input.url"));
validatorHttp.setMessage(Launcher.i18n("input.url.http"));
txtServerIp.textProperty().addListener((a, b, newValue) ->
btnAddNext.setDisable(!txtServerIp.validate()));
@@ -34,9 +34,9 @@
<body>
<JFXTextField fx:id="txtServerIp" promptText="%account.injector.server_ip">
<validators>
<URLValidator message="%input.url">
<URLValidator fx:id="validatorURL">
</URLValidator>
<URLValidator message="%input.url.http">
<URLValidator fx:id="validatorHttp">
<protocols>
<String fx:value="http" />
<String fx:value="https" />