From 6c66e2b2de63b6a8159835516ee229bda3253bc2 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 23 Apr 2023 10:58:53 +0100 Subject: Support preferences in the GTK frontend. Finally, some user-visible behaviour changes as a payoff for all that preparation work! In this commit, the GTK puzzles get a 'Preferences' option in the menu, which presents a dialog box to configure the preference settings. On closing that dialog box, the puzzle preferences are enacted immediately, and also saved to a configuration file where the next run of the same puzzle will reload them. The default file location is ~/.config/sgt-puzzles/.conf, although you can override the .config dir via $XDG_CONFIG_HOME or override the Puzzles-specific subdir with $SGT_PUZZLES_DIR. This is the first commit that actually exposes all the new preferences work to the user, and therefore, I've also added documentation of all the current preference options. --- puzzles.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'puzzles.h') diff --git a/puzzles.h b/puzzles.h index e429c26..4084aa0 100644 --- a/puzzles.h +++ b/puzzles.h @@ -388,6 +388,8 @@ void free_cfg(config_item *cfg); void free_keys(key_label *keys, int nkeys); void obfuscate_bitmap(unsigned char *bmp, int bits, bool decode); char *fgetline(FILE *fp); +char *make_prefs_path(const char *dir, const char *sep, + const game *game, const char *suffix); /* allocates output each time. len is always in bytes of binary data. * May assert (or just go wrong) if lengths are unchecked. */ -- cgit v1.1