Merge branch 'acogneau-master'
This commit is contained in:
commit
c715b24bd3
@ -34,6 +34,8 @@ Added
|
|||||||
them. There's also a new `show-switching` option to configure the timeout.
|
them. There's also a new `show-switching` option to configure the timeout.
|
||||||
- New setting `storage -> remember-download-directory` to remember the last
|
- New setting `storage -> remember-download-directory` to remember the last
|
||||||
used download directory.
|
used download directory.
|
||||||
|
- New setting `storage -> prompt-download-directory` to download all downloads
|
||||||
|
without asking.
|
||||||
|
|
||||||
Changed
|
Changed
|
||||||
~~~~~~~
|
~~~~~~~
|
||||||
|
@ -153,6 +153,7 @@ Contributors, sorted by the number of commits in descending order:
|
|||||||
* Martin Zimmermann
|
* Martin Zimmermann
|
||||||
* Error 800
|
* Error 800
|
||||||
* Brian Jackson
|
* Brian Jackson
|
||||||
|
* Alexander Cogneau
|
||||||
* sbinix
|
* sbinix
|
||||||
* Tobias Patzl
|
* Tobias Patzl
|
||||||
* Johannes Altmanninger
|
* Johannes Altmanninger
|
||||||
|
@ -123,6 +123,7 @@
|
|||||||
|==============
|
|==============
|
||||||
|Setting|Description
|
|Setting|Description
|
||||||
|<<storage-download-directory,download-directory>>|The directory to save downloads to. An empty value selects a sensible os-specific default. Will expand environment variables.
|
|<<storage-download-directory,download-directory>>|The directory to save downloads to. An empty value selects a sensible os-specific default. Will expand environment variables.
|
||||||
|
|<<storage-prompt-download-directory,prompt-download-directory>>|Whether to prompt the user for the download location.
|
||||||
|<<storage-remember-download-directory,remember-download-directory>>|Whether to remember the last used download directory.
|
|<<storage-remember-download-directory,remember-download-directory>>|Whether to remember the last used download directory.
|
||||||
|<<storage-maximum-pages-in-cache,maximum-pages-in-cache>>|The maximum number of pages to hold in the global memory page cache.
|
|<<storage-maximum-pages-in-cache,maximum-pages-in-cache>>|The maximum number of pages to hold in the global memory page cache.
|
||||||
|<<storage-object-cache-capacities,object-cache-capacities>>|The capacities for the global memory cache for dead objects such as stylesheets or scripts. Syntax: cacheMinDeadCapacity, cacheMaxDead, totalCapacity.
|
|<<storage-object-cache-capacities,object-cache-capacities>>|The capacities for the global memory cache for dead objects such as stylesheets or scripts. Syntax: cacheMinDeadCapacity, cacheMaxDead, totalCapacity.
|
||||||
@ -1106,6 +1107,18 @@ The directory to save downloads to. An empty value selects a sensible os-specifi
|
|||||||
|
|
||||||
Default: empty
|
Default: empty
|
||||||
|
|
||||||
|
[[storage-prompt-download-directory]]
|
||||||
|
=== prompt-download-directory
|
||||||
|
Whether to prompt the user for the download location.
|
||||||
|
If set to false, 'download-directory' will be used.
|
||||||
|
|
||||||
|
Valid values:
|
||||||
|
|
||||||
|
* +true+
|
||||||
|
* +false+
|
||||||
|
|
||||||
|
Default: +pass:[true]+
|
||||||
|
|
||||||
[[storage-remember-download-directory]]
|
[[storage-remember-download-directory]]
|
||||||
=== remember-download-directory
|
=== remember-download-directory
|
||||||
Whether to remember the last used download directory.
|
Whether to remember the last used download directory.
|
||||||
|
@ -713,6 +713,12 @@ class DownloadManager(QAbstractListModel):
|
|||||||
request.setAttribute(QNetworkRequest.CacheLoadControlAttribute,
|
request.setAttribute(QNetworkRequest.CacheLoadControlAttribute,
|
||||||
QNetworkRequest.AlwaysNetwork)
|
QNetworkRequest.AlwaysNetwork)
|
||||||
suggested_fn = urlutils.filename_from_url(request.url())
|
suggested_fn = urlutils.filename_from_url(request.url())
|
||||||
|
|
||||||
|
prompt_download_directory = config.get('storage',
|
||||||
|
'prompt-download-directory')
|
||||||
|
if not prompt_download_directory:
|
||||||
|
filename = config.get('storage', 'download-directory')
|
||||||
|
|
||||||
if fileobj is not None or filename is not None:
|
if fileobj is not None or filename is not None:
|
||||||
return self.fetch_request(request, page, fileobj, filename,
|
return self.fetch_request(request, page, fileobj, filename,
|
||||||
auto_remove, suggested_fn)
|
auto_remove, suggested_fn)
|
||||||
@ -802,6 +808,11 @@ class DownloadManager(QAbstractListModel):
|
|||||||
if not self._update_timer.isActive():
|
if not self._update_timer.isActive():
|
||||||
self._update_timer.start()
|
self._update_timer.start()
|
||||||
|
|
||||||
|
prompt_download_directory = config.get('storage',
|
||||||
|
'prompt-download-directory')
|
||||||
|
if not prompt_download_directory:
|
||||||
|
filename = config.get('storage', 'download-directory')
|
||||||
|
|
||||||
if filename is not None:
|
if filename is not None:
|
||||||
download.set_filename(filename)
|
download.set_filename(filename)
|
||||||
elif fileobj is not None:
|
elif fileobj is not None:
|
||||||
|
@ -558,6 +558,11 @@ def data(readonly=False):
|
|||||||
"sensible os-specific default. Will expand environment "
|
"sensible os-specific default. Will expand environment "
|
||||||
"variables."),
|
"variables."),
|
||||||
|
|
||||||
|
('prompt-download-directory',
|
||||||
|
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',
|
('remember-download-directory',
|
||||||
SettingValue(typ.Bool(), 'true'),
|
SettingValue(typ.Bool(), 'true'),
|
||||||
"Whether to remember the last used download directory."),
|
"Whether to remember the last used download directory."),
|
||||||
|
Loading…
Reference in New Issue
Block a user