Merge remote-tracking branch 'origin/develop' into f/enhanced_UI
This commit is contained in:
commit
d80bc39221
@ -71,9 +71,7 @@ public final class LoginScene {
|
||||
connectionLabel.setText("Server: " + config.getServer() + ":" + config.getPort());
|
||||
|
||||
// Show an alert after an unsuccessful handshake
|
||||
eventBus.register(
|
||||
HandshakeRejection.class,
|
||||
e -> Platform.runLater(() -> { clearPasswordFields(); new Alert(AlertType.ERROR, e.get()).showAndWait(); }));
|
||||
eventBus.register(HandshakeRejection.class, e -> Platform.runLater(() -> { new Alert(AlertType.ERROR, e.get()).showAndWait(); }));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -117,9 +115,10 @@ public final class LoginScene {
|
||||
|
||||
// Prevent registration with unequal passwords
|
||||
if (registerCheckBox.isSelected() && !passwordField.getText().equals(repeatPasswordField.getText())) {
|
||||
clearPasswordFields();
|
||||
new Alert(AlertType.ERROR, "The entered password is unequal to the repeated one").showAndWait();
|
||||
} else performHandshake(
|
||||
repeatPasswordField.clear();
|
||||
}
|
||||
else performHandshake(
|
||||
new LoginCredentials(userTextField.getText(), passwordField.getText().toCharArray(), registerCheckBox.isSelected(), Startup.VERSION));
|
||||
}
|
||||
|
||||
@ -134,7 +133,6 @@ public final class LoginScene {
|
||||
// Make repeat password field and label visible / invisible
|
||||
repeatPasswordField.setVisible(registerCheckBox.isSelected());
|
||||
repeatPasswordLabel.setVisible(registerCheckBox.isSelected());
|
||||
clearPasswordFields();
|
||||
}
|
||||
|
||||
@FXML
|
||||
@ -214,9 +212,4 @@ public final class LoginScene {
|
||||
if (receivedMessageCache != null && client.isOnline()) receivedMessageCache.relay();
|
||||
if (receivedMessageStatusChangeCache != null && client.isOnline()) receivedMessageStatusChangeCache.relay();
|
||||
}
|
||||
|
||||
private void clearPasswordFields() {
|
||||
passwordField.clear();
|
||||
repeatPasswordField.clear();
|
||||
}
|
||||
}
|
||||
|
@ -72,7 +72,7 @@
|
||||
<padding>
|
||||
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
|
||||
</padding></PasswordField>
|
||||
<PasswordField fx:id="repeatPasswordField" promptText="Repeat the chosen password" visible="false" GridPane.columnIndex="1" GridPane.rowIndex="2">
|
||||
<PasswordField fx:id="repeatPasswordField" visible="false" GridPane.columnIndex="1" GridPane.rowIndex="2">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="5.0" left="5.0" right="5.0" top="10.0" />
|
||||
</GridPane.margin>
|
||||
|
Reference in New Issue
Block a user