From 93e9d164c0ada98212a37da2c17bd640261561bb Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 14 Mar 2007 18:43:42 +0000 Subject: Auto-open some downloaded files --- (limited to 'shell') 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) -- cgit v0.9.1