Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2007-03-14 18:43:42 (GMT)
committer Dan Williams <dcbw@redhat.com>2007-03-14 18:43:42 (GMT)
commit93e9d164c0ada98212a37da2c17bd640261561bb (patch)
tree7b846198ba0f99dc00c3ca8b8335028a9c93bd40 /shell
parentb35e6b6f2bb6a65ee00e8fe32ace346ea056dc1f (diff)
Auto-open some downloaded files
Diffstat (limited to 'shell')
-rw-r--r--shell/view/clipboardicon.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/shell/view/clipboardicon.py b/shell/view/clipboardicon.py
index 3732990..5e941f6 100644
--- a/shell/view/clipboardicon.py
+++ b/shell/view/clipboardicon.py
@@ -96,12 +96,18 @@ class ClipboardIcon(CanvasIcon):
else:
self.props.xo_color = XoColor("#000000,#FFFFFF")
+ if activity and percent == 100:
+ # FIXME: restrict based on file type rather than activity once
+ # we have a better type registry
+ # restrict auto-open to a specific set of activities
+ allowed = ["org.laptop.AbiWordActivity", "org.laptop.sugar.Xbook"]
+ if activity in allowed:
+ self._open_file()
+
def _open_file(self):
if self._percent < 100 or not self._activity:
return
- logging.debug("_open_file: " + self._object_id)
-
# Get the file path
cb_service = clipboardservice.get_instance()
obj = cb_service.get_object(self._object_id)