diff options
author | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2007-05-16 19:30:49 (GMT) |
---|---|---|
committer | Tomeu Vizoso <tomeu@tomeuvizoso.net> | 2007-05-16 19:30:49 (GMT) |
commit | 3a1d514e9fa197e0c13c7763b5ace9fc56342a61 (patch) | |
tree | a8d9043634ea54f9fee52956a78c45e751ff78e8 /sugar/activity/activity.py | |
parent | 1d31c51eccf37e081f521cc5091fea668824a883 (diff) |
Save to the journal when switching to another activity.
Diffstat (limited to 'sugar/activity/activity.py')
-rw-r--r-- | sugar/activity/activity.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sugar/activity/activity.py b/sugar/activity/activity.py index b9be5d5..421d7ba 100644 --- a/sugar/activity/activity.py +++ b/sugar/activity/activity.py @@ -146,6 +146,10 @@ class Activity(Window, gtk.Container): 'joined': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ([])) } + __gproperties__ = { + 'active': (bool, None, None, False, gobject.PARAM_READWRITE) + } + def __init__(self, handle, create_jobject=True): """Initialise the Activity @@ -175,6 +179,7 @@ class Activity(Window, gtk.Container): self.connect('destroy', self._destroy_cb) + self._active = False self._activity_id = handle.activity_id self._pservice = presenceservice.get_instance() self._shared_activity = None @@ -213,6 +218,17 @@ class Activity(Window, gtk.Container): else: self.jobject = None + def do_set_property(self, pspec, value): + if pspec.name == 'active': + if self._active != value: + self._active = value + if not self._active and self.jobject: + self.save() + + def do_get_property(self, pspec): + if pspec.name == 'active': + return self._active + def _internal_jobject_create_cb(self): pass |