ADD:: Alerts: username is now your friend and calculation saved.

This commit is contained in:
Merel Steenbergen
2019-04-04 20:42:25 +02:00
parent 04db410293
commit b08174b2ee
2 changed files with 5 additions and 1 deletions

View File

@@ -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!");
}
}

View File

@@ -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!");
}
}