Auto-open some downloaded files
This commit is contained in:
parent
b35e6b6f2b
commit
93e9d164c0
@ -96,12 +96,18 @@ class ClipboardIcon(CanvasIcon):
|
|||||||
else:
|
else:
|
||||||
self.props.xo_color = XoColor("#000000,#FFFFFF")
|
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):
|
def _open_file(self):
|
||||||
if self._percent < 100 or not self._activity:
|
if self._percent < 100 or not self._activity:
|
||||||
return
|
return
|
||||||
|
|
||||||
logging.debug("_open_file: " + self._object_id)
|
|
||||||
|
|
||||||
# Get the file path
|
# Get the file path
|
||||||
cb_service = clipboardservice.get_instance()
|
cb_service = clipboardservice.get_instance()
|
||||||
obj = cb_service.get_object(self._object_id)
|
obj = cb_service.get_object(self._object_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user