diff --git a/vpin-studio-ui/src/main/java/de/mephisto/vpin/ui/competitions/IScoredSubscriptionsController.java b/vpin-studio-ui/src/main/java/de/mephisto/vpin/ui/competitions/IScoredSubscriptionsController.java index 293e4bdfb..621483472 100644 --- a/vpin-studio-ui/src/main/java/de/mephisto/vpin/ui/competitions/IScoredSubscriptionsController.java +++ b/vpin-studio-ui/src/main/java/de/mephisto/vpin/ui/competitions/IScoredSubscriptionsController.java @@ -9,12 +9,17 @@ import de.mephisto.vpin.connectors.vps.model.VpsTableVersion; import de.mephisto.vpin.restclient.competitions.CompetitionRepresentation; import de.mephisto.vpin.restclient.competitions.CompetitionType; +import de.mephisto.vpin.restclient.games.GameRepresentation; import de.mephisto.vpin.restclient.players.PlayerRepresentation; -import de.mephisto.vpin.ui.*; +import de.mephisto.vpin.ui.NavigationController; +import de.mephisto.vpin.ui.NavigationOptions; +import de.mephisto.vpin.ui.Studio; +import de.mephisto.vpin.ui.WaitOverlayController; import de.mephisto.vpin.ui.competitions.dialogs.CompetitionSavingProgressModel; import de.mephisto.vpin.ui.competitions.dialogs.GameRoomCellContainer; import de.mephisto.vpin.ui.competitions.dialogs.IScoredGameCellContainer; import de.mephisto.vpin.ui.competitions.validation.CompetitionValidationTexts; +import de.mephisto.vpin.ui.tables.TableDialogs; import de.mephisto.vpin.ui.tournaments.VpsTableContainer; import de.mephisto.vpin.ui.tournaments.VpsVersionContainer; import de.mephisto.vpin.ui.util.LocalizedValidation; @@ -71,6 +76,9 @@ public class IScoredSubscriptionsController extends BaseCompetitionController im @FXML private Button addBtn; + @FXML + private Button eventLogBtn; + @FXML private Button reloadBtn; @@ -127,6 +135,19 @@ private void onCompetitionCreate() { } + @FXML + private void onEventLog() { + List selections = new ArrayList<>(tableView.getSelectionModel().getSelectedItems()); + if (selections.isEmpty()) { + return; + } + CompetitionRepresentation competitionRepresentation = selections.get(0); + GameRepresentation game = client.getGameService().getGame(competitionRepresentation.getGameId()); + if (game != null && game.isEventLogAvailable()) { + TableDialogs.openEventLogDialog(game); + } + } + @FXML private void onDelete() { List selections = new ArrayList<>(tableView.getSelectionModel().getSelectedItems()); @@ -374,6 +395,9 @@ private void refreshView(Optional competition) { CompetitionRepresentation newSelection = null; if (competition.isPresent()) { newSelection = competition.get(); + + GameRepresentation game = client.getGameService().getGame(newSelection.getGameId()); + eventLogBtn.setDisable(game == null || !game.isEventLogAvailable()); } PlayerRepresentation defaultPlayer = client.getPlayerService().getDefaultPlayer(); @@ -381,6 +405,7 @@ private void refreshView(Optional competition) { reloadBtn.setDisable(defaultPlayer == null); addBtn.setDisable(defaultPlayer == null); + if (defaultPlayer == null) { tableView.setPlaceholder(new Label(" No default player set!\n" + "Go to the players section and set the default player for this cabinet!")); diff --git a/vpin-studio-ui/src/main/resources/de/mephisto/vpin/ui/competitions/tab-competitions-iscored.fxml b/vpin-studio-ui/src/main/resources/de/mephisto/vpin/ui/competitions/tab-competitions-iscored.fxml index 415ff068d..eb3568c6c 100644 --- a/vpin-studio-ui/src/main/resources/de/mephisto/vpin/ui/competitions/tab-competitions-iscored.fxml +++ b/vpin-studio-ui/src/main/resources/de/mephisto/vpin/ui/competitions/tab-competitions-iscored.fxml @@ -8,6 +8,7 @@ + @@ -70,6 +71,18 @@ + +