WebUI: Add "Add to top of queue" option

PR #18660.
This commit is contained in:
thalieht 2023-03-08 17:58:42 +02:00 committed by GitHub
parent ee6f699b48
commit f630d84858
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 0 deletions

View file

@ -79,6 +79,14 @@
<input type="checkbox" id="startTorrent" />
</td>
</tr>
<tr>
<td>
<label for="addToTopOfQueue">QBT_TR(Add to top of queue)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
</td>
<td>
<input type="checkbox" id="addToTopOfQueue" name="addToTopOfQueue" value="true" />
</td>
</tr>
<tr>
<td>
<label for="stopCondition">QBT_TR(Stop condition:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>

View file

@ -73,6 +73,7 @@ window.qBittorrent.Download = (function() {
defaultSavePath = pref.save_path;
$('savepath').setProperty('value', defaultSavePath);
$('startTorrent').checked = !pref.start_paused_enabled;
$('addToTopOfQueue').checked = pref.add_to_top_of_queue;
if (pref.auto_tmm_enabled == 1) {
$('autoTMM').selectedIndex = 1;

View file

@ -67,6 +67,14 @@
<input type="checkbox" id="startTorrent" />
</td>
</tr>
<tr>
<td>
<label for="addToTopOfQueue">QBT_TR(Add to top of queue)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>
</td>
<td>
<input type="checkbox" id="addToTopOfQueue" name="addToTopOfQueue" value="true" />
</td>
</tr>
<tr>
<td>
<label for="stopCondition">QBT_TR(Stop condition:)QBT_TR[CONTEXT=AddNewTorrentDialog]</label>

View file

@ -54,6 +54,10 @@
<option value="NoSubfolder">QBT_TR(Don't create subfolder)QBT_TR[CONTEXT=OptionsDialog]</option>
</select>
</div>
<div class="formRow">
<input type="checkbox" id="addToTopOfQueueCheckbox" />
<label for="addToTopOfQueueCheckbox">QBT_TR(Add to top of queue)QBT_TR[CONTEXT=OptionsDialog]</label>
</div>
<div class="formRow">
<input type="checkbox" id="dontstartdownloads_checkbox" />
<label for="dontstartdownloads_checkbox">QBT_TR(Do not start the download automatically)QBT_TR[CONTEXT=OptionsDialog]</label>
@ -1816,6 +1820,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
break;
}
$('contentlayout_select').getChildren('option')[index].setAttribute('selected', '');
$('addToTopOfQueueCheckbox').setProperty('checked', pref.add_to_top_of_queue);
$('dontstartdownloads_checkbox').setProperty('checked', pref.start_paused_enabled);
switch (pref.torrent_stop_condition) {
case "None":
@ -2181,6 +2186,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
// Downloads tab
// When adding a torrent
settings.set('torrent_content_layout', $('contentlayout_select').getSelected()[0].getProperty('value'));
settings.set('add_to_top_of_queue', $('addToTopOfQueueCheckbox').getProperty('checked'));
settings.set('start_paused_enabled', $('dontstartdownloads_checkbox').getProperty('checked'));
settings.set('torrent_stop_condition', $('stopConditionSelect').getSelected()[0].getProperty('value'));
settings.set('auto_delete_mode', $('deletetorrentfileafter_checkbox').getProperty('checked'));