package meerkat.voting.gui.controllersFX;

import javafx.fxml.FXML;
import meerkat.voting.gui.ui.VotingBoothUI;
import meerkat.voting.gui.ui.uicommands.CastOrAuditUICommand;

//import meerkat.voting.gui.ui.UIUtils;

/**
 * Created by Vladimir Eliezer Tokarev on 8/27/2016.
 * ChannelChoiceController handle the behavior of select channel section screen
 */
public class CastOrAuditController {

    CastOrAuditUICommand command = (CastOrAuditUICommand) VistaNavigator.getCurrentCommand();
    VotingBoothUI.FinalizeBallotChoice fChoice;


    @FXML
    private void cast() {
        fChoice = VotingBoothUI.FinalizeBallotChoice.CAST;
        nextPane();
    }

    @FXML
    private void audit() {
        fChoice = VotingBoothUI.FinalizeBallotChoice.AUDIT;
        nextPane();
    }

    private void nextPane() {
        VistaNavigator.loadVista(VistaNavigator.LOADING);
        VistaNavigator.uiThread.answerCastOrAuditScreen(command, fChoice);
    }


//
//    @FXML
//    private void doCancel() throws VoterCancelThrowable{
//        String errorMessage = "doCastOrAudit: some error with reading input from console. details: " + e;
//        logger.error(errorMessage);
//        command.getCallback().onFailure(e);
//        //see what is done in the original (basically need to call the callback of the command onFailure()
//    }


}
