mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-03 22:22:33 -06:00
WebUI: Implement 'Force Start' feature.
This commit is contained in:
@@ -137,6 +137,7 @@ var ContextMenu = new Class({
|
||||
all_are_paused = true;
|
||||
there_are_paused = false;
|
||||
all_are_super_seeding = true;
|
||||
all_are_force_start = true;
|
||||
|
||||
var h = myTable.selectedIds();
|
||||
h.each(function(item, index){
|
||||
@@ -152,6 +153,9 @@ var ContextMenu = new Class({
|
||||
else
|
||||
there_are_f_l_piece_prio = true;
|
||||
|
||||
if (data['force_start'] != true)
|
||||
all_are_force_start = false;
|
||||
|
||||
if (data['progress'] != 1.0) // not downloaded
|
||||
all_are_downloaded = false;
|
||||
else if (data['super_seeding'] != true)
|
||||
@@ -174,6 +178,8 @@ var ContextMenu = new Class({
|
||||
if (!all_are_f_l_piece_prio && there_are_f_l_piece_prio)
|
||||
show_f_l_piece_prio = false;
|
||||
|
||||
this.setItemChecked('ForceStart', all_are_force_start);
|
||||
|
||||
if (all_are_downloaded) {
|
||||
this.hideItem('SequentialDownload');
|
||||
this.hideItem('FirstLastPiecePrio');
|
||||
|
||||
@@ -181,6 +181,21 @@ initializeWindows = function() {
|
||||
}
|
||||
};
|
||||
|
||||
setForceStartFN = function(val) {
|
||||
var h = myTable.selectedIds();
|
||||
if (h.length) {
|
||||
new Request({
|
||||
url: 'command/setForceStart',
|
||||
method: 'post',
|
||||
data: {
|
||||
value: val,
|
||||
hashes: h.join("|")
|
||||
}
|
||||
}).send();
|
||||
updateMainData();
|
||||
}
|
||||
};
|
||||
|
||||
globalDownloadLimitFN = function() {
|
||||
new MochaUI.Window({
|
||||
id: 'downloadLimitPage',
|
||||
|
||||
@@ -54,6 +54,9 @@
|
||||
},
|
||||
SuperSeeding : function (element, ref) {
|
||||
setSuperSeedingFN(!ref.getItemChecked('SuperSeeding'));
|
||||
},
|
||||
ForceStart : function (element, ref) {
|
||||
setForceStartFN(!ref.getItemChecked('ForceStart'));
|
||||
}
|
||||
},
|
||||
offsets : {
|
||||
|
||||
Reference in New Issue
Block a user