Skip to content

Commit

Permalink
use *.999 for a development version and flag it in UI
Browse files Browse the repository at this point in the history
  • Loading branch information
artoonie committed Sep 15, 2023
1 parent 2d47d57 commit db4ca37
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/network/brightspots/rcv/GuiConfigController.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -858,6 +865,15 @@ 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: <New Config>");

checkBoxCandidateExcluded.setSelected(ContestConfig.SUGGESTED_CANDIDATE_EXCLUDED);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/network/brightspots/rcv/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
18 changes: 13 additions & 5 deletions src/main/resources/network/brightspots/rcv/GuiConfigLayout.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,19 @@
text="Open Help Manual"/>
</Menu>
</MenuBar>
<Label fx:id="labelCurrentlyLoaded">
<padding>
<Insets bottom="8.0" left="8.0" right="8.0" top="8.0"/>
</padding>
</Label>
<HBox alignment="CENTER_LEFT">
<Label fx:id="labelCurrentlyLoaded">
<padding>
<Insets bottom="8.0" left="8.0" right="8.0" top="8.0"/>
</padding>
</Label>
<Region HBox.hgrow="ALWAYS"/>
<Label fx:id="labelVersion" alignment="CENTER_RIGHT" minWidth="200.0">
<padding>
<Insets bottom="8.0" left="8.0" right="8.0" top="8.0"/>
</padding>
</Label>
</HBox>
</VBox>
</top>
<center>
Expand Down

0 comments on commit db4ca37

Please sign in to comment.