From 9ae852f89e72b0ae6b2861c93b16babfe8c7002b Mon Sep 17 00:00:00 2001 From: Armin Samii Date: Thu, 14 Sep 2023 14:15:04 -0400 Subject: [PATCH] use *.999 for a development version and flag it in UI --- .github/workflows/release.yml | 6 +++--- build.gradle | 2 +- .../brightspots/rcv/GuiConfigController.java | 15 +++++++++++++++ .../java/network/brightspots/rcv/Main.java | 2 +- .../brightspots/rcv/GuiConfigLayout.fxml | 18 +++++++++++++----- 5 files changed, 33 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8cf3ea230..1617c1fe1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,11 +48,11 @@ jobs: # and while we could use some regex to figure out the version number automatically, it seems cleaner # to know the expected version number upfront. if [ ${{ runner.os }} == 'Windows' ]; then - echo "FILEPATH=build/jpackage/RCTab-1.4.0.exe" >> $GITHUB_OUTPUT + echo "FILEPATH=build/jpackage/RCTab-1.3.999.exe" >> $GITHUB_OUTPUT elif [ ${{ runner.os }} == 'Linux' ]; then - echo "FILEPATH=build/jpackage/rctab_1.4.0-1_amd64.deb" >> $GITHUB_OUTPUT + echo "FILEPATH=build/jpackage/rctab_1.3.999-1_amd64.deb" >> $GITHUB_OUTPUT else - echo "FILEPATH=build/jpackage/RCTab-1.4.0.dmg" >> $GITHUB_OUTPUT + echo "FILEPATH=build/jpackage/RCTab-1.3.999.dmg" >> $GITHUB_OUTPUT fi - name: "Create executable filename" id: exefn diff --git a/build.gradle b/build.gradle index 55d9dce7c..46821cfd5 100644 --- a/build.gradle +++ b/build.gradle @@ -121,7 +121,7 @@ jlink { launcher { // TODO Sync version number with release.yml and Main.java (github.com/BrightSpots/rcv/issues/662) name = "RCTab" - version = "1.4.0" + version = "1.3.999" } jpackage { diff --git a/src/main/java/network/brightspots/rcv/GuiConfigController.java b/src/main/java/network/brightspots/rcv/GuiConfigController.java index 0fc41f943..f85f8a65f 100644 --- a/src/main/java/network/brightspots/rcv/GuiConfigController.java +++ b/src/main/java/network/brightspots/rcv/GuiConfigController.java @@ -49,6 +49,7 @@ import javafx.concurrent.Task; import javafx.fxml.FXML; import javafx.fxml.Initializable; +import javafx.geometry.Insets; import javafx.scene.Node; import javafx.scene.control.Alert; import javafx.scene.control.Alert.AlertType; @@ -72,6 +73,10 @@ import javafx.scene.control.TextInputDialog; import javafx.scene.control.cell.CheckBoxTableCell; import javafx.scene.control.cell.PropertyValueFactory; +import javafx.scene.layout.Background; +import javafx.scene.layout.BackgroundFill; +import javafx.scene.layout.CornerRadii; +import javafx.scene.paint.Color; import javafx.stage.DirectoryChooser; import javafx.stage.FileChooser; import javafx.stage.FileChooser.ExtensionFilter; @@ -124,6 +129,8 @@ public class GuiConfigController implements Initializable { @FXML private Label labelCurrentlyLoaded; @FXML + private Label labelVersion; + @FXML private TextField textFieldContestName; @FXML private TextField textFieldOutputDirectory; @@ -858,6 +865,14 @@ private void setWinningRulesDefaultValues() { } private void setDefaultValues() { + String versionText = "Running %s version %s".formatted(Main.APP_NAME, Main.APP_VERSION); + if (Main.APP_VERSION.endsWith("999")) { + versionText += " -- this is a development version"; + labelVersion.setBackground(new Background(new BackgroundFill( + Color.DARKRED, CornerRadii.EMPTY, Insets.EMPTY))); + labelVersion.setTextFill(Color.WHITE); + } + labelVersion.setText(versionText); labelCurrentlyLoaded.setText("Currently loaded: "); checkBoxCandidateExcluded.setSelected(ContestConfig.SUGGESTED_CANDIDATE_EXCLUDED); diff --git a/src/main/java/network/brightspots/rcv/Main.java b/src/main/java/network/brightspots/rcv/Main.java index 63a5a6982..4a3164c22 100644 --- a/src/main/java/network/brightspots/rcv/Main.java +++ b/src/main/java/network/brightspots/rcv/Main.java @@ -37,7 +37,7 @@ public class Main extends GuiApplication { // TODO Sync version number with release.yml and build.gradle: // github.com/BrightSpots/rcv/issues/662 - public static final String APP_VERSION = "1.4.0-alpha"; + public static final String APP_VERSION = "1.3.999"; /** * Main entry point to RCTab. diff --git a/src/main/resources/network/brightspots/rcv/GuiConfigLayout.fxml b/src/main/resources/network/brightspots/rcv/GuiConfigLayout.fxml index bd08b38a5..6bc127998 100644 --- a/src/main/resources/network/brightspots/rcv/GuiConfigLayout.fxml +++ b/src/main/resources/network/brightspots/rcv/GuiConfigLayout.fxml @@ -43,11 +43,19 @@ text="Open Help Manual"/> - + + + + +