Merge branch 'Kingdread-confirm-quit-downloads'
This commit is contained in:
commit
e132c1cc1e
@ -53,6 +53,7 @@ Fixed
|
|||||||
- Close file handles correctly when a download failed
|
- Close file handles correctly when a download failed
|
||||||
- Fixed crash when using `;Y` (`:hint links yank-primary`) on a system without
|
- Fixed crash when using `;Y` (`:hint links yank-primary`) on a system without
|
||||||
primary selection
|
primary selection
|
||||||
|
- Don't display quit confirmation with finished downloads
|
||||||
|
|
||||||
v0.6.2
|
v0.6.2
|
||||||
------
|
------
|
||||||
|
@ -897,8 +897,8 @@ class DownloadManager(QAbstractListModel):
|
|||||||
download.redirected.connect(
|
download.redirected.connect(
|
||||||
functools.partial(self.on_redirect, download))
|
functools.partial(self.on_redirect, download))
|
||||||
download.basename = suggested_filename
|
download.basename = suggested_filename
|
||||||
idx = len(self.downloads) + 1
|
idx = len(self.downloads)
|
||||||
download.index = idx
|
download.index = idx + 1 # "Human readable" index
|
||||||
self.beginInsertRows(QModelIndex(), idx, idx)
|
self.beginInsertRows(QModelIndex(), idx, idx)
|
||||||
self.downloads.append(download)
|
self.downloads.append(download)
|
||||||
self.endInsertRows()
|
self.endInsertRows()
|
||||||
@ -1238,3 +1238,11 @@ class DownloadManager(QAbstractListModel):
|
|||||||
# We don't have children
|
# We don't have children
|
||||||
return 0
|
return 0
|
||||||
return len(self.downloads)
|
return len(self.downloads)
|
||||||
|
|
||||||
|
def running_downloads(self):
|
||||||
|
"""Return the amount of still running downloads.
|
||||||
|
|
||||||
|
Return:
|
||||||
|
The number of unfinished downloads.
|
||||||
|
"""
|
||||||
|
return sum(1 for download in self.downloads if not download.done)
|
||||||
|
@ -413,7 +413,7 @@ class MainWindow(QWidget):
|
|||||||
tab_count = self.tabbed_browser.count()
|
tab_count = self.tabbed_browser.count()
|
||||||
download_manager = objreg.get('download-manager', scope='window',
|
download_manager = objreg.get('download-manager', scope='window',
|
||||||
window=self.win_id)
|
window=self.win_id)
|
||||||
download_count = download_manager.rowCount()
|
download_count = download_manager.running_downloads()
|
||||||
quit_texts = []
|
quit_texts = []
|
||||||
# Ask if multiple-tabs are open
|
# Ask if multiple-tabs are open
|
||||||
if 'multiple-tabs' in confirm_quit and tab_count > 1:
|
if 'multiple-tabs' in confirm_quit and tab_count > 1:
|
||||||
|
@ -200,3 +200,14 @@ Feature: Downloading things from a website.
|
|||||||
And I run :close
|
And I run :close
|
||||||
And I wait 0.5s
|
And I wait 0.5s
|
||||||
Then no crash should happen
|
Then no crash should happen
|
||||||
|
|
||||||
|
## https://github.com/The-Compiler/qutebrowser/issues/846
|
||||||
|
|
||||||
|
Scenario: Quitting with finished downloads and confirm-quit=downloads
|
||||||
|
Given I have a fresh instance
|
||||||
|
When I set storage -> prompt-download-directory to false
|
||||||
|
And I set ui -> confirm-quit to downloads
|
||||||
|
And I open data/downloads/download.bin
|
||||||
|
And I wait until the download is finished
|
||||||
|
And I run :close
|
||||||
|
Then qutebrowser should quit
|
||||||
|
Loading…
Reference in New Issue
Block a user