Ticket #3155: 0001-Remove-Reset-button-state-changes-SL-3155.patch

File 0001-Remove-Reset-button-state-changes-SL-3155.patch, 2.3 KB (added by garycmartin, 13 years ago)
  • activity.py

    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): 
    121121
    122122        self.table.connect('key-press-event', self.table.key_press_event)
    123123        self.table.connect('card-flipped', self.game.card_flipped)
    124         self.table.connect('card-flipped',
    125                 self._memorizeToolbarBuilder.card_flipped)
    126124        self.table.connect('card-overflipped', self.game.card_overflipped)
    127125        self.table.connect('card-highlighted', self.game.card_highlighted)
    128126
  • memorizetoolbar.py

    diff --git a/memorizetoolbar.py b/memorizetoolbar.py
    index 2e8f118..c7e4366 100644
    a b class MemorizeToolbarBuilder(gobject.GObject): 
    8080        self._restart_button = ToolButton('game-new')
    8181        self._restart_button.connect('clicked', self._game_reset_cb)
    8282        self._restart_button.set_tooltip(_('Restart Game'))
    83         self._restart_button.set_sensitive(False)
    8483        self.toolbar.insert(self._restart_button, -1)
    8584        self._restart_button.show()
    8685
    8786    def _game_reset_cb(self, widget):
    88         self._restart_button.set_sensitive(False)
    8987        self.activity.game.model.count = 0
    9088        self.emit('game_changed', None, None, 'reset', None, None)
    9189
    9290    def update_controls(self, active):
    9391        self._size_combo.set_sensitive(active)
    9492        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)
    10094
    10195    def _game_size_cb(self, widget):
    10296        game_size = int(self._sizes[self._size_combo.combo.get_active()][0])