Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mayer <christian.mayer@student.tugraz.at>2010-01-06 18:14:22 (GMT)
committer Christian Mayer <christian.mayer@student.tugraz.at>2010-01-06 18:14:22 (GMT)
commit11a9b8354b07bd99024ce7938375d4ff519b63df (patch)
tree741257514389e1c44d746d1630d7de6788fe4e5e
parent6c3542948f4556f20773623568c0dec78f496d85 (diff)
moved Coach#notify('switch-to-setts') into separate method
-rwxr-xr-xReckonPrimer.activity/coach.py7
-rwxr-xr-xReckonPrimer.activity/display.py2
2 files changed, 5 insertions, 4 deletions
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):