diff --git a/voting-booth/src/main/java/meerkat/voting/controller/SystemMessages.java b/voting-booth/src/main/java/meerkat/voting/controller/SystemMessages.java deleted file mode 100644 index 4f57809..0000000 --- a/voting-booth/src/main/java/meerkat/voting/controller/SystemMessages.java +++ /dev/null @@ -1,77 +0,0 @@ -package meerkat.voting.controller; - -import com.google.protobuf.ByteString; -import meerkat.protobuf.Voting.*; - -/** - * Created by hai on 18/05/16. - */ -final public class SystemMessages { - - private SystemMessages() { - // This is a static class. No instantiation of this is needed. - } - - public static UIElement getWaitForCommitMessage() { - return UIElement.newBuilder() - .setType(UIElementDataType.TEXT) - .setData(ByteString.copyFromUtf8("Please wait while committing to ballot")) - .build(); - } - - public static UIElement getWaitForAuditMessage() { - return UIElement.newBuilder() - .setType(UIElementDataType.TEXT) - .setData(ByteString.copyFromUtf8("Please wait while auditing your ballot")) - .build(); - } - - public static UIElement getWaitForCastMessage() { - return UIElement.newBuilder() - .setType(UIElementDataType.TEXT) - .setData(ByteString.copyFromUtf8("Please wait while finalizing your ballot for voting")) - .build(); - } - - public static UIElement getRestartVotingButton() { - return UIElement.newBuilder() - .setType(UIElementDataType.TEXT) - .setData(ByteString.copyFromUtf8("Restart voting")) - .build(); - } - - public static UIElement getUnrecognizedFinalizeResponseMessage() { - return UIElement.newBuilder() - .setType(UIElementDataType.TEXT) - .setData(ByteString.copyFromUtf8("Could not understand response for Cast or Audit. Force restarting.")) - .build(); - } - - public static UIElement getUnsuccessfulChannelChoiceMessage() { - return UIElement.newBuilder() - .setType(UIElementDataType.TEXT) - .setData(ByteString.copyFromUtf8("Choice of channel was unsuccessful. Force restarting.")) - .build(); - } - - public static UIElement getOutputDeviceFailureMessage() { - return UIElement.newBuilder() - .setType(UIElementDataType.TEXT) - .setData(ByteString.copyFromUtf8("Ballot output device failure. Force restarting.")) - .build(); - } - - public static UIElement getUnsuccessfulVotingMessage() { - return UIElement.newBuilder() - .setType(UIElementDataType.TEXT) - .setData(ByteString.copyFromUtf8("Voting was unsuccessful. Force restarting.")) - .build(); - } - - public static UIElement getSomethingWrongMessage() { - return UIElement.newBuilder() - .setType(UIElementDataType.TEXT) - .setData(ByteString.copyFromUtf8("Something was terribly wrong. Force restarting.")) - .build(); - } -} diff --git a/voting-booth/src/main/java/meerkat/voting/controller/VotingBoothImpl.java b/voting-booth/src/main/java/meerkat/voting/controller/VotingBoothImpl.java index b20a11d..849651f 100644 --- a/voting-booth/src/main/java/meerkat/voting/controller/VotingBoothImpl.java +++ b/voting-booth/src/main/java/meerkat/voting/controller/VotingBoothImpl.java @@ -306,7 +306,7 @@ public class VotingBoothImpl implements VotingBoothController { systemMessages.get(storageManager.OUTPUT_DEVICE_FAILURE_MESSAGE))); } else { - ui.notifyVoterToWaitForFinish(SystemMessages.getWaitForCastMessage(), + ui.notifyVoterToWaitForFinish(systemMessages.get(storageManager.WAIT_FOR_CAST_MESSAGE), new WaitForFinishCallback(generateRequestIdentifier(), state.currentBallotSerialNumber, this.queue,