From b08174b2eebbef5359cd6428648aad5e5987f959 Mon Sep 17 00:00:00 2001 From: Merel Steenbergen Date: Thu, 4 Apr 2019 20:42:25 +0200 Subject: [PATCH] ADD:: Alerts: username is now your friend and calculation saved. --- .../java/greenify/client/controller/CalculatorController.java | 3 ++- .../main/java/greenify/client/controller/FriendController.java | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Client/src/main/java/greenify/client/controller/CalculatorController.java b/src/Client/src/main/java/greenify/client/controller/CalculatorController.java index 7155506..c080071 100644 --- a/src/Client/src/main/java/greenify/client/controller/CalculatorController.java +++ b/src/Client/src/main/java/greenify/client/controller/CalculatorController.java @@ -518,8 +518,9 @@ public class CalculatorController { Float footprint = userService.saveFootprint(userService.currentUser.getName()); Window owner = saveButton.getScene().getWindow(); Stage current = (Stage) owner; -// CalculatorController.AlertHelper.showAlert(Alert.AlertType.CONFIRMATION, owner, "Footprint saved!", "Your footprint is saved!"); current.close(); controller.updateLeaderboard(); + CalculatorController.AlertHelper.showAlert + (Alert.AlertType.CONFIRMATION, owner, "Footprint saved!", "Your footprint is saved!"); } } \ No newline at end of file diff --git a/src/Client/src/main/java/greenify/client/controller/FriendController.java b/src/Client/src/main/java/greenify/client/controller/FriendController.java index a623de5..aa2d455 100644 --- a/src/Client/src/main/java/greenify/client/controller/FriendController.java +++ b/src/Client/src/main/java/greenify/client/controller/FriendController.java @@ -52,7 +52,10 @@ public class FriendController { //add friend to the current user userService.addFriend(userService.currentUser.getName(), userNameText.getText()); //close the register window after the user has entered all the credentials + String friendName = userNameText.getText(); Stage current = (Stage) owner; current.close(); + UserController.AlertHelper.showAlert(Alert.AlertType.CONFIRMATION, owner, "Friend added!", + userNameText.getText() + " is now your friend!"); } }