From c406a5d226ae3bf773f6dce175b78d143c719b1e Mon Sep 17 00:00:00 2001
From: DieGurke <55625494+DieGurke@users.noreply.github.com>
Date: Wed, 15 Jul 2020 14:05:47 +0200
Subject: [PATCH] Replaced custom clearableTextField with normal TextField
---
.../java/envoy/client/ui/controller/LoginScene.java | 11 +++++------
client/src/main/resources/fxml/LoginScene.fxml | 6 +++---
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/client/src/main/java/envoy/client/ui/controller/LoginScene.java b/client/src/main/java/envoy/client/ui/controller/LoginScene.java
index 3f0df5b..fe05578 100644
--- a/client/src/main/java/envoy/client/ui/controller/LoginScene.java
+++ b/client/src/main/java/envoy/client/ui/controller/LoginScene.java
@@ -14,7 +14,6 @@ import javafx.scene.control.Alert.AlertType;
import envoy.client.data.*;
import envoy.client.net.Client;
import envoy.client.net.WriteProxy;
-import envoy.client.ui.ClearableTextField;
import envoy.client.ui.SceneContext;
import envoy.client.ui.Startup;
import envoy.data.LoginCredentials;
@@ -38,7 +37,7 @@ import envoy.util.EnvoyLog;
public final class LoginScene {
@FXML
- private ClearableTextField userTextField;
+ private TextField userTextField;
@FXML
private PasswordField passwordField;
@@ -104,16 +103,16 @@ public final class LoginScene {
if (registerCheckBox.isSelected() && !passwordField.getText().equals(repeatPasswordField.getText())) {
new Alert(AlertType.ERROR, "The entered password is unequal to the repeated one").showAndWait();
repeatPasswordField.clear();
- } else if (!Bounds.isValidContactName(userTextField.getTextField().getText())) {
+ } else if (!Bounds.isValidContactName(userTextField.getText())) {
new Alert(AlertType.ERROR, "The entered user name is not valid (" + Bounds.CONTACT_NAME_PATTERN + ")").showAndWait();
- userTextField.getTextField().clear();
- } else performHandshake(new LoginCredentials(userTextField.getTextField().getText(), passwordField.getText(), registerCheckBox.isSelected(),
+ userTextField.clear();
+ } else performHandshake(new LoginCredentials(userTextField.getText(), passwordField.getText(), registerCheckBox.isSelected(),
Startup.VERSION));
}
@FXML
private void offlineModeButtonPressed() {
- attemptOfflineMode(new LoginCredentials(userTextField.getTextField().getText(), passwordField.getText(), false, Startup.VERSION));
+ attemptOfflineMode(new LoginCredentials(userTextField.getText(), passwordField.getText(), false, Startup.VERSION));
}
@FXML
diff --git a/client/src/main/resources/fxml/LoginScene.fxml b/client/src/main/resources/fxml/LoginScene.fxml
index 1e915a2..04c144a 100644
--- a/client/src/main/resources/fxml/LoginScene.fxml
+++ b/client/src/main/resources/fxml/LoginScene.fxml
@@ -1,11 +1,11 @@
-
+
@@ -70,12 +70,12 @@
-
-
+