1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-10 14:57:52 +00:00

- Started work on adding Peer ID spoofing settings for Web UI (incomplete)

This commit is contained in:
Christophe Dumez 2009-12-30 16:21:05 +00:00
parent 132b1f7ffe
commit 8271e20fac
2 changed files with 40 additions and 1 deletions

View File

@ -108,7 +108,7 @@ QString HttpConnection::translateDocument(QString data) {
bool found = false;
do {
found = false;
QRegExp regex("_\\(([\\w\\s?!:\\/\\(\\),\\-\\.]+)\\)");
QRegExp regex(QString::fromUtf8("_\\(([\\w\\s?!:\\/\\(\\),µ\\-\\.]+)\\)"));
i = regex.indexIn(data, i);
if(i >= 0) {
//qDebug("Found translatable string: %s", regex.cap(1).toUtf8().data());

View File

@ -69,6 +69,20 @@
</select><br/>
</div>
</fieldset>
<fieldset>
<legend><b>_(Client whitelisting workaround)</b></legend>
_(Identify as:)
<select id="peer_id_select" onchange="updateSpoofingSettings();">
<option value="qB">_(qBittorrent)</option>
<option value="AZ">_(Vuze)</option>
<option value="UT">_(µTorrent)</option>
</select>
&nbsp;&nbsp;
_(Version:) <input type="text" id="peer_version_text" style="width: 7em;" />
&nbsp;&nbsp;
_(Build:) <input type="text" id="peer_build_text" style="width: 5em;" />
<br/>
</fieldset>
</div>
<div id="DownloadsTab" class="PrefTab invisible">
@ -478,6 +492,31 @@ updateUpLimitEnabled = function() {
}
}
updateSpoofingSettings = function() {
var peer_id = $('peer_id_select').get('value');
if(peer_id == "UT") {
// uTorrent
$('peer_version_text').removeProperty('disabled');
$('peer_version_text').set('value', '1.8.5');
$('peer_build_text').removeProperty('disabled');
$('peer_build_text').set('value', '17414');
} else {
if(peer_id = "AZ") {
// Vuze
$('peer_version_text').removeProperty('disabled');
$('peer_version_text').set('value', '4.3.0.4');
$('peer_build_text').set('disabled', 'true');
$('peer_build_text').set('value', '');
} else {
// qBittorrent
$('peer_version_text').set('disabled', 'true');
$('peer_version_text').set('value', '');
$('peer_build_text').set('disabled', 'true');
$('peer_build_text').set('value', '');
}
}
}
updateMaxConnecEnabled = function() {
if($defined($('max_connec_checkbox').get('checked')) && $('max_connec_checkbox').get('checked')) {
$('max_connec_value').removeProperty('disabled');