Registered a nsITransfer for opening documents after downloading.

This commit is contained in:
Tomeu Vizoso
2006-10-26 22:21:26 +02:00
parent 5ff6ba45d4
commit 2e65e2ca1d
9 changed files with 202 additions and 68 deletions
+4 -3
View File
@@ -20,6 +20,7 @@ import gtkmozembed
import logging
import _sugar
from sugar.activity import ActivityFactory
from sugar.activity.Activity import Activity
from sugar import env
from sugar.graphics import style
@@ -105,10 +106,10 @@ def start():
chandler = _sugar.get_browser_chandler()
chandler.connect('handle-content', handle_content_cb)
logging.debug('handle-content connected.')
def stop():
gtkmozembed.pop_startup()
def handle_content_cb(chandler, url, suggestedFileName, mimeType, tmpFileName):
logging.debug('File ' + tmpFileName + ' with MIMEType ' + mimeType + ' downloaded from ' + url)
def handle_content_cb(chandler, url, mimeType, tmpFileName):
activity = ActivityFactory.create("org.laptop.sugar.Xbook")
activity.execute("open_document", [tmpFileName])