mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 14:08:03 -06:00
Add copy comment functionality to the torrent list's context menu
PR #19846. Closes #18890.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user