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 733415 - Rework Preferences dialog and add --level command-line option.
Rework Preferences dialog and add --level command-line option.
Status: RESOLVED FIXED
Product: iagno
Classification: Applications
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: iagno-maint
iagno-maint
Depends on:
Blocks:
 
 
Reported: 2014-07-19 19:33 UTC by Arnaud B.
Modified: 2014-07-21 12:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Switch notation (2.14 KB, patch)
2014-07-19 19:33 UTC, Arnaud B.
reviewed Details | Review
Change Preferences dialog (6.88 KB, patch)
2014-07-19 19:34 UTC, Arnaud B.
reviewed Details | Review
Sync sound setting with Preferences checkbox (953 bytes, patch)
2014-07-19 19:35 UTC, Arnaud B.
accepted-commit_now Details | Review
Remove unused variable. (637 bytes, patch)
2014-07-19 19:35 UTC, Arnaud B.
none Details | Review
Add --level command-line option. (3.00 KB, patch)
2014-07-19 19:36 UTC, Arnaud B.
needs-work Details | Review
Respect gtk_list_store_set() syntax. (2.10 KB, patch)
2014-07-19 19:37 UTC, Arnaud B.
rejected Details | Review
Use enum for play-as setting. (3.32 KB, patch)
2014-07-20 18:44 UTC, Arnaud B.
committed Details | Review
Change Preferences combos and the way settings work. (7.26 KB, patch)
2014-07-20 18:53 UTC, Arnaud B.
committed Details | Review
Sync in Preferences dialog the main settings. (3.23 KB, patch)
2014-07-20 19:03 UTC, Arnaud B.
committed Details | Review
Add --level command-line option. (2.54 KB, patch)
2014-07-20 19:04 UTC, Arnaud B.
committed Details | Review
Add --first, --second and --two-players command-line options. (1.84 KB, patch)
2014-07-20 20:28 UTC, Arnaud B.
committed Details | Review
Add jumplist. (798 bytes, patch)
2014-07-20 20:29 UTC, Arnaud B.
committed Details | Review

Description Arnaud B. 2014-07-19 19:33:39 UTC
Created attachment 281194 [details] [review]
Switch notation

As discussed on [1], there is a need to rework the Preferences dialog (and the way the settings work) in order to implement correctly jumplist. Here is a set of patches that does this, and some cleaning:
* 0001 is a notation switch: using 2 for dark player (who plays first) was quite strange;
* 0002 change Preferences dialog, as explained previously;
* 0003 syncs the sound checkbox and the sound setting;
* 0004 is a cleaning;
* 0005 adds --level command-line option;
* 0006 is a probably good thing, if I understood correctly.


[1] https://bugzilla.gnome.org/show_bug.cgi?id=733224
Comment 1 Arnaud B. 2014-07-19 19:34:25 UTC
Created attachment 281195 [details] [review]
Change Preferences dialog
Comment 2 Arnaud B. 2014-07-19 19:35:01 UTC
Created attachment 281196 [details] [review]
Sync sound setting with Preferences checkbox
Comment 3 Arnaud B. 2014-07-19 19:35:33 UTC
Created attachment 281197 [details] [review]
Remove unused variable.
Comment 4 Arnaud B. 2014-07-19 19:36:07 UTC
Created attachment 281198 [details] [review]
Add --level command-line option.
Comment 5 Arnaud B. 2014-07-19 19:37:48 UTC
Created attachment 281199 [details] [review]
Respect gtk_list_store_set() syntax.

Not sure it’s necessary… needs a check.
Comment 6 Michael Catanzaro 2014-07-20 14:30:35 UTC
Review of attachment 281194 [details] [review]:

Eh, I don't want to reject this since it's no worse than what was here before, but this should really be an enum.  See Chess if you need an example of how to use enums in UI files; you can access them from the code as if they were strings.
Comment 7 Michael Catanzaro 2014-07-20 14:42:28 UTC
Review of attachment 281195 [details] [review]:

OK, minor changes only here:

* Let's use enums instead of ints in the gschema file here as well.
* For the Game mode combo, let's put "Two players" on the bottom of the list
* Let's rename "Player plays first" to "Play first (Dark)" and "Player plays second" to "Play second (Light)"
* I think we can rename "Computer's level" to simply "Computer" (aside: see [1] for the right apostrophe character)

[1] https://wiki.gnome.org/Design/HIG/Typography
Comment 8 Michael Catanzaro 2014-07-20 14:47:42 UTC
Review of attachment 281196 [details] [review]:

Is this so that the checkbox gets changed properly if you change the setting manually while the game is running, or from the command line on a remote instance?
Comment 9 Michael Catanzaro 2014-07-20 14:48:42 UTC
Comment on attachment 281197 [details] [review]
Remove unused variable.

