From 3d851a448f959abb89732b85102fe1a0beba98c0 Mon Sep 17 00:00:00 2001 From: Goshik Date: Thu, 7 Jun 2018 20:55:00 +0300 Subject: [PATCH] Show current save path in 'Set location' window The feature is useful when the user needs to move their torrent to a sub or parent folder. If more than one torrent is chosen, the path of the first selected torrent is used. The window was made wider to allow more convenient editing of long paths. --- src/webui/www/private/scripts/mocha-init.js | 7 +++++-- src/webui/www/private/setlocation.html | 8 +++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/webui/www/private/scripts/mocha-init.js b/src/webui/www/private/scripts/mocha-init.js index e7386900c..a1102f564 100644 --- a/src/webui/www/private/scripts/mocha-init.js +++ b/src/webui/www/private/scripts/mocha-init.js @@ -403,17 +403,20 @@ initializeWindows = function() { setLocationFN = function() { var hashes = torrentsTable.selectedRowsIds(); if (hashes.length) { + var hash = hashes[0]; + var row = torrentsTable.rows[hash]; + var path = encodeURIComponent(row.full_data.save_path); new MochaUI.Window({ id: 'setLocationPage', title: "QBT_TR(Set location)QBT_TR[CONTEXT=TransferListWidget]", loadMethod: 'iframe', - contentURL: 'setlocation.html?hashes=' + hashes.join('|'), + contentURL: 'setlocation.html?hashes=' + hashes.join('|') + '&path=' + path, scrollbars: false, resizable: false, maximizable: false, paddingVertical: 0, paddingHorizontal: 0, - width: 250, + width: 400, height: 100 }); } diff --git a/src/webui/www/private/setlocation.html b/src/webui/www/private/setlocation.html index 6824099a7..ab1a72bac 100644 --- a/src/webui/www/private/setlocation.html +++ b/src/webui/www/private/setlocation.html @@ -7,6 +7,7 @@ +