Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2007-08-16 15:55:52 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2007-08-16 15:55:52 (GMT)
commitd33b74469d454734b9ed55a2b4d7a071dafc7b95 (patch)
tree258406836b573028d427409a4e51a44be034cabb /sugar
parentf0560566919e1d93caaa4dc86e9233493d2005be (diff)
Add max_participants property.
Diffstat (limited to 'sugar')
-rw-r--r--sugar/activity/activity.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/sugar/activity/activity.py b/sugar/activity/activity.py
index 3f272a2..41b68d0 100644
--- a/sugar/activity/activity.py
+++ b/sugar/activity/activity.py
@@ -97,10 +97,10 @@ class ActivityToolbar(gtk.Toolbar):
def _update_share(self):
max_participants = self._activity.props.max_participants
- if self._activity.get_shared():
+ if self._activity.get_shared() or max_participants == 1:
self.share.set_sensitive(False)
self.share.combo.set_active(self.SHARE_NEIGHBORHOOD)
- elif max_participants == -1 or max_participants > 0:
+ else:
self.share.set_sensitive(True)
self.share.combo.set_active(self.SHARE_PRIVATE)
@@ -191,8 +191,10 @@ class Activity(Window, gtk.Container):
}
__gproperties__ = {
- 'active': : (bool, None, None, False, gobject.PARAM_READWRITE)
- 'max-participants': (int, -1, 1000, 0, gobject.PARAM_READWRITE)
+ '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):
@@ -242,7 +244,7 @@ class Activity(Window, gtk.Container):
self._preview = None
self._updating_jobject = False
self._closing = False
- self._max_participants = -1
+ self._max_participants = 0
shared_activity = handle.get_shared_activity()
if shared_activity:
@@ -288,6 +290,8 @@ class Activity(Window, gtk.Container):
self._active = value
if not self._active and self._jobject:
self.save()
+ elif pspec.name == 'max-participants':
+ self._max_participants = value
def do_get_property(self, pspec):
if pspec.name == 'active':