WebUI: Add multi-file renaming

PR #18287.
Closes #16239.
This commit is contained in:
loligans 2023-02-19 03:07:55 -08:00 committed by GitHub
parent d75fd3fcde
commit 466314675c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 1340 additions and 28 deletions

View file

@ -62,6 +62,7 @@ let recheckFN = function() {};
let reannounceFN = function() {};
let setLocationFN = function() {};
let renameFN = function() {};
let renameFilesFN = function() {};
let torrentNewCategoryFN = function() {};
let torrentSetCategoryFN = function() {};
let createCategoryFN = function() {};
@ -523,6 +524,31 @@ const initializeWindows = function() {
}
};
renameFilesFN = function() {
const hashes = torrentsTable.selectedRowsIds();
if (hashes.length == 1) {
const hash = hashes[0];
const row = torrentsTable.rows[hash];
if (row) {
new MochaUI.Window({
id: 'multiRenamePage',
title: "QBT_TR(Renaming)QBT_TR[CONTEXT=TransferListWidget]",
data: { hash: hash, selectedRows: [] },
loadMethod: 'xhr',
contentURL: 'rename_files.html',
scrollbars: false,
resizable: true,
maximizable: false,
paddingVertical: 0,
paddingHorizontal: 0,
width: 800,
height: 420,
resizeLimit: { 'x': [800], 'y': [420] }
});
}
}
};
torrentNewCategoryFN = function() {
const action = "set";
const hashes = torrentsTable.selectedRowsIds();