diff options
author | dave <drykod@gmail.com> | 2009-12-08 22:17:44 (GMT) |
---|---|---|
committer | dave <drykod@gmail.com> | 2009-12-08 22:17:44 (GMT) |
commit | acdab03f882afce4cc2c309e01ec9dcc358f2ea9 (patch) | |
tree | 66ae34cb89a80f84e15289fab49318c2a793d818 | |
parent | 761d33289701624652bccbb59d0b4e3887bd9789 (diff) |
Avoid launching new tutorial if an activiy is currently launching
-rw-r--r-- | tutorius/TProbe.py | 11 | ||||
-rw-r--r-- | tutorius/engine.py | 4 |
2 files changed, 10 insertions, 5 deletions
diff --git a/tutorius/TProbe.py b/tutorius/TProbe.py index 12d8762..2136bce 100644 --- a/tutorius/TProbe.py +++ b/tutorius/TProbe.py @@ -669,6 +669,8 @@ class ProbeManager(object): self._probes = {} self._current_activity = None + self.is_activity_launching = False + self.list_pending_actions = None self.list_pending_transitions = None @@ -712,7 +714,7 @@ class ProbeManager(object): model = get_model() for active_activity in model: - if active_activity.get_type() == activity: + if active_activity is not None and active_activity.get_type() == activity: active_activity.get_window().activate(gtk.get_current_event_time()) return False @@ -723,6 +725,7 @@ class ProbeManager(object): path = bundle.get_path() activity_bundle = ActivityBundle(path) activityfactory.create(activity_bundle) + self.is_activity_launching = True if is_event: self.list_pending_transitions = action_event else: @@ -748,8 +751,6 @@ class ProbeManager(object): activity = self.currentActivity if activity: - #logging.debug("**** ACTIVITY SOURCE : %s" % activity) - wait_install = self.prelaunch_activity(activity, action) if wait_install: @@ -834,8 +835,6 @@ class ProbeManager(object): activity = self.get_source_activity(event) if activity: - #logging.debug("**** ACTIVITY SOURCE : %s" % activity) - wait_install = self.prelaunch_activity(activity, event, True) if wait_install: @@ -886,6 +885,8 @@ class ProbeManager(object): else: self._probes[process_name].append((unique_id,self._ProxyClass(process_name, unique_id))) + self.is_activity_launching = False + if self.list_pending_actions: self.install(self.list_pending_actions, self.list_action_installed_cb, self.list_error_cb) self.list_pending_actions = None diff --git a/tutorius/engine.py b/tutorius/engine.py index c0769b5..3fa5f09 100644 --- a/tutorius/engine.py +++ b/tutorius/engine.py @@ -307,6 +307,10 @@ class Engine: """ Launch a tutorial @param tutorialID unique tutorial identifier used to retrieve it from the disk """ + + if self._probeManager.is_activity_launching: + return + if self._tutorial: self.stop() |