From cdbb53f72cb319e2d2374b69d00e6656646e87a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Teuli=C3=A8re?= Date: Tue, 29 Jan 2013 22:55:20 +0100 Subject: [PATCH] Gray out the players area when the game is finished. This was broken since 196e02f9ad30f5708596f91ce1dcb7ad1afe88e5. --- game/duplicate.cpp | 2 ++ qt/player_widget.cpp | 2 +- qt/training_widget.cpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/game/duplicate.cpp b/game/duplicate.cpp index 24a238a..473c95e 100644 --- a/game/duplicate.cpp +++ b/game/duplicate.cpp @@ -64,6 +64,8 @@ Duplicate::Duplicate(const GameParams &iParams, const Game *iMasterGame) int Duplicate::play(const wstring &iCoord, const wstring &iWord) { + ASSERT(!isFinished(), "The game is already finished"); + Player &currPlayer = *m_players[m_currPlayer]; ASSERT(currPlayer.isHuman(), "Human player expected"); diff --git a/qt/player_widget.cpp b/qt/player_widget.cpp index 451d38d..2c394bb 100644 --- a/qt/player_widget.cpp +++ b/qt/player_widget.cpp @@ -115,7 +115,7 @@ void PlayerWidget::refresh() lineEditCoords->clear(); lineEditChange->clear(); - if (!m_game->isLastTurn()) + if (!m_game->isLastTurn() || m_game->isFinished()) { // Do not allow entering a move when displaying an old turn setEnabled(false); diff --git a/qt/training_widget.cpp b/qt/training_widget.cpp index 1edb1e9..7af964a 100644 --- a/qt/training_widget.cpp +++ b/qt/training_widget.cpp @@ -165,7 +165,7 @@ void TrainingWidget::refresh() pushButtonSearch->setEnabled(m_model->rowCount() == 0 && lineEditRack->text() != ""); // Do not allow entering a move when displaying an old turn - setEnabled(m_game->isLastTurn()); + setEnabled(m_game->isLastTurn() && !m_game->isFinished()); } }