[gnome-nibbles] Fix new game button unpausing the game
- From: Iulian Radu <iulianradu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-nibbles] Fix new game button unpausing the game
- Date: Mon, 26 Oct 2015 00:22:57 +0000 (UTC)
commit d2ae20791192814e49805e78440ae837cbb635dc
Author: Razvan Chitu <razvan ch95 gmail com>
Date: Thu Sep 17 22:13:33 2015 +0300
Fix new game button unpausing the game
https://bugzilla.gnome.org/show_bug.cgi?id=754608
src/gnome-nibbles.vala | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/gnome-nibbles.vala b/src/gnome-nibbles.vala
index 7aa81fb..9a22a1d 100644
--- a/src/gnome-nibbles.vala
+++ b/src/gnome-nibbles.vala
@@ -356,7 +356,8 @@ public class Nibbles : Gtk.Application
private void new_game_cb ()
{
- pause_cb ();
+ if (game.is_running)
+ game.stop ();
var dialog = new Gtk.MessageDialog (window,
Gtk.DialogFlags.MODAL,
@@ -370,8 +371,12 @@ public class Nibbles : Gtk.Application
dialog.response.connect ((response_id) => {
if (response_id == Gtk.ResponseType.OK)
show_new_game_screen_cb ();
- if (response_id == Gtk.ResponseType.CANCEL)
- game.unpause ();
+ if ((response_id == Gtk.ResponseType.CANCEL || response_id == Gtk.ResponseType.DELETE_EVENT)
+ && !game.is_paused)
+ {
+ game.start ();
+ view.grab_focus ();
+ }
dialog.destroy ();
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]