OK, but I spotted this unused variable before I spotted this patch, so I already pushed an identical commit.
Comment 10 Michael Catanzaro 2014-07-20 14:51:01 UTC
Review of attachment 281198 [details] [review]:

Need to print a warning if the user selects an invalid level.

Also, in the man page, mention whether 1 is the easiest level and 3 the hardest, or vice-versa.
Comment 11 Michael Catanzaro 2014-07-20 14:52:35 UTC
Review of attachment 281199 [details] [review]:

It's handled for us automatically; see how it's declared in the vapi:

[CCode (sentinel = "-1")]
public void @set (Gtk.TreeIter iter, ...);
Comment 12 Arnaud B. 2014-07-20 18:44:30 UTC
Created attachment 281262 [details] [review]
Use enum for play-as setting.

Yeah, the enum is a good thing here.
Comment 13 Arnaud B. 2014-07-20 18:53:44 UTC
Created attachment 281263 [details] [review]
Change Preferences combos and the way settings work.

I really don’t see why we should use an enum for the computer level:
* we have to deal with it as an integer in the command-line;
* we have to deal with it as an integer in the computer’s AI creation;
* it doesn’t help to understand anything, “1” for “level 1” is clear;
* a number is more universaly understood than an english word.

I changed the other things. I’ll try to remember to use the normal apostrophe (bépo keyboard here…) in the code, even if I usually don’t use UTF-8 chars in it.
Comment 14 Arnaud B. 2014-07-20 19:03:22 UTC
Created attachment 281264 [details] [review]
Sync in Preferences dialog the main settings.

> Is this so that the checkbox gets changed properly if you change the
> setting manually while the game is running, or from the command line
> on a remote instance?
It permits to update the dialog (checkbox, 2 of the 3 comboboxes, the tileset is not needed and is hard to code…) when the settings is changed externaly, via dconf-editor, a gsettings command-line option, or another instance with command-line options like --level or --mute.
Comment 15 Arnaud B. 2014-07-20 19:04:16 UTC
Created attachment 281265 [details] [review]
Add --level command-line option.
Comment 16 Arnaud B. 2014-07-20 20:28:47 UTC
Created attachment 281266 [details] [review]
Add --first, --second and --two-players command-line options.

Oh, two more things… ^^’
Comment 17 Arnaud B. 2014-07-20 20:29:17 UTC
Created attachment 281267 [details] [review]
Add jumplist.
Comment 18 Michael Catanzaro 2014-07-21 02:26:36 UTC
Review of attachment 281262 [details] [review]:

ok
Comment 19 Michael Catanzaro 2014-07-21 02:28:48 UTC
Review of attachment 281263 [details] [review]:

ok
Comment 20 Michael Catanzaro 2014-07-21 02:29:31 UTC
Review of attachment 281264 [details] [review]:

ok
Comment 21 Michael Catanzaro 2014-07-21 02:31:33 UTC
Review of attachment 281265 [details] [review]:

Sucks that we need that extra member variable, but we do
Comment 22 Michael Catanzaro 2014-07-21 02:33:06 UTC
Review of attachment 281266 [details] [review]:

ok

::: src/iagno.vala
@@ +210,3 @@
 
+        /* The game mode is set for the next game. */
+        if (options.contains("second"))

Missing a space here (and copypasted below)

I'll commit with it fixed, since I'm releasing now
Comment 23 Michael Catanzaro 2014-07-21 02:33:45 UTC
Review of attachment 281267 [details] [review]:

OK
Comment 24 Michael Catanzaro 2014-07-21 02:37:17 UTC
Thanks!

Hope this jumplist works, cause I haven't tried it. I'm not even sure which version of GNOME Shell added jumplists....

Attachment 281262 [details] pushed as 8228c5b - Use enum for play-as setting.
Attachment 281263 [details] pushed as c2da2d3 - Change Preferences combos and the way settings work.
Attachment 281264 [details] pushed as ba7beaf - Sync in Preferences dialog the main settings.
Attachment 281265 [details] pushed as f105c75 - Add --level command-line option.
Attachment 281266 [details] pushed as fd02c26 - Add --first, --second and --two-players command-line options.
Attachment 281267 [details] pushed as ff5b1ab - Add jumplist.
Comment 25 Michael Catanzaro 2014-07-21 03:16:10 UTC
For future reference, the actions list should end in a semicolon
Comment 26 Arnaud B. 2014-07-21 04:49:23 UTC
Thank’s! Jumplists are here frome 3.11.5-3.12[1], it’s quite new. Concerning the Actions list, if I read correctly[2], it’s optionnal.

[1] https://bugzilla.gnome.org/show_bug.cgi?id=669603
[2] http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s03.html
Comment 27 Michael Catanzaro 2014-07-21 12:53:21 UTC
Eh, OK, must be a desktop-file-validate bug then... I don't care enough to report it rather than just add a semicolon :)