Added config option for prompting the user for a download location.
This commit is contained in:
parent
c4183bc34d
commit
e43a1e6444
@ -713,6 +713,11 @@ class DownloadManager(QAbstractListModel):
|
||||
request.setAttribute(QNetworkRequest.CacheLoadControlAttribute,
|
||||
QNetworkRequest.AlwaysNetwork)
|
||||
suggested_fn = urlutils.filename_from_url(request.url())
|
||||
|
||||
prompt_download_location = config.get('storage', 'prompt-download-location')
|
||||
if not prompt_download_location:
|
||||
filename = config.get('storage', 'download-directory')
|
||||
|
||||
if fileobj is not None or filename is not None:
|
||||
return self.fetch_request(request, page, fileobj, filename,
|
||||
auto_remove, suggested_fn)
|
||||
@ -802,6 +807,10 @@ class DownloadManager(QAbstractListModel):
|
||||
if not self._update_timer.isActive():
|
||||
self._update_timer.start()
|
||||
|
||||
prompt_download_location = config.get('storage', 'prompt-download-location')
|
||||
if not prompt_download_location:
|
||||
filename = config.get('storage', 'download-directory')
|
||||
|
||||
if filename is not None:
|
||||
download.set_filename(filename)
|
||||
elif fileobj is not None:
|
||||
|
@ -558,6 +558,11 @@ def data(readonly=False):
|
||||
"sensible os-specific default. Will expand environment "
|
||||
"variables."),
|
||||
|
||||
('prompt-download-location',
|
||||
SettingValue(typ.Bool(), 'true'),
|
||||
"Whether to prompt the user for the download location.\n"
|
||||
"If set to false, 'download-directory' will be used."),
|
||||
|
||||
('remember-download-directory',
|
||||
SettingValue(typ.Bool(), 'true'),
|
||||
"Whether to remember the last used download directory."),
|
||||
|
Loading…
Reference in New Issue
Block a user