From 5a78f723e581aa87d4f5eada44c24a22927dc461 Mon Sep 17 00:00:00 2001 From: VladimirEliTokarev Date: Wed, 5 Oct 2016 16:52:28 +0300 Subject: [PATCH] Added button which takes you back --- .../meerkat/voting/gui/managment/ChainBuilder.java | 1 + .../VoteHaveBeenCastController.java | 10 ++++++++++ .../src/main/resources/view/vote_have_been_cast.fxml | 5 +++++ 3 files changed, 16 insertions(+) diff --git a/voting-booth-gui/src/main/java/meerkat/voting/gui/managment/ChainBuilder.java b/voting-booth-gui/src/main/java/meerkat/voting/gui/managment/ChainBuilder.java index ba139d1..2a0f922 100644 --- a/voting-booth-gui/src/main/java/meerkat/voting/gui/managment/ChainBuilder.java +++ b/voting-booth-gui/src/main/java/meerkat/voting/gui/managment/ChainBuilder.java @@ -89,6 +89,7 @@ class ChainBuilder { VoteHaveBeenCastLoader voteHaveBeenCastLoader = new VoteHaveBeenCastLoader(primaryStage, configuration); TwoWayNode voteHaveBeenCastController = voteHaveBeenCastLoader.GetVoteHaveBeenCast(); voteHaveBeenCastController.SetVotersBallot(votersBallot); + voteHaveBeenCastController.SetPrevious(welcomeSplashController); castOrAuditController.SetNext(voteHaveBeenCastController); /** diff --git a/voting-booth-gui/src/main/java/meerkat/voting/gui/panels/vote_have_been_cast/VoteHaveBeenCastController.java b/voting-booth-gui/src/main/java/meerkat/voting/gui/panels/vote_have_been_cast/VoteHaveBeenCastController.java index 4b498a2..a01ee73 100644 --- a/voting-booth-gui/src/main/java/meerkat/voting/gui/panels/vote_have_been_cast/VoteHaveBeenCastController.java +++ b/voting-booth-gui/src/main/java/meerkat/voting/gui/panels/vote_have_been_cast/VoteHaveBeenCastController.java @@ -1,5 +1,7 @@ package meerkat.voting.gui.panels.vote_have_been_cast; +import javafx.fxml.FXML; +import javafx.scene.input.MouseEvent; import meerkat.voting.gui.managment.TwoWayNode; /** @@ -8,6 +10,14 @@ import meerkat.voting.gui.managment.TwoWayNode; */ public class VoteHaveBeenCastController extends TwoWayNode { + @FXML + private void backToWelcomeSplash(MouseEvent mousePress){ + this.currentStage.close(); + this.currentStage.setScene(this.previous.GetCurrentScene()); + this.previous.UpdateNode(); + this.currentStage.show(); + } + @Override public void UpdateNode() { // This panel doesn't have any questions representations that why there is nothing ti show here diff --git a/voting-booth-gui/src/main/resources/view/vote_have_been_cast.fxml b/voting-booth-gui/src/main/resources/view/vote_have_been_cast.fxml index 0633ef4..02f18f4 100644 --- a/voting-booth-gui/src/main/resources/view/vote_have_been_cast.fxml +++ b/voting-booth-gui/src/main/resources/view/vote_have_been_cast.fxml @@ -237,6 +237,11 @@ + + +