From 3d1f51c3dd4b1ef3426d1836d033292c2294bec9 Mon Sep 17 00:00:00 2001
From: Gary Martin <gary@garycmartin.com>
Date: Mon, 3 Oct 2011 18:44:45 +0100
Subject: [PATCH] Remove Reset button state changes SL#3155
Some cases are missed for state change behaviours where the button should
be disabled, this patch reduces code by removing this behaviour back to
how it was with the original Memorise UI.
---
activity.py | 2 --
memorizetoolbar.py | 8 +-------
2 files changed, 1 insertions(+), 9 deletions(-)
diff --git a/activity.py b/activity.py
index 8e07fa9..5eed76d 100644
a
|
b
|
class MemorizeActivity(Activity): |
121 | 121 | |
122 | 122 | self.table.connect('key-press-event', self.table.key_press_event) |
123 | 123 | self.table.connect('card-flipped', self.game.card_flipped) |
124 | | self.table.connect('card-flipped', |
125 | | self._memorizeToolbarBuilder.card_flipped) |
126 | 124 | self.table.connect('card-overflipped', self.game.card_overflipped) |
127 | 125 | self.table.connect('card-highlighted', self.game.card_highlighted) |
128 | 126 | |
diff --git a/memorizetoolbar.py b/memorizetoolbar.py
index 2e8f118..c7e4366 100644
a
|
b
|
class MemorizeToolbarBuilder(gobject.GObject): |
80 | 80 | self._restart_button = ToolButton('game-new') |
81 | 81 | self._restart_button.connect('clicked', self._game_reset_cb) |
82 | 82 | self._restart_button.set_tooltip(_('Restart Game')) |
83 | | self._restart_button.set_sensitive(False) |
84 | 83 | self.toolbar.insert(self._restart_button, -1) |
85 | 84 | self._restart_button.show() |
86 | 85 | |
87 | 86 | def _game_reset_cb(self, widget): |
88 | | self._restart_button.set_sensitive(False) |
89 | 87 | self.activity.game.model.count = 0 |
90 | 88 | self.emit('game_changed', None, None, 'reset', None, None) |
91 | 89 | |
92 | 90 | def update_controls(self, active): |
93 | 91 | self._size_combo.set_sensitive(active) |
94 | 92 | self._demo_games.set_sensitive(active) |
95 | | self._restart_button.set_sensitive(active and |
96 | | self.activity.game.model.count > 0) |
97 | | |
98 | | def card_flipped(self, widget, identifier, signal=False): |
99 | | self._restart_button.set_sensitive(self.activity.game.model.count > 0) |
| 93 | self._restart_button.set_sensitive(active) |
100 | 94 | |
101 | 95 | def _game_size_cb(self, widget): |
102 | 96 | game_size = int(self._sizes[self._size_combo.combo.get_active()][0]) |