Save to the journal when switching to another activity.

This commit is contained in:
Tomeu Vizoso
2007-05-16 21:30:49 +02:00
parent 1d31c51ecc
commit 3a1d514e9f
3 changed files with 41 additions and 0 deletions
+16
View File
@@ -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