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 <marco@localhost.localdomain>2006-12-20 12:24:37 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-12-20 12:24:37 (GMT)
commitab3535e6fd3e29b25025845deceae6c7355996c5 (patch)
tree9c628a5ee2790d4623f277d7f734412b89ad8b9e /sugar
parent1c1fd3554119fa86359dfcd52f8fc0d2feb38a2c (diff)
Guard against multiple activities start
Diffstat (limited to 'sugar')
-rw-r--r--sugar/activity/Activity.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/sugar/activity/Activity.py b/sugar/activity/Activity.py
index 61b1cde..7a8e68c 100644
--- a/sugar/activity/Activity.py
+++ b/sugar/activity/Activity.py
@@ -112,6 +112,10 @@ class Activity(gtk.Window):
def start(self):
"""Start the activity."""
+ if self._activity_id != None:
+ logging.warning('The activity has been already started.')
+ return
+
self._activity_id = sugar.util.unique_id()
self.present()
@@ -133,6 +137,10 @@ class Activity(gtk.Window):
def join(self, activity_ps):
"""Join an activity shared on the network."""
+ if self._activity_id != None:
+ logging.warning('The activity has been already started.')
+ return
+
self._shared = True
self._activity_id = activity_ps.get_id()