+void MainWindow::update_action_buttons(uint64_t t)
+{
+ EventsModel::Status s = events->get_status_at(t);
+ bool has_selection = false;
+ bool has_selection_with_player = false;
+
+ QItemSelectionModel *select = ui->event_view->selectionModel();
+ if (select->hasSelection()) {
+ has_selection = true;
+ int row = select->selectedRows().front().row(); // Should only be one, due to our selection behavior.
+ has_selection_with_player = events->get_player_id(row).has_value();
+ }
+
+ ui->catch_->setEnabled(s.offense && has_selection_with_player);
+ ui->throwaway->setEnabled(s.offense && has_selection_with_player);
+ ui->drop->setEnabled(s.offense && has_selection_with_player);
+ ui->goal->setEnabled(s.offense && has_selection_with_player);
+ ui->offensive_soft_plus->setEnabled(s.offense && has_selection_with_player);
+ ui->offensive_soft_minus->setEnabled(s.offense && has_selection_with_player);
+
+ // TODO: be stricter
+ ui->pull->setEnabled(s.offense && has_selection_with_player);
+ ui->pull_landed->setEnabled(s.offense && has_selection_with_player);
+
+ ui->interception->setEnabled(!s.offense && has_selection_with_player);
+ ui->their_throwaway->setEnabled(!s.offense);
+ ui->our_defense->setEnabled(!s.offense && has_selection_with_player);
+ ui->their_goal->setEnabled(!s.offense);
+ ui->defensive_soft_plus->setEnabled(!s.offense && has_selection_with_player);
+ ui->defensive_soft_minus->setEnabled(!s.offense && has_selection_with_player);
+ ui->their_pull->setEnabled(!s.offense);
+ ui->our_foul->setEnabled(!s.offense && has_selection_with_player);
+
+ ui->delete_->setEnabled(has_selection);
+}
+