[gnome-2048] Range target-value.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-2048] Range target-value.
- Date: Sat, 26 Jan 2019 11:46:23 +0000 (UTC)
commit 66d31dca8be79b5815c22f91173ee67e3397a19b
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Sat Jan 26 10:11:59 2019 +0100
Range target-value.
Disallow setting unmeaningful values.
data/org.gnome.2048.gschema.xml | 3 ++-
src/game.vala | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/data/org.gnome.2048.gschema.xml b/data/org.gnome.2048.gschema.xml
index 5c58fc0..2b84e27 100644
--- a/data/org.gnome.2048.gschema.xml
+++ b/data/org.gnome.2048.gschema.xml
@@ -35,8 +35,9 @@
<!-- Translators: description of a settings key, see 'dconf-editor /org/gnome/2048/cols' -->
<description>Game grid number of columns.</description>
</key>
- <key name="target-value" type="i">
+ <key name="target-value" type="i"> <!-- TODO type="y", only storing the power of 2 -->
<default>2048</default>
+ <range min="4"/>
<!-- Translators: summary of a settings key, see 'dconf-editor /org/gnome/2048/target-value' -->
<summary>Target value</summary>
<!-- Translators: description of a settings key, see 'dconf-editor /org/gnome/2048/target-value' -->
diff --git a/src/game.vala b/src/game.vala
index da896ad..42e981e 100644
--- a/src/game.vala
+++ b/src/game.vala
@@ -81,7 +81,7 @@ public class Game : Object
_animations_duration = (int)_settings.get_double ("animations-speed");
- _settings.bind ("target-value", _grid, "target_value", GLib.SettingsBindFlags.DEFAULT);
+ _settings.bind ("target-value", _grid, "target-value", GLib.SettingsBindFlags.DEFAULT);
_to_move = new Gee.LinkedList<TileMovement?> ();
_to_hide = new Gee.LinkedList<TileMovement?> ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]