Browse Source

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

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
8271e20fac
  1. 2
      src/httpconnection.cpp
  2. 39
      src/webui/preferences_content.html

2
src/httpconnection.cpp

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

39
src/webui/preferences_content.html

@ -69,6 +69,20 @@
</select><br/> </select><br/>
</div> </div>
</fieldset> </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>
<div id="DownloadsTab" class="PrefTab invisible"> <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() { updateMaxConnecEnabled = function() {
if($defined($('max_connec_checkbox').get('checked')) && $('max_connec_checkbox').get('checked')) { if($defined($('max_connec_checkbox').get('checked')) && $('max_connec_checkbox').get('checked')) {
$('max_connec_value').removeProperty('disabled'); $('max_connec_value').removeProperty('disabled');

Loading…
Cancel
Save