Add a :download command.

This commit is contained in:
Florian Bruhin 2014-11-18 19:38:34 +01:00
parent 8c5bc67dd0
commit 41c3a59e81

View File

@ -386,6 +386,12 @@ class DownloadManager(QAbstractListModel):
def __repr__(self):
return utils.get_repr(self, downloads=len(self.downloads))
@cmdutils.register(instance='download-manager', scope='window')
def download(self, url):
"""Download a given URL, given as string."""
qurl = urlutils.qurl_from_user_input(url)
self.get(qurl)
@pyqtSlot('QUrl', 'QWebPage')
def get(self, url, page=None, fileobj=None):
"""Start a download with a link URL.