[gnome-chess] Warn user when engine fails to launch



commit 41dc6bc6b8fd21b923e961b9e6f7708e46830037
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Tue Jan 7 19:08:53 2014 -0600

    Warn user when engine fails to launch

 src/gnome-chess.vala |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/gnome-chess.vala b/src/gnome-chess.vala
index 15a8b91..9357e15 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -511,7 +511,15 @@ public class Application : Gtk.Application
             opponent_engine.error.connect (engine_error_cb);
             opponent_engine.claim_draw.connect (engine_claim_draw_cb);
             opponent_engine.offer_draw.connect (engine_offer_draw_cb);
-            opponent_engine.start ();
+
+            if (!opponent_engine.start ())
+            {
+                disable_window_action (SAVE_GAME_ACTION_NAME);
+                game.result = ChessResult.BUG;
+                game.rule = ChessRule.DEATH;
+                game_end_cb (game);
+                return;
+            }
         }
 
         /* Replay current moves */


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