@ -15,12 +15,17 @@
@@ -15,12 +15,17 @@
< span id = "appendexttr" >
< input type = "checkbox" id = "appendext_checkbox" / >
< label for = "appendext_checkbox" > QBT_TR(Append .!qB extension to incomplete files)QBT_TR[CONTEXT=OptionsDialog]< / label >
< / span > < br / > < br / >
QBT_TR(Automatically add torrents from:)QBT_TR[CONTEXT=OptionsDialog]< br / >
< / span > < br / > < br / > QBT_TR(Automatically add torrents from:)QBT_TR[CONTEXT=OptionsDialog]< br / >
< table id = "watched_folders_tab" style = "border: 1px solid black;" >
< thead > < tr > < th > QBT_TR(Monitored Folder)QBT_TR[CONTEXT=ScanFoldersModel]< / th > < th > QBT_TR(Override Save Location)QBT_TR[CONTEXT=ScanFoldersModel]< / th > < / tr > < / thead >
< thead >
< tr >
< th > QBT_TR(Monitored Folder)QBT_TR[CONTEXT=ScanFoldersModel]< / th >
< th > QBT_TR(Override Save Location)QBT_TR[CONTEXT=ScanFoldersModel]< / th >
< / tr >
< / thead >
< tbody > < / tbody >
< tfoot > < tr >
< tfoot >
< tr >
< td style = "padding-top:4px;" > < input type = "text" id = "new_watch_folder_txt" / > < / td >
< td style = "padding-top:4px;" >
< div class = "select-watched-folder-editable" >
@ -33,7 +38,8 @@
@@ -33,7 +38,8 @@
< img src = "theme/list-add" alt = "Add" style = "padding-left:170px;width:16px;cursor:pointer;" onclick = "addWatchFolder();" / >
< / div >
< / td >
< / tr > < / tfoot >
< / tr >
< / tfoot >
< / table > < br / >
< input type = "checkbox" id = "exportdir_checkbox" onclick = "updateExportDirEnabled();" / >
< label for = "exportdir_checkbox" > QBT_TR(Copy .torrent files to:)QBT_TR[CONTEXT=OptionsDialog]< / label >
@ -244,11 +250,9 @@
@@ -244,11 +250,9 @@
< legend > < input type = "checkbox" id = "limit_sheduling_checkbox" onclick = "updateSchedulingEnabled();" / >
< label for = "limit_sheduling_checkbox" > QBT_TR(Schedule the use of alternative rate limits)QBT_TR[CONTEXT=OptionsDialog]< / label > < / legend >
QBT_TR(From:)QBT_TR[CONTEXT=OptionsDialog]
< input type = "text" id = "schedule_from_hour" style = "width: 1.5em;" / > :< input type = "text" id = "schedule_from_min" style = "width: 1.5em;" / >
QBT_TR(To:)QBT_TR[CONTEXT=OptionsDialog]
< input type = "text" id = "schedule_from_hour" style = "width: 1.5em;" / > :< input type = "text" id = "schedule_from_min" style = "width: 1.5em;" / > QBT_TR(To:)QBT_TR[CONTEXT=OptionsDialog]
< input type = "text" id = "schedule_to_hour" style = "width: 1.5em;" / > :< input type = "text" id = "schedule_to_min" style = "width: 1.5em;" / >
< br / >
QBT_TR(When:)QBT_TR[CONTEXT=OptionsDialog]
< br / > QBT_TR(When:)QBT_TR[CONTEXT=OptionsDialog]
< select id = "schedule_freq_select" >
< option value = "0" > QBT_TR(Every day)QBT_TR[CONTEXT=OptionsDialog]< / option >
< option value = "1" > QBT_TR(Weekdays)QBT_TR[CONTEXT=OptionsDialog]< / option >
@ -512,7 +516,8 @@ changeWatchFolderSelect = function(item) {
@@ -512,7 +516,8 @@ changeWatchFolderSelect = function(item) {
if (item.value == "other") {
item.nextElementSibling.value = 'QBT_TR(Type folder here)QBT_TR[CONTEXT=HttpServer]';
item.nextElementSibling.select();
} else {
}
else {
var text = item.options[item.selectedIndex].innerHTML;
item.nextElementSibling.value = text;
}
@ -524,14 +529,14 @@ changeWatchFolderText = function(item) {
@@ -524,14 +529,14 @@ changeWatchFolderText = function(item) {
pushWatchFolder = function(pos, folder, sel, other) {
var myinput = "< input id = 'text_watch_" + pos + "' type = 'text' value = '" + folder + "' > ";
var mycb = "< div class = 'select-watched-folder-editable' > " +
"< select id = 'cb_watch_" + pos + "' onchange = 'changeWatchFolderSelect(this)' > " +
"< option value = 'watch_folder' > QBT_TR(Monitored folder)QBT_TR[CONTEXT=ScanFoldersModel]< / option > " +
"< option value = 'default_folder' > QBT_TR(Default save location)QBT_TR[CONTEXT=ScanFoldersModel]< / option > " +
"< option value = 'other' > QBT_TR(Other...)QBT_TR[CONTEXT=HttpServer]< / option > " +
"< / select > " +
"< input id = 'cb_watch_txt_" + pos + "' type = 'text' " +
"onchange='changeWatchFolderText(this)' />< / div > ";
var mycb = "< div class = 'select-watched-folder-editable' > "
+ "< select id = 'cb_watch_" + pos + "' onchange = 'changeWatchFolderSelect(this)' > "
+ "< option value = 'watch_folder' > QBT_TR(Monitored folder)QBT_TR[CONTEXT=ScanFoldersModel]< / option > "
+ "< option value = 'default_folder' > QBT_TR(Default save location)QBT_TR[CONTEXT=ScanFoldersModel]< / option > "
+ "< option value = 'other' > QBT_TR(Other...)QBT_TR[CONTEXT=HttpServer]< / option > "
+ "< / select > "
+ "< input id = 'cb_watch_txt_" + pos + "' type = 'text' "
+ "onchange='changeWatchFolderText(this)' />< / div > ";
WatchedFoldersTable.push([myinput, mycb]);
$('cb_watch_' + pos).setProperty('value', sel);
@ -552,7 +557,8 @@ getWatchedFolders = function() {
@@ -552,7 +557,8 @@ getWatchedFolders = function() {
var sel = $('cb_watch_' + i).getProperty('value').trim();
if (sel == "other") {
other = $('cb_watch_txt_' + i).getProperty('value').trim();
} else {
}
else {
other = (sel == "watch_folder") ? 0 : 1;
}
folders.set(fpath, other);
@ -632,7 +638,8 @@ updatePeerProxySettings = function() {
@@ -632,7 +638,8 @@ updatePeerProxySettings = function() {
$('peer_proxy_auth_checkbox').setProperty('checked', isPeerProxyTypeSocks5);
updatePeerProxyAuthSettings();
}
} else {
}
else {
$('peer_proxy_auth_checkbox').setProperty('disabled', !isPeerProxyTypeSelected);
$('peer_proxy_auth_checkbox').setProperty('checked', isPeerProxyTypeSelected);
updatePeerProxyAuthSettings();
@ -738,7 +745,8 @@ updateDynDnsSettings = function() {
@@ -738,7 +745,8 @@ updateDynDnsSettings = function() {
registerDynDns = function() {
if ($('dyndns_select').getProperty('value').toInt() == 1) {
window.open("http://www.no-ip.com/services/managed_dns/free_dynamic_dns.html", "NO-IP Registration");
} else {
}
else {
window.open("https://www.dyndns.com/account/services/hosts/add.html", "DynDNS Registration");
}
};
@ -776,7 +784,8 @@ loadPreferences = function() {
@@ -776,7 +784,8 @@ loadPreferences = function() {
if (typeof pref.scan_dirs[folder] == "string") {
other = pref.scan_dirs[folder];
sel = "other";
} else {
}
else {
sel = (pref.scan_dirs[folder] == 0) ? "watch_folder" : "default_folder";
}
pushWatchFolder(i++, folder, sel, other);
@ -827,7 +836,8 @@ loadPreferences = function() {
@@ -827,7 +836,8 @@ loadPreferences = function() {
if (max_connec < = 0) {
$('max_connec_checkbox').setProperty('checked', false);
$('max_connec_value').setProperty('value', 500);
} else {
}
else {
$('max_connec_checkbox').setProperty('checked', true);
$('max_connec_value').setProperty('value', max_connec);
}
@ -836,7 +846,8 @@ loadPreferences = function() {
@@ -836,7 +846,8 @@ loadPreferences = function() {
if (max_connec_per_torrent < = 0) {
$('max_connec_per_torrent_checkbox').setProperty('checked', false);
$('max_connec_per_torrent_value').setProperty('value', 100);
} else {
}
else {
$('max_connec_per_torrent_checkbox').setProperty('checked', true);
$('max_connec_per_torrent_value').setProperty('value', max_connec_per_torrent);
}
@ -845,7 +856,8 @@ loadPreferences = function() {
@@ -845,7 +856,8 @@ loadPreferences = function() {
if (max_uploads < = 0) {
$('max_uploads_checkbox').setProperty('checked', false);
$('max_uploads_value').setProperty('value', 8);
} else {
}
else {
$('max_uploads_checkbox').setProperty('checked', true);
$('max_uploads_value').setProperty('value', max_uploads);
}
@ -854,7 +866,8 @@ loadPreferences = function() {
@@ -854,7 +866,8 @@ loadPreferences = function() {
if (max_uploads_per_torrent < = 0) {
$('max_uploads_per_torrent_checkbox').setProperty('checked', false);
$('max_uploads_per_torrent_value').setProperty('value', 4);
} else {
}
else {
$('max_uploads_per_torrent_checkbox').setProperty('checked', true);
$('max_uploads_per_torrent_value').setProperty('value', max_uploads_per_torrent);
}
@ -900,7 +913,8 @@ loadPreferences = function() {
@@ -900,7 +913,8 @@ loadPreferences = function() {
var up_limit = pref.up_limit.toInt() / 1024;
if (up_limit < = 0) {
$('up_limit_checkbox').setProperty('checked', false);
} else {
}
else {
$('up_limit_checkbox').setProperty('checked', true);
$('up_limit_value').setProperty('value', up_limit);
}
@ -908,7 +922,8 @@ loadPreferences = function() {
@@ -908,7 +922,8 @@ loadPreferences = function() {
var dl_limit = pref.dl_limit.toInt() / 1024;
if (dl_limit < = 0) {
$('dl_limit_checkbox').setProperty('checked', false);
} else {
}
else {
$('dl_limit_checkbox').setProperty('checked', true);
$('dl_limit_value').setProperty('value', dl_limit);
}
@ -921,7 +936,8 @@ loadPreferences = function() {
@@ -921,7 +936,8 @@ loadPreferences = function() {
var alt_up_limit = pref.alt_up_limit.toInt() / 1024;
if (alt_up_limit < = 0) {
$('alt_up_limit_checkbox').setProperty('checked', false);
} else {
}
else {
$('alt_up_limit_checkbox').setProperty('checked', true);
$('alt_up_limit_value').setProperty('value', alt_up_limit);
}
@ -929,7 +945,8 @@ loadPreferences = function() {
@@ -929,7 +945,8 @@ loadPreferences = function() {
var alt_dl_limit = pref.alt_dl_limit.toInt() / 1024;
if (alt_dl_limit < = 0) {
$('alt_dl_limit_checkbox').setProperty('checked', false);
} else {
}
else {
$('alt_dl_limit_checkbox').setProperty('checked', true);
$('alt_dl_limit_value').setProperty('value', alt_dl_limit);
}
@ -1107,18 +1124,22 @@ applyPreferences = function() {
@@ -1107,18 +1124,22 @@ applyPreferences = function() {
if ($('peer_proxy_auth_checkbox').getProperty('checked')) {
proxy_type = 4;
proxy_auth_enabled = true;
} else {
}
else {
proxy_type = 2;
}
} else {
}
else {
if (proxy_type_str == "socks4") {
proxy_type = 5;
} else {
}
else {
if (proxy_type_str == "http") {
if ($('peer_proxy_auth_checkbox').getProperty('checked')) {
proxy_type = 3;
proxy_auth_enabled = true;
} else {
}
else {
proxy_type = 1;
}
}
@ -1302,7 +1323,8 @@ applyPreferences = function() {
@@ -1302,7 +1323,8 @@ applyPreferences = function() {
// Send it to qBT
var json_str = JSON.encode(settings);
new Request({url: 'api/v2/app/setPreferences',
new Request({
url: 'api/v2/app/setPreferences',
method: 'post',
data: {
'json': json_str,