Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordave <drykod@gmail.com>2009-12-08 01:44:02 (GMT)
committer mike <michael.jmontcalm@gmail.com>2009-12-12 02:28:06 (GMT)
commitede133e9bf23b6e070cc69107605cee143036138 (patch)
tree6fd7dca785479a70913db94a3dd8aa901cb01235
parent6111ab514f8bfa95c4e720c802c171a334f0146a (diff)
launch activity or focus activity for action addons
-rw-r--r--tutorius/TProbe.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/tutorius/TProbe.py b/tutorius/TProbe.py
index 75f5f36..8ffc005 100644
--- a/tutorius/TProbe.py
+++ b/tutorius/TProbe.py
@@ -936,25 +936,28 @@ class ProbeManager(object):
print 'WARNING : Cannot find bundle'
else:
path = bundle.get_path()
- activity_bundle = ActivityBundle(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() is path:
+ #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")
+ #logging.debug("SETTING FOCUS TO ACTIVITY")
active_activity.get_window().activate(gtk.get_current_event_time())
if not is_active:
- logging.debug("LAUNCHING ACTIVITY")
+ #logging.debug("LAUNCHING ACTIVITY")
+ activity_bundle = ActivityBundle(path)
activityfactory.create(activity_bundle)
self.list_pending_actions = action
return True
- return False
+ return False
def install(self, action, action_installed_cb, error_cb, is_editing=False, editing_cb=None):
"""
@@ -973,7 +976,7 @@ class ProbeManager(object):
activity = self.currentActivity
if activity:
- logging.debug("**** ACTIVITY SOURCE : %s" % activity)
+ #logging.debug("**** ACTIVITY SOURCE : %s" % activity)
wait_install = self.prelaunch_activity(activity, action)