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 735494 - [PATCH] Reset earmark_pickers when clearing board.
[PATCH] Reset earmark_pickers when clearing board.
Status: RESOLVED FIXED
Product: gnome-sudoku
Classification: Applications
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gnome-sudoku-maint
gnome-sudoku-maint
Depends on:
Blocks:
 
 
Reported: 2014-08-27 03:11 UTC by Arnaud B.
Modified: 2014-09-04 21:42 UTC
See Also:
GNOME target: ---
GNOME version: 3.13/3.14


Attachments
Reset earmark_pickers when clearing board. (1.65 KB, patch)
2014-08-27 03:11 UTC, Arnaud B.
needs-work Details | Review
Reset earmark_pickers when clearing board. (2.10 KB, patch)
2014-08-29 22:33 UTC, Arnaud B.
needs-work Details | Review
Reset earmark_pickers when clearing board. (2.10 KB, patch)
2014-09-01 16:36 UTC, Arnaud B.
committed Details | Review

Description Arnaud B. 2014-08-27 03:11:59 UTC
Created attachment 284572 [details] [review]
Reset earmark_pickers when clearing board.

The earkmarks popovers are not reseted when the player wants to clear the board. Here is a patch.
Comment 1 Parin Porecha 2014-08-29 21:38:39 UTC
Review of attachment 284572 [details] [review]:

I had written a patch for this bug before - https://git.gnome.org/browse/gnome-sudoku/tree/lib/sudoku-game.vala#n82

It did clear the earmarks array, but the buttons in earmark picker were still left active.
But since your solution takes care of both, we can remove that line in sudoku-game.vala
It'd be great if you can include it in this patch.

Thanks !

::: src/sudoku-view.vala
@@ +351,3 @@
+    {
+        if (earmark_picker != null)
+            for (var i = 0; i <= 8; i++)

Please change the upper limit here to SudokuBoard's max_val.
Comment 2 Arnaud B. 2014-08-29 22:33:39 UTC
Created attachment 284866 [details] [review]
Reset earmark_pickers when clearing board.

You’re right, here is the patch updated.
Comment 3 Parin Porecha 2014-09-01 13:24:08 UTC
Review of attachment 284866 [details] [review]:

I'm getting a CRITICAL error when there are earmarks present on the board, and I click on 'Clear Board' -
(gnome-sudoku:9370): Gtk-CRITICAL **: gtk_toggle_button_set_active: assertion 'GTK_IS_TOGGLE_BUTTON (toggle_button)' failed
Comment 4 Arnaud B. 2014-09-01 16:36:13 UTC
Created attachment 285032 [details] [review]
Reset earmark_pickers when clearing board.

Oops… ^^’ It was a “for (var i = 0; i <= game.board.max_val; i++)” thing (one more than necessary), that’s corrected.
Comment 5 Michael Catanzaro 2014-09-04 21:42:14 UTC
Looks good, thanks!

Attachment 285032 [details] pushed as 36bd743 - Reset earmark_pickers when clearing board.