[gnome-chess] Always forget games after they are completed



commit c85d9e1d796934757b4af61b82f1fe82cbbe61a7
Author: Michael Catanzaro <mike catanzaro gmail com>
Date:   Sat Jul 27 09:09:49 2013 -0500

    Always forget games after they are completed

 src/gnome-chess.vala |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/src/gnome-chess.vala b/src/gnome-chess.vala
index b5bff14..9c648d3 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -1086,11 +1086,20 @@ public class Application : Gtk.Application
             dialog.destroy ();
 
             if (result == Gtk.ResponseType.CANCEL || result == Gtk.ResponseType.DELETE_EVENT)
+            {
                 return;
+            }
             else if (result == Gtk.ResponseType.YES)
-                save_game (Gtk.Stock.DISCARD, Gtk.Stock.SAVE); /* Your very last chance to save */
-            else
+            {
+                /* Your very last chance to save */
+                save_game (Gtk.Stock.DISCARD, Gtk.Stock.SAVE);
+            }
+            else if (game.result != ChessResult.IN_PROGRESS)
+            {
                 warn_if_fail (result == Gtk.ResponseType.NO);
+                /* Remove completed game from history */
+                autosave ();
+            }
         }
 
         start_new_game ();


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