diff --git a/src/main/java/network/brightspots/rcv/GuiConfigController.java b/src/main/java/network/brightspots/rcv/GuiConfigController.java index 769588c7d..a73b4dab2 100644 --- a/src/main/java/network/brightspots/rcv/GuiConfigController.java +++ b/src/main/java/network/brightspots/rcv/GuiConfigController.java @@ -1805,7 +1805,7 @@ protected Boolean call() { if (errors.isEmpty()) { succeeded(); } else { - Logger.warning("There were errors"); + Logger.warning("Encountered %d errors during tabulation.", errors.size()); failed(); } return errors.isEmpty(); @@ -1857,7 +1857,7 @@ protected LoadedCvrData call() { if (cvrStatics.successfullyReadAll) { succeeded(); } else { - Logger.warning("There were errors"); + Logger.warning("Failed to read all CVRs."); failed(); } return cvrStatics; diff --git a/src/main/java/network/brightspots/rcv/GuiTabulateController.java b/src/main/java/network/brightspots/rcv/GuiTabulateController.java index 5621bca22..10b2b7223 100644 --- a/src/main/java/network/brightspots/rcv/GuiTabulateController.java +++ b/src/main/java/network/brightspots/rcv/GuiTabulateController.java @@ -68,17 +68,18 @@ public class GuiTabulateController { private String configOutputPath; /** - * This modal builds upon the GuiConfigController, and therefore only interacts with it. + * This modal builds upon the GuiConfigController, and the two share some functionality + * (e.g. saving a config file). The shared functionality lives in GuiConfigController. */ private GuiConfigController guiConfigController; /** - * The style applied when a field is filled. + * The style applied when a required field is correctly filled. */ private String filledFieldStyle; /** - * The style applied when a field is unfilled. + * The style applied when a required field is unfilled and requires user input. */ private String unfilledFieldStyle; @@ -143,15 +144,10 @@ public void nameUpdated(KeyEvent keyEvent) { */ public void buttonloadCvrsClicked(ActionEvent actionEvent) { String configPath = getConfigPathOrCreateTempFile(); - ContestConfig config = ContestConfig.loadContestConfig(configPath); - configOutputPath = config.getOutputDirectory(); - if (!configOutputPath.endsWith("/")) { - configOutputPath += "/"; - } enableButtonsUpTo(null); Service service = guiConfigController.parseAndCountCastVoteRecords(configPath); - // Dispatch a function that watches the service and updates the progress bar + watchParseCvrServiceProgress(service); } @@ -162,15 +158,10 @@ public void buttonloadCvrsClicked(ActionEvent actionEvent) { */ public void buttonTabulateClicked(ActionEvent actionEvent) { String configPath = getConfigPathOrCreateTempFile(); - ContestConfig config = ContestConfig.loadContestConfig(configPath); - configOutputPath = config.getOutputDirectory(); - if (!configOutputPath.endsWith("/")) { - configOutputPath += "/"; - } Service service = guiConfigController.startTabulation( configPath, userNameField.getText(), useTemporaryConfigBeforeTabulation, lastLoadedCvrData); - // Dispatch a function that watches the service and updates the progress bar + watchTabulatorServiceProgress(service); } @@ -295,9 +286,17 @@ public void buttonTempSaveClicked(ActionEvent actionEvent) { } private String getConfigPathOrCreateTempFile() { - return useTemporaryConfigBeforeTabulation + String path = useTemporaryConfigBeforeTabulation ? guiConfigController.saveFile(tempSaveButton, true) : savedConfigFilePath; + + ContestConfig config = ContestConfig.loadContestConfig(path); + configOutputPath = config.getOutputDirectory(); + if (!configOutputPath.endsWith("/")) { + configOutputPath += "/"; + } + + return path; } private boolean isConfigSavedOrTempFileReady() {