From 93e9d164c0ada98212a37da2c17bd640261561bb Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 14 Mar 2007 14:43:42 -0400 Subject: [PATCH] Auto-open some downloaded files --- shell/view/clipboardicon.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/shell/view/clipboardicon.py b/shell/view/clipboardicon.py index 37329904..5e941f67 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)