[gnome-games] chess: Fix disabling of chess clock
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] chess: Fix disabling of chess clock
- Date: Wed, 19 Jan 2011 23:29:46 +0000 (UTC)
commit c4a6ecedb810838a53aa5eef4360ff201933135a
Author: Robert Ancell <robert ancell canonical com>
Date: Thu Jan 20 10:29:37 2011 +1100
chess: Fix disabling of chess clock
glchess/src/glchess.vala | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/glchess/src/glchess.vala b/glchess/src/glchess.vala
index 78cab8c..360d8fe 100644
--- a/glchess/src/glchess.vala
+++ b/glchess/src/glchess.vala
@@ -1063,9 +1063,17 @@ public class Application
private int get_duration ()
{
+ Gtk.TreeIter iter;
+ if (duration_combo.get_active_iter (out iter))
+ {
+ int duration;
+ duration_combo.model.get (iter, 1, out duration, -1);
+ if (duration >= 0)
+ return duration;
+ }
+
var magnitude = (int) duration_adjustment.value;
int multiplier = 1;
- Gtk.TreeIter iter;
if (custom_duration_units_combo.get_active_iter (out iter))
custom_duration_units_combo.model.get (iter, 1, out multiplier, -1);
return magnitude * multiplier;
@@ -1141,6 +1149,8 @@ public class Application
/* Default to 5 minutes when setting custom duration */
else if (get_duration () <= 0)
set_duration (5 * 60, false);
+
+ save_duration ();
}
[CCode (cname = "G_MODULE_EXPORT preferences_response_cb", instance_pos = -1)]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]