diff options
author | dave <drykod@gmail.com> | 2009-12-08 19:22:57 (GMT) |
---|---|---|
committer | dave <drykod@gmail.com> | 2009-12-08 19:22:57 (GMT) |
commit | 761d33289701624652bccbb59d0b4e3887bd9789 (patch) | |
tree | 03d0bb8d687e0111bbca35ed19705ab194052225 | |
parent | e17f3bc29fa3bd196249125a9295ff8ce913303b (diff) |
updated TProbe launch activity
-rw-r--r-- | tutorius/TProbe.py | 48 |
1 files changed, 17 insertions, 31 deletions
diff --git a/tutorius/TProbe.py b/tutorius/TProbe.py index b411968..12d8762 100644 --- a/tutorius/TProbe.py +++ b/tutorius/TProbe.py @@ -707,39 +707,29 @@ class ProbeManager(object): get_model()._set_zoom_level(get_model().ZOOM_HOME) return False + if activity == get_model().get_active_activity().get_type(): + return False + + model = get_model() + for active_activity in model: + if active_activity.get_type() == activity: + active_activity.get_window().activate(gtk.get_current_event_time()) + return False + bundle = bundleregistry.get_registry().get_bundle(activity) if not bundle: print 'WARNING : Cannot find bundle' else: path = bundle.get_path() - - if path == get_model().get_active_activity().get_bundle_path(): - return False - - active_activities = get_model()._get_activities_with_window() - - is_active = False - for active_activity in active_activities: - #logging.debug("ACTIVE ACTIVITY = %s" % active_activity.get_bundle_path()) - if active_activity.get_bundle_path() == path: - is_active = True - #logging.debug("SETTING FOCUS TO ACTIVITY") - active_activity.get_window().activate(gtk.get_current_event_time()) - - if not is_active: - #logging.debug("LAUNCHING ACTIVITY") - activity_bundle = ActivityBundle(path) - activityfactory.create(activity_bundle) - if is_event: - #logging.debug("**** ADD EVENT TO LIST") - self.list_pending_transitions = action_event - else: - #logging.debug("**** ADD ACTION TO LIST") - self.list_pending_actions = action_event - return True - + activity_bundle = ActivityBundle(path) + activityfactory.create(activity_bundle) + if is_event: + self.list_pending_transitions = action_event + else: + self.list_pending_actions = action_event + return True return False - + def install(self, action, action_installed_cb, error_cb, is_editing=False, editing_cb=None): """ Install an action on the current activity @@ -897,15 +887,11 @@ class ProbeManager(object): self._probes[process_name].append((unique_id,self._ProxyClass(process_name, unique_id))) if self.list_pending_actions: - #logging.debug("EXECUTING PENDING ACTION : %s" % self.list_pending_actions) self.install(self.list_pending_actions, self.list_action_installed_cb, self.list_error_cb) - #logging.debug("INSTALLED") self.list_pending_actions = None if self.list_pending_transitions: - #logging.debug("EXECUTING PENDING TRANSITIONS : %s" % self.list_pending_transitions) self.subscribe(self.list_pending_transitions, self.list_notification_cb, self.list_event_subscribed_cb, self.list_error_cb) - #logging.debug("SUBSCRIBED") self.list_pending_transitions = None def unregister_probe(self, unique_id): |