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 733454 - Clear Board button should be insensitive if it won't clear anything
Clear Board button should be insensitive if it won't clear anything
Status: RESOLVED FIXED
Product: gnome-sudoku
Classification: Applications
Component: general
3.13.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-sudoku-maint
gnome-sudoku-maint
Depends on:
Blocks:
 
 
Reported: 2014-07-20 14:18 UTC by Michael Catanzaro
Modified: 2014-07-22 20:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Disable Clear Board button when there's nothing to clear (3.04 KB, patch)
2014-07-21 21:27 UTC, Parin Porecha
reviewed Details | Review
Disable Clear Board button when there's nothing to clear (2.98 KB, patch)
2014-07-22 17:18 UTC, Parin Porecha
committed Details | Review

Description Michael Catanzaro 2014-07-20 14:18:22 UTC
If the board is empty (e.g. at the start of the game, or after using Undo), then the Clear Board button should be insensitive.
Comment 1 Parin Porecha 2014-07-21 21:27:08 UTC
Created attachment 281349 [details] [review]
Disable Clear Board button when there's nothing to clear
Comment 2 Michael Catanzaro 2014-07-22 02:01:40 UTC
Review of attachment 281349 [details] [review]:

Looks good

::: lib/sudoku-board.vala
@@ +65,3 @@
+    /* the number of fixed squares on the board */
+    private int _fixed;
+    public int fixed

This should be a one-liner:

public int fixed { get; private set; }
Comment 3 Parin Porecha 2014-07-22 13:37:04 UTC
(In reply to comment #2)
> ::: lib/sudoku-board.vala
> @@ +65,3 @@
> +    /* the number of fixed squares on the board */
> +    private int _fixed;
> +    public int fixed
> 
> This should be a one-liner:
> 
> public int fixed { get; private set; }

I followed the convention used for _rows, _cols and _filled variables in SudokuBoard (https://git.gnome.org/browse/gnome-sudoku/tree/lib/sudoku-board.vala#n19)

Since you want to change this, may I suggest changing the rest too ?
Comment 4 Michael Catanzaro 2014-07-22 15:01:44 UTC
Yeah, if you want to that'd be good (in a different patch, which you can commit without review).
Comment 5 Parin Porecha 2014-07-22 17:18:11 UTC
Created attachment 281406 [details] [review]
Disable Clear Board button when there's nothing to clear
Comment 6 Michael Catanzaro 2014-07-22 20:31:09 UTC
Perfect

Attachment 281406 [details] pushed as fca0a5d - Disable Clear Board button when there's nothing to clear