parent
17396e1030
commit
7dadd97f01
@ -14,6 +14,7 @@
|
|||||||
|<<close,close>>|Close the current window.
|
|<<close,close>>|Close the current window.
|
||||||
|<<download,download>>|Download a given URL, or current page if no URL given.
|
|<<download,download>>|Download a given URL, or current page if no URL given.
|
||||||
|<<download-cancel,download-cancel>>|Cancel the last/[count]th download.
|
|<<download-cancel,download-cancel>>|Cancel the last/[count]th download.
|
||||||
|
|<<download-clear,download-clear>>|Remove all finished downloads from the list.
|
||||||
|<<download-delete,download-delete>>|Delete the last/[count]th download from disk.
|
|<<download-delete,download-delete>>|Delete the last/[count]th download from disk.
|
||||||
|<<download-open,download-open>>|Open the last/[count]th download.
|
|<<download-open,download-open>>|Open the last/[count]th download.
|
||||||
|<<download-remove,download-remove>>|Remove the last/[count]th download from the list.
|
|<<download-remove,download-remove>>|Remove the last/[count]th download from the list.
|
||||||
@ -158,6 +159,10 @@ Cancel the last/[count]th download.
|
|||||||
==== count
|
==== count
|
||||||
The index of the download to cancel.
|
The index of the download to cancel.
|
||||||
|
|
||||||
|
[[download-clear]]
|
||||||
|
=== download-clear
|
||||||
|
Remove all finished downloads from the list.
|
||||||
|
|
||||||
[[download-delete]]
|
[[download-delete]]
|
||||||
=== download-delete
|
=== download-delete
|
||||||
Delete the last/[count]th download from disk.
|
Delete the last/[count]th download from disk.
|
||||||
|
@ -964,6 +964,12 @@ class DownloadManager(QAbstractListModel):
|
|||||||
"""Check if there are finished downloads to clear."""
|
"""Check if there are finished downloads to clear."""
|
||||||
return any(download.done for download in self.downloads)
|
return any(download.done for download in self.downloads)
|
||||||
|
|
||||||
|
@cmdutils.register(instance='download-manager', scope='window')
|
||||||
|
def download_clear(self):
|
||||||
|
"""Remove all finished downloads from the list."""
|
||||||
|
finished_items = [d for d in self.downloads if d.done]
|
||||||
|
self.remove_items(finished_items)
|
||||||
|
|
||||||
@cmdutils.register(instance='download-manager', scope='window',
|
@cmdutils.register(instance='download-manager', scope='window',
|
||||||
count='count')
|
count='count')
|
||||||
def download_remove(self, all_=False, count=0):
|
def download_remove(self, all_=False, count=0):
|
||||||
@ -974,8 +980,7 @@ class DownloadManager(QAbstractListModel):
|
|||||||
count: The index of the download to cancel.
|
count: The index of the download to cancel.
|
||||||
"""
|
"""
|
||||||
if all_:
|
if all_:
|
||||||
finished_items = [d for d in self.downloads if d.done]
|
self.download_clear()
|
||||||
self.remove_items(finished_items)
|
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
download = self.downloads[count - 1]
|
download = self.downloads[count - 1]
|
||||||
|
@ -1373,7 +1373,7 @@ KEY_DATA = collections.OrderedDict([
|
|||||||
('inspector', ['wi']),
|
('inspector', ['wi']),
|
||||||
('download', ['gd']),
|
('download', ['gd']),
|
||||||
('download-cancel', ['ad']),
|
('download-cancel', ['ad']),
|
||||||
('download-remove --all', ['cd']),
|
('download-clear', ['cd']),
|
||||||
('view-source', ['gf']),
|
('view-source', ['gf']),
|
||||||
('tab-focus last', ['<Ctrl-Tab>']),
|
('tab-focus last', ['<Ctrl-Tab>']),
|
||||||
('enter-mode passthrough', ['<Ctrl-V>']),
|
('enter-mode passthrough', ['<Ctrl-V>']),
|
||||||
|
Loading…
Reference in New Issue
Block a user