From 11a9b8354b07bd99024ce7938375d4ff519b63df Mon Sep 17 00:00:00 2001 From: Christian Mayer Date: Wed, 06 Jan 2010 18:14:22 +0000 Subject: moved Coach#notify('switch-to-setts') into separate method --- diff --git a/ReckonPrimer.activity/coach.py b/ReckonPrimer.activity/coach.py index a3fed96..26fd1bc 100755 --- a/ReckonPrimer.activity/coach.py +++ b/ReckonPrimer.activity/coach.py @@ -34,6 +34,10 @@ class Coach: def exercise_selected(self, key): self._ex = self._collect.select(key) self._learner.start_calcs(self._ex) + + def switch_to_settings(self, key): + self._ex = self._collect.select(key) + self._dis.offer_setting(self._ex) def notify(self, (msg, data)): """called by the observed objects""" @@ -41,9 +45,6 @@ class Coach: if msg == 'setting-done': # from display self._ex.update_setting(data) self._learner.start_calcs(self._ex) - elif msg == 'switch-to-setts': # from display - self._ex = self._collect.select(data) - self._dis.offer_setting(self._ex) else: raise Error() diff --git a/ReckonPrimer.activity/display.py b/ReckonPrimer.activity/display.py index f68494a..6f9019d 100755 --- a/ReckonPrimer.activity/display.py +++ b/ReckonPrimer.activity/display.py @@ -421,7 +421,7 @@ class Display: def switch_learner_to_setts(self, widget): """ Callback on sts_butt. asks the Coach if allowed. """ - self._co.notify(('switch-to-setts', self._coll_key)) + self._co.switch_to_settings(self._coll_key) self.collection_table.hide() def set_curr_exerc(self, exerc): -- cgit v0.9.1