mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-14 17:23:07 -07:00
Add copy comment functionality to the torrent list's context menu
PR #19846. Closes #18890.
This commit is contained in:
parent
f067ab1692
commit
30d9978c97
7 changed files with 37 additions and 0 deletions
|
@ -89,6 +89,7 @@ let copyNameFN = function() {};
|
|||
let copyInfohashFN = function(policy) {};
|
||||
let copyMagnetLinkFN = function() {};
|
||||
let copyIdFN = function() {};
|
||||
let copyCommentFN = function() {};
|
||||
let setQueuePositionFN = function() {};
|
||||
let exportTorrentFN = function() {};
|
||||
|
||||
|
@ -1005,6 +1006,21 @@ const initializeWindows = function() {
|
|||
return torrentsTable.selectedRowsIds().join("\n");
|
||||
};
|
||||
|
||||
copyCommentFN = function() {
|
||||
const selectedRows = torrentsTable.selectedRowsIds();
|
||||
const comments = [];
|
||||
if (selectedRows.length > 0) {
|
||||
const rows = torrentsTable.getFilteredAndSortedRows();
|
||||
for (let i = 0; i < selectedRows.length; ++i) {
|
||||
const hash = selectedRows[i];
|
||||
const comment = rows[hash].full_data.comment;
|
||||
if (comment && (comment !== ""))
|
||||
comments.push(comment);
|
||||
}
|
||||
}
|
||||
return comments.join("\n---------\n");
|
||||
};
|
||||
|
||||
exportTorrentFN = async function() {
|
||||
const hashes = torrentsTable.selectedRowsIds();
|
||||
for (const hash of hashes) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue