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

15
src/preferences.h

@ -459,12 +459,17 @@ public: @@ -459,12 +459,17 @@ public:
}
static QString getDefaultClientVersion(QString peer_id) {
// Azureus
if(peer_id == "AZ") {
return "4.3.0.4";
if(peer_id == "UT") {
// uTorrent
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) {

2
src/src.pro

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

12
src/webui/preferences_content.html

@ -322,6 +322,9 @@ @@ -322,6 +322,9 @@
var lsd = 0;
if($defined($('lsd_checkbox').get('checked')) && $('lsd_checkbox').get('checked'))
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
var save_path = $("savepath_text").get('value');
var temp_path_enabled = 0
@ -424,6 +427,9 @@ @@ -424,6 +427,9 @@
dict.set('pex', pex);
dict.set('lsd', lsd);
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
dict.set('save_path', save_path);
dict.set('temp_path_enabled', temp_path_enabled);
@ -501,7 +507,7 @@ updateSpoofingSettings = function() { @@ -501,7 +507,7 @@ updateSpoofingSettings = function() {
$('peer_build_text').removeProperty('disabled');
$('peer_build_text').set('value', '17414');
} else {
if(peer_id = "AZ") {
if(peer_id == "AZ") {
// Vuze
$('peer_version_text').removeProperty('disabled');
$('peer_version_text').set('value', '4.3.0.4');
@ -721,6 +727,10 @@ loadPreferences = function() { @@ -721,6 +727,10 @@ loadPreferences = function() {
}
var encryption = pref.encryption.toInt();
$('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
var save_path = pref.save_path;
$("savepath_text").set('value', save_path);

Loading…
Cancel
Save