After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 758775 - Disable selecting pieces after the game is over
Disable selecting pieces after the game is over
Status: RESOLVED FIXED
Product: gnome-chess
Classification: Applications
Component: General
git master
Other All
: Normal normal
: ---
Assigned To: Sahil Sareen
gnome-chess-maint
Depends on:
Blocks:
 
 
Reported: 2015-11-28 14:05 UTC by Sahil Sareen
Modified: 2015-12-05 13:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Player has resigned, pieces allowed to be selected (73.94 KB, image/png)
2015-11-28 14:05 UTC, Sahil Sareen
  Details
Game is over, pieces allowed to be selected (79.90 KB, image/png)
2015-11-28 14:06 UTC, Sahil Sareen
  Details
Disable selecting pieces after game is over (1.01 KB, patch)
2015-11-28 14:43 UTC, Sahil Sareen
none Details | Review
Disable selecting pieces after game is over (1.05 KB, patch)
2015-11-29 04:46 UTC, Sahil Sareen
accepted-commit_now Details | Review

Description Sahil Sareen 2015-11-28 14:05:08 UTC
Created attachment 316441 [details]
Player has resigned, pieces allowed to be selected

See attached screenshot.
Comment 1 Sahil Sareen 2015-11-28 14:06:10 UTC
Created attachment 316442 [details]
Game is over, pieces allowed to be selected
Comment 2 Sahil Sareen 2015-11-28 14:43:07 UTC
Created attachment 316444 [details] [review]
Disable selecting pieces after game is over
Comment 3 Michael Catanzaro 2015-11-28 16:40:58 UTC
Review of attachment 316444 [details] [review]:

Wrong patch, I think :)
Comment 4 Sahil Sareen 2015-11-29 04:46:21 UTC
Created attachment 316463 [details] [review]
Disable selecting pieces after game is over

Uploading the right patch this time :P
Comment 5 Michael Catanzaro 2015-11-29 16:26:03 UTC
Review of attachment 316463 [details] [review]:

Thanks, good after nits:

::: src/chess-view.vala
@@ +277,3 @@
             return false;
+        // If the game is over, disable selection of pieces
+        if(scene.game.result != ChessResult.IN_PROGRESS)

OK, but watch your code style here! Leave one blank line above the comment, and one blank space between the if and the opening parentheses.
Comment 6 Sahil Sareen 2015-12-05 13:23:44 UTC
Fixed and pushed to master. Time to update the style-checker :P

To ssh://ssareen@git.gnome.org/git/gnome-chess
   7e06fa3..51b6321  master -> master