diff options
author | Eben Eliason <eben@sugar.(none)> | 2008-08-15 09:32:14 (GMT) |
---|---|---|
committer | Eben Eliason <eben@sugar.(none)> | 2008-08-15 09:32:14 (GMT) |
commit | a73cbc351d15afbf44a9f9c6c44e981b36805082 (patch) | |
tree | 7e10d60d44f4a5c76d43dc297dff09d79eb1063a /src/sugar/activity/activity.py | |
parent | ac6cea0d449508f15f903b61d5bc79c7a3b7d3d5 (diff) | |
parent | ba850d5787168f1d02fe9b38c971a9d18164b1c7 (diff) |
Merge branch 'master' of git://dev.laptop.org/sugar-toolkit
Diffstat (limited to 'src/sugar/activity/activity.py')
-rw-r--r-- | src/sugar/activity/activity.py | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/src/sugar/activity/activity.py b/src/sugar/activity/activity.py index 00cdc18..f74bb55 100644 --- a/src/sugar/activity/activity.py +++ b/src/sugar/activity/activity.py @@ -425,13 +425,6 @@ class Activity(Window, gtk.Container): 'joined': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ([])) } - __gproperties__ = { - 'active' : (bool, None, None, False, - gobject.PARAM_READWRITE), - 'max-participants': (int, None, None, 0, 1000, 0, - gobject.PARAM_READWRITE) - } - def __init__(self, handle, create_jobject=True): """Initialise the Activity @@ -570,24 +563,27 @@ class Activity(Window, gtk.Container): # https://dev.laptop.org/ticket/3071 datastore.write(self._jobject) - 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() - elif pspec.name == 'max-participants': - self._max_participants = value - else: - Window.do_set_property(self, pspec, value) + def get_active(self): + return self._active - def do_get_property(self, pspec): - if pspec.name == 'active': - return self._active - elif pspec.name == 'max-participants': - return self._max_participants - else: - return Window.do_get_property(self, pspec) + def set_active(self, active): + if self._active != active: + self._active = active + if not self._active and self._jobject: + self.save() + + active = gobject.property( + type=bool, default=False, getter=get_active, setter=set_active) + + def get_max_participants(self): + return self._max_participants + + def set_max_participants(self, participants): + self._max_participants = participants + + max_participants = gobject.property( + type=int, default=0, getter=get_max_participants, + setter=set_max_participants) def get_id(self): """Returns the activity id of the current instance of your activity. |