Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/activity.py
diff options
context:
space:
mode:
authorBenjamin Schwartz <bens@alum.mit.edu>2008-02-08 02:16:39 (GMT)
committer Benjamin Schwartz <bens@alum.mit.edu>2008-02-08 02:16:39 (GMT)
commit0845a67272127be0971930cde496f3eeaeb36345 (patch)
treebc84c687f93bf882c0b35012d0d4c897a253cbbd /activity.py
parent8ff827e0e9e7147e9cc2cc28b1a11d9dce17b098 (diff)
Refactored to create dobject, inc. version to 2
Diffstat (limited to 'activity.py')
-rw-r--r--activity.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/activity.py b/activity.py
index 9789f30..7ae8b60 100644
--- a/activity.py
+++ b/activity.py
@@ -26,6 +26,7 @@ from sugar.presence.tubeconn import TubeConnection
import stopwatch
import gobject
+import dobject
import cPickle
import gtk.gdk
@@ -46,14 +47,13 @@ class StopWatchActivity(Activity):
self.set_toolbox(toolbox)
toolbox.show()
- self.model = stopwatch.Model()
- self.controller = stopwatch.Controller(self.model)
- self.gui = stopwatch.GUIView(self.model, self.controller)
+ self.tubebox = dobject.TubeBox()
+ self.timer = dobject.TimeHandler("main", self.tubebox)
+ self.gui = stopwatch.GUIView(self.tubebox, self.timer)
self.set_canvas(self.gui.display)
self.show_all()
- self.tubehandler = None # Shared session
self.initiating = False
# get the Presence Service
@@ -122,17 +122,16 @@ class StopWatchActivity(Activity):
tube_conn = TubeConnection(self.conn,
self.tubes_chan[telepathy.CHANNEL_TYPE_TUBES],
id, group_iface=self.text_chan[telepathy.CHANNEL_INTERFACE_GROUP])
- self.tubehandler = stopwatch.TubeHandler(tube_conn, self.initiating,
- self.model, self.controller)
+ self.tubebox.insert_tube(tube_conn, self.initiating)
def read_file(self, file_path):
f = open(file_path, 'r')
q = cPickle.load(f)
f.close()
- self.model.reset(q)
+ self.gui.set_all(q)
def write_file(self, file_path):
- q = self.model.get_all()
+ q = self.gui.get_all()
f = open(file_path, 'w')
cPickle.dump(q, f)
f.close()