From 352afeb41790ca433d68fc162aef7ab75b3d42e3 Mon Sep 17 00:00:00 2001 From: Iris De Santis Date: Tue, 16 Apr 2024 17:31:43 +0200 Subject: [PATCH] Helping lucadg --- mvnw | 0 .../java/team/elrant/bubbles/gui/LoginController.java | 2 +- .../team/elrant/bubbles/gui/SideViewApplication.java | 10 +++++----- .../java/team/elrant/bubbles/xmpp/ConnectedUser.java | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) mode change 100644 => 100755 mvnw diff --git a/mvnw b/mvnw old mode 100644 new mode 100755 diff --git a/src/main/java/team/elrant/bubbles/gui/LoginController.java b/src/main/java/team/elrant/bubbles/gui/LoginController.java index 35c575f..6b88276 100644 --- a/src/main/java/team/elrant/bubbles/gui/LoginController.java +++ b/src/main/java/team/elrant/bubbles/gui/LoginController.java @@ -58,7 +58,7 @@ protected void onSubmitButtonClick() { @FXML public void initialize() { try { - User userFromFile = new User("user.dat"); + User userFromFile = new User("user.dat", ""); if (!userFromFile.getUsername().isEmpty()) { username_field.setText(userFromFile.getUsername()); } diff --git a/src/main/java/team/elrant/bubbles/gui/SideViewApplication.java b/src/main/java/team/elrant/bubbles/gui/SideViewApplication.java index 57ca47b..5097dd4 100644 --- a/src/main/java/team/elrant/bubbles/gui/SideViewApplication.java +++ b/src/main/java/team/elrant/bubbles/gui/SideViewApplication.java @@ -33,11 +33,11 @@ public void start(@NotNull Stage stage) throws Exception { AnchorPane root = fxmlLoader.load(); @NotNull Scene scene = new Scene(root, 320, 720); scene.getStylesheets().add(Objects.requireNonNull(getClass().getResource("styling/fluent-light.css")).toExternalForm()); - primaryStage.setTitle("Chat"); - primaryStage.setScene(scene); - primaryStage.centerOnScreen(); - primaryStage.setResizable(false); - primaryStage.show(); + stage.setTitle("Chat"); + stage.setScene(scene); + stage.centerOnScreen(); + stage.setResizable(false); + stage.show(); } catch (Exception e) { logger.error("Error starting SideViewApplication: {}", e.getMessage()); throw e; diff --git a/src/main/java/team/elrant/bubbles/xmpp/ConnectedUser.java b/src/main/java/team/elrant/bubbles/xmpp/ConnectedUser.java index b5407c8..63a8453 100644 --- a/src/main/java/team/elrant/bubbles/xmpp/ConnectedUser.java +++ b/src/main/java/team/elrant/bubbles/xmpp/ConnectedUser.java @@ -40,7 +40,7 @@ public class ConnectedUser extends User { * @param password The password of the user. * @param serviceName The service name of the XMPP server. */ - public ConnectedUser(@NotNull String username, @NotNull String password, @NotNull String serviceName) { + public ConnectedUser(@NotNull String username, @NotNull String password, @NotNull String serviceName) throws IOException, ClassNotFoundException { super(username, serviceName); this.password = password; } @@ -159,7 +159,7 @@ public void saveUserToFile(@NotNull String filename, boolean savePassword) { } logger.info("User information (excluding password) saved to {}", filename); - } catch (IOException e) { + } catch (IOException | ClassNotFoundException e) { logger.error("Error saving user information to file: {}", e.getMessage()); } }