Browse Source

- Added Peer id spoofing settings to Web UI

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
435801c893
  1. 9
      src/eventmanager.cpp
  2. 15
      src/preferences.h
  3. 2
      src/src.pro
  4. 12
      src/webui/preferences_content.html

9
src/eventmanager.cpp

@ -176,6 +176,12 @@ void EventManager::setGlobalPreferences(QVariantMap m) const {
Preferences::setLSDEnabled(m["lsd"].toBool()); Preferences::setLSDEnabled(m["lsd"].toBool());
if(m.contains("encryption")) if(m.contains("encryption"))
Preferences::setEncryptionSetting(m["encryption"].toInt()); Preferences::setEncryptionSetting(m["encryption"].toInt());
if(m.contains("peer_id"))
Preferences::setPeerID(m["peer_id"].toString());
if(m.contains("peer_version"))
Preferences::setClientVersion(m["peer_version"].toString());
if(m.contains("peer_build"))
Preferences::setClientBuild(m["peer_build"].toString());
// Proxy // Proxy
if(m.contains("proxy_type")) if(m.contains("proxy_type"))
Preferences::setPeerProxyType(m["proxy_type"].toInt()); Preferences::setPeerProxyType(m["proxy_type"].toInt());
@ -249,6 +255,9 @@ QVariantMap EventManager::getGlobalPreferences() const {
data["pex"] = Preferences::isPeXEnabled(); data["pex"] = Preferences::isPeXEnabled();
data["lsd"] = Preferences::isLSDEnabled(); data["lsd"] = Preferences::isLSDEnabled();
data["encryption"] = Preferences::getEncryptionSetting(); data["encryption"] = Preferences::getEncryptionSetting();
data["peer_id"] = Preferences::getPeerID();
data["peer_version"] = Preferences::getClientVersion();
data["peer_build"] = Preferences::getClientBuild();
// Proxy // Proxy
data["proxy_type"] = Preferences::getPeerProxyType(); data["proxy_type"] = Preferences::getPeerProxyType();
data["proxy_ip"] = Preferences::getPeerProxyIp(); data["proxy_ip"] = Preferences::getPeerProxyIp();

15
src/preferences.h

@ -459,12 +459,17 @@ public:
} }
static QString getDefaultClientVersion(QString peer_id) { static QString getDefaultClientVersion(QString peer_id) {
// Azureus if(peer_id == "UT") {
if(peer_id == "AZ") { // uTorrent
return "4.3.0.4"; return "1.8.5";
} else {
// Azureus
if(peer_id == "AZ") {
return "4.3.0.4";
} else {
return QString(VERSION);
}
} }
// uTorrent
return "1.8.5";
} }
static QString getDefaultClientBuild(QString peer_id) { static QString getDefaultClientBuild(QString peer_id) {

2
src/src.pro

@ -12,7 +12,7 @@ CONFIG += qt \
thread thread
# Update this VERSION for each release # Update this VERSION for each release
DEFINES += VERSION=\\\"v2.1.0beta2\\\" DEFINES += VERSION=\\\"v2.1.0beta3\\\"
DEFINES += VERSION_MAJOR=2 DEFINES += VERSION_MAJOR=2
DEFINES += VERSION_MINOR=1 DEFINES += VERSION_MINOR=1
DEFINES += VERSION_BUGFIX=0 DEFINES += VERSION_BUGFIX=0

12
src/webui/preferences_content.html

@ -322,6 +322,9 @@
var lsd = 0; var lsd = 0;
if($defined($('lsd_checkbox').get('checked')) && $('lsd_checkbox').get('checked')) if($defined($('lsd_checkbox').get('checked')) && $('lsd_checkbox').get('checked'))
lsd = 1; lsd = 1;
var peer_id = $('peer_id_select').get('value');
var peer_version = $('peer_version_text').get('value');
var peer_build = $('peer_build_text').get('value');
// Downloads // Downloads
var save_path = $("savepath_text").get('value'); var save_path = $("savepath_text").get('value');
var temp_path_enabled = 0 var temp_path_enabled = 0
@ -424,6 +427,9 @@
dict.set('pex', pex); dict.set('pex', pex);
dict.set('lsd', lsd); dict.set('lsd', lsd);
dict.set('encryption', $('encryption_select').get('value')); dict.set('encryption', $('encryption_select').get('value'));
dict.set('peer_id', peer_id);
dict.set('peer_version', peer_version);
dict.set('peer_build', peer_build);
// Downloads // Downloads
dict.set('save_path', save_path); dict.set('save_path', save_path);
dict.set('temp_path_enabled', temp_path_enabled); dict.set('temp_path_enabled', temp_path_enabled);
@ -501,7 +507,7 @@ updateSpoofingSettings = function() {
$('peer_build_text').removeProperty('disabled'); $('peer_build_text').removeProperty('disabled');
$('peer_build_text').set('value', '17414'); $('peer_build_text').set('value', '17414');
} else { } else {
if(peer_id = "AZ") { if(peer_id == "AZ") {
// Vuze // Vuze
$('peer_version_text').removeProperty('disabled'); $('peer_version_text').removeProperty('disabled');
$('peer_version_text').set('value', '4.3.0.4'); $('peer_version_text').set('value', '4.3.0.4');
@ -721,6 +727,10 @@ loadPreferences = function() {
} }
var encryption = pref.encryption.toInt(); var encryption = pref.encryption.toInt();
$('encryption_select').getChildren('option')[encryption].setAttribute('selected', ''); $('encryption_select').getChildren('option')[encryption].setAttribute('selected', '');
$('peer_id_select').set('value', pref.peer_id);
updateSpoofingSettings();
$('peer_version_text').set('value', pref.peer_version);
$('peer_build_text').set('value', pref.peer_build);
// Downloads // Downloads
var save_path = pref.save_path; var save_path = pref.save_path;
$("savepath_text").set('value', save_path); $("savepath_text").set('value', save_path);

Loading…
Cancel
Save