[iagno/wip/redesign] Always flip the final result



commit 6f8bb7e54c326458df9e50952b560c91752c8ad7
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Mon Oct 21 22:57:29 2013 -0500

    Always flip the final result
    
    i.e. remove the unnecessary preference.
    
    This necessitates slightly reordering the preferences dialog.

 data/org.gnome.iagno.gschema.xml |    3 ---
 src/game-view.vala               |   17 +----------------
 src/iagno.vala                   |   26 +++++++-------------------
 3 files changed, 8 insertions(+), 38 deletions(-)
---
diff --git a/data/org.gnome.iagno.gschema.xml b/data/org.gnome.iagno.gschema.xml
index 2be3a5a..e1c509f 100644
--- a/data/org.gnome.iagno.gschema.xml
+++ b/data/org.gnome.iagno.gschema.xml
@@ -11,9 +11,6 @@
     <key name="tileset" type="s">
       <default>'black_and_white.svg'</default>
     </key>
-    <key name="flip-final-results" type="b">
-      <default>true</default>
-    </key>
     <key name="sound" type="b">
       <default>true</default>
       <summary>Sound</summary>
diff --git a/src/game-view.vala b/src/game-view.vala
index 54744f1..9da0f18 100644
--- a/src/game-view.vala
+++ b/src/game-view.vala
@@ -90,21 +90,6 @@ public class GameView : Gtk.DrawingArea
         set { _theme = value; tiles_pattern = null; queue_draw (); }
     }
 
-    private bool _flip_final_result;
-    public bool flip_final_result
-    {
-        get { return _flip_final_result; }
-        set
-        {
-            _flip_final_result = value;
-            if (game == null)
-                return;
-            for (var x = 0; x < game.width; x++)
-                for (var y = 0; y < game.height; y++)
-                    square_changed_cb (x, y);
-        }
-    }
-
     public override Gtk.SizeRequestMode get_request_mode ()
     {
         return Gtk.SizeRequestMode.WIDTH_FOR_HEIGHT;
@@ -250,7 +235,7 @@ public class GameView : Gtk.DrawingArea
 
         set_square (x, y, pixmap);
 
-        if (game.is_complete () && flip_final_result && game.n_light_tiles > 0 && game.n_dark_tiles > 0)
+        if (game.is_complete () && game.n_light_tiles > 0 && game.n_dark_tiles > 0)
         {
             /*
              * Show the actual final positions of the pieces before flipping the board.
diff --git a/src/iagno.vala b/src/iagno.vala
index 614eb56..416a308 100644
--- a/src/iagno.vala
+++ b/src/iagno.vala
@@ -111,7 +111,6 @@ public class Iagno : Gtk.Application
         view.vexpand = true;
         view.game = game;
         view.move.connect (player_move_cb);
-        view.flip_final_result = settings.get_boolean ("flip-final-results");
         var tile_set = settings.get_string ("tileset");
         view.theme = Path.build_filename (DATA_DIRECTORY, "themes", tile_set);
         view.show ();
@@ -425,12 +424,6 @@ public class Iagno : Gtk.Application
         settings.set_boolean ("sound", play_sounds);
     }
 
-    private void flip_final_toggled_cb (Gtk.ToggleButton widget)
-    {
-        view.flip_final_result = widget.get_active ();
-        settings.set_boolean ("flip-final-results", view.flip_final_result);
-    }
-
     private void propbox_response_cb (Gtk.Widget widget, int response_id)
     {
         widget.hide ();
@@ -535,20 +528,10 @@ public class Iagno : Gtk.Application
             combo.set_active_iter (iter);
         grid.attach (combo, 1, 1, 1, 1);
 
-        var enable_sounds_button = new Gtk.CheckButton.with_mnemonic (_("E_nable sounds"));
-        enable_sounds_button.set_active (settings.get_boolean ("sound"));
-        enable_sounds_button.toggled.connect (sound_select);
-        grid.attach (enable_sounds_button, 0, 2, 2, 1);
-
-        var flip_final_button = new Gtk.CheckButton.with_mnemonic (_("_Flip final results"));
-        flip_final_button.set_active (settings.get_boolean ("flip-final-results"));
-        flip_final_button.toggled.connect (flip_final_toggled_cb);
-        grid.attach (flip_final_button, 0, 4, 2, 1);
-
         label = new Gtk.Label.with_mnemonic (_("_Tile set:"));
         label.set_alignment (0.0f, 0.5f);
         label.expand = true;
-        grid.attach (label, 0, 5, 1, 1);
+        grid.attach (label, 0, 2, 1, 1);
 
         var theme_combo = new Gtk.ComboBox ();
         renderer = new Gtk.CellRendererText ();
@@ -595,7 +578,12 @@ public class Iagno : Gtk.Application
 
         label.set_mnemonic_widget (theme_combo);
         theme_combo.changed.connect (theme_changed_cb);
-        grid.attach (theme_combo, 1, 5, 1, 1);
+        grid.attach (theme_combo, 1, 2, 1, 1);
+
+        var enable_sounds_button = new Gtk.CheckButton.with_mnemonic (_("E_nable sounds"));
+        enable_sounds_button.set_active (settings.get_boolean ("sound"));
+        enable_sounds_button.toggled.connect (sound_select);
+        grid.attach (enable_sounds_button, 0, 3, 2, 1);
 
         propbox.show_all ();
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]