1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-24 05:25:37 +00:00

Merge pull request #9066 from AltruisticCompany/setlocation

Show current save path in 'Set location' window
This commit is contained in:
Mike Tzou 2018-06-13 02:46:56 +08:00 committed by GitHub
commit c66738dc05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View File

@ -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
});
}

View File

@ -7,6 +7,7 @@
<link rel="stylesheet" href="css/style.css" type="text/css" />
<script src="scripts/lib/mootools-1.2-core-yc.js"></script>
<script src="scripts/lib/mootools-1.2-more.js"></script>
<script src="scripts/misc.js"></script>
<script>
var setLocationKeyboardEvents = new Keyboard({
defaultEventType: 'keydown',
@ -20,6 +21,11 @@
setLocationKeyboardEvents.activate();
window.addEvent('domready', function() {
var path = new URI().getData('path');
// set text field to current value
if (path)
$('setLocation').value = escapeHtml(decodeURIComponent(path));
$('setLocation').focus();
$('setLocationButton').addEvent('click', function(e) {
new Event(e).stop();
@ -48,7 +54,7 @@
<body>
<div style="padding: 10px 10px 0px 10px;">
<p style="font-weight: bold;">QBT_TR(Location)QBT_TR[CONTEXT=TransferListWidget]:</p>
<input type="text" id="setLocation" value="" maxlength="100" style="width: 220px;" />
<input type="text" id="setLocation" value="" maxlength="100" style="width: 370px;" />
<div style="text-align: center; padding-top: 10px;">
<input type="button" value="QBT_TR(Save)QBT_TR[CONTEXT=HttpServer]" id="setLocationButton" />
</div>