mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-01 13:18:06 -06:00
Add WebUI Auto TMM options
This commit is contained in:
@@ -20,6 +20,17 @@
|
||||
<p>QBT_TR(Only one link per line)QBT_TR[CONTEXT=HttpServer]</p>
|
||||
<fieldset class="settings" style="border: 0; text-align: left; margin-top: 6px;">
|
||||
<table style="margin: auto;">
|
||||
<tr>
|
||||
<td>
|
||||
<label for="autoTMM">QBT_TR(Torrent Management Mode:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="autoTMM" name="autoTMM" onchange="changeTMM(this)">
|
||||
<option selected value="false">Manual</option>
|
||||
<option value="true">Automatic</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="savepath">QBT_TR(Save files to location:)QBT_TR[CONTEXT=HttpServer]</label>
|
||||
|
||||
@@ -12,6 +12,52 @@
|
||||
|
||||
<fieldset class="settings">
|
||||
<legend>QBT_TR(Saving Management)QBT_TR[CONTEXT=HttpServer]</legend>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<label>QBT_TR(Default Torrent Management Mode:)QBT_TR[CONTEXT=OptionsDialog]</label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="default_tmm_combobox">
|
||||
<option value="false" selected>QBT_TR(Manual)QBT_TR[CONTEXT=OptionsDialog]</option>
|
||||
<option value="true">QBT_TR(Automatic)QBT_TR[CONTEXT=OptionsDialog]</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label>QBT_TR(When Torrent Category changed:)QBT_TR[CONTEXT=OptionsDialog]</label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="torrent_changed_tmm_combobox">
|
||||
<option value="true">QBT_TR(Relocate torrent)QBT_TR[CONTEXT=OptionsDialog]</option>
|
||||
<option value="false" selected>QBT_TR(Switch torrent to Manual Mode)QBT_TR[CONTEXT=OptionsDialog]</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label>QBT_TR(When Default Save Path changed:)QBT_TR[CONTEXT=OptionsDialog]</label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="save_path_changed_tmm_combobox">
|
||||
<option value="true">QBT_TR(Relocate affected torrents)QBT_TR[CONTEXT=OptionsDialog]</option>
|
||||
<option value="false" selected>QBT_TR(Switch affected torrents to Manual Mode)QBT_TR[CONTEXT=OptionsDialog]</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label>QBT_TR(When Category Save Path changed:)QBT_TR[CONTEXT=OptionsDialog]</label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="category_changed_tmm_combobox">
|
||||
<option value="true">QBT_TR(Relocate affected torrents)QBT_TR[CONTEXT=OptionsDialog]</option>
|
||||
<option value="false" selected>QBT_TR(Switch affected torrents to Manual Mode)QBT_TR[CONTEXT=OptionsDialog]</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
@@ -984,6 +1030,10 @@
|
||||
$('appendext_checkbox').setProperty('checked', pref.incomplete_files_ext);
|
||||
|
||||
// Saving Managmenet
|
||||
$('default_tmm_combobox').setProperty('value', pref.auto_tmm_enabled);
|
||||
$('torrent_changed_tmm_combobox').setProperty('value', pref.torrent_changed_tmm_enabled);
|
||||
$('save_path_changed_tmm_combobox').setProperty('value', pref.save_path_changed_tmm_enabled);
|
||||
$('category_changed_tmm_combobox').setProperty('value', pref.category_changed_tmm_enabled);
|
||||
$('savepath_text').setProperty('value', pref.save_path);
|
||||
$('temppath_checkbox').setProperty('checked', pref.temp_path_enabled);
|
||||
$('temppath_text').setProperty('value', pref.temp_path);
|
||||
@@ -1228,6 +1278,10 @@
|
||||
settings.set('incomplete_files_ext', $('appendext_checkbox').getProperty('checked'));
|
||||
|
||||
// Saving Management
|
||||
settings.set('auto_tmm_enabled', $('default_tmm_combobox').getProperty('value'));
|
||||
settings.set('torrent_changed_tmm_enabled', $('torrent_changed_tmm_combobox').getProperty('value'));
|
||||
settings.set('save_path_changed_tmm_enabled', $('save_path_changed_tmm_combobox').getProperty('value'));
|
||||
settings.set('category_changed_tmm_enabled', $('category_changed_tmm_combobox').getProperty('value'));
|
||||
settings.set('save_path', $('savepath_text').getProperty('value'));
|
||||
settings.set('temp_path_enabled', $('temppath_checkbox').getProperty('checked'));
|
||||
settings.set('temp_path', $('temppath_text').getProperty('value'));
|
||||
|
||||
@@ -21,22 +21,39 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
getSavePath = function() {
|
||||
new Request({
|
||||
url: 'api/v2/app/defaultSavePath',
|
||||
|
||||
getPreferences = function() {
|
||||
new Request.JSON({
|
||||
url: 'api/v2/app/preferences',
|
||||
method: 'get',
|
||||
noCache: true,
|
||||
onFailure: function() {
|
||||
alert("Could not contact qBittorrent");
|
||||
},
|
||||
onSuccess: function(data) {
|
||||
if (data) {
|
||||
$('savepath').setProperty('value', data);
|
||||
onSuccess: function(pref) {
|
||||
if (pref) {
|
||||
$('savepath').setProperty('value', pref.save_path);
|
||||
if (pref.auto_tmm_enabled == 1) {
|
||||
$('autoTMM').selectedIndex = 1;
|
||||
$('savepath').disabled = true;
|
||||
}
|
||||
else {
|
||||
$('autoTMM').selectedIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}).send();
|
||||
};
|
||||
|
||||
changeTMM = function(item) {
|
||||
if (item.selectedIndex == 1) {
|
||||
$('savepath').disabled = true;
|
||||
}
|
||||
else {
|
||||
$('savepath').disabled = false;
|
||||
}
|
||||
};
|
||||
|
||||
$(window).addEventListener("load", function() {
|
||||
getSavePath();
|
||||
getPreferences();
|
||||
});
|
||||
|
||||
@@ -18,6 +18,17 @@
|
||||
</div>
|
||||
<fieldset class="settings" style="border: 0; text-align: left; margin-top: 12px;">
|
||||
<table style="margin: auto;">
|
||||
<tr>
|
||||
<td>
|
||||
<label for="autoTMM">QBT_TR(Torrent Management Mode:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="autoTMM" name="autoTMM" onchange="changeTMM(this)">
|
||||
<option selected value="false">Manual</option>
|
||||
<option value="true">Automatic</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="savepath">QBT_TR(Save files to location:)QBT_TR[CONTEXT=HttpServer]</label>
|
||||
|
||||
Reference in New Issue
Block a user