Add option to enable ".unwanted" folder

PR #19926.
This commit is contained in:
Vladimir Golovnev
2023-11-13 14:25:27 +03:00
committed by GitHub
parent 9d6d3a30eb
commit 2a20764d39
9 changed files with 58 additions and 2 deletions

View File

@@ -130,6 +130,7 @@ void AppController::preferencesAction()
data[u"auto_delete_mode"_s] = static_cast<int>(TorrentFileGuard::autoDeleteMode());
data[u"preallocate_all"_s] = session->isPreallocationEnabled();
data[u"incomplete_files_ext"_s] = session->isAppendExtensionEnabled();
data[u"use_unwanted_folder"_s] = session->isUnwantedFolderEnabled();
// Saving Management
data[u"auto_tmm_enabled"_s] = !session->isAutoTMMDisabledByDefault();
data[u"torrent_changed_tmm_enabled"_s] = !session->isDisableAutoTMMWhenCategoryChanged();
@@ -513,6 +514,8 @@ void AppController::setPreferencesAction()
session->setPreallocationEnabled(it.value().toBool());
if (hasKey(u"incomplete_files_ext"_s))
session->setAppendExtensionEnabled(it.value().toBool());
if (hasKey(u"use_unwanted_folder"_s))
session->setUnwantedFolderEnabled(it.value().toBool());
// Saving Management
if (hasKey(u"auto_tmm_enabled"_s))

View File

@@ -86,6 +86,12 @@
<label for="appendext_checkbox">QBT_TR(Append .!qB extension to incomplete files)QBT_TR[CONTEXT=OptionsDialog]</label>
</span>
</div>
<div class="formRow">
<span id="unwantedfoldertr">
<input type="checkbox" id="unwantedfolder_checkbox" />
<label for="unwantedfolder_checkbox">QBT_TR(Keep unselected files in ".unwanted" folder)QBT_TR[CONTEXT=OptionsDialog]</label>
</span>
</div>
<fieldset class="settings">
<legend>QBT_TR(Saving Management)QBT_TR[CONTEXT=HttpServer]</legend>
@@ -1997,6 +2003,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
$('preallocateall_checkbox').setProperty('checked', pref.preallocate_all);
$('appendext_checkbox').setProperty('checked', pref.incomplete_files_ext);
$('unwantedfolder_checkbox').setProperty('checked', pref.use_unwanted_folder);
// Saving Management
$('default_tmm_combobox').setProperty('value', pref.auto_tmm_enabled);
@@ -2374,6 +2381,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
settings.set('preallocate_all', $('preallocateall_checkbox').getProperty('checked'));
settings.set('incomplete_files_ext', $('appendext_checkbox').getProperty('checked'));
settings.set('use_unwanted_folder', $('unwantedfolder_checkbox').getProperty('checked'));
// Saving Management
settings.set('auto_tmm_enabled', $('default_tmm_combobox').getProperty('value'));