diff --git a/src/eventmanager.cpp b/src/eventmanager.cpp index b066d5e81..f4172d1ef 100644 --- a/src/eventmanager.cpp +++ b/src/eventmanager.cpp @@ -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 { 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(); diff --git a/src/preferences.h b/src/preferences.h index da3f97053..4655a8003 100644 --- a/src/preferences.h +++ b/src/preferences.h @@ -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) { diff --git a/src/src.pro b/src/src.pro index 39a475fdc..282ab6369 100644 --- a/src/src.pro +++ b/src/src.pro @@ -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 diff --git a/src/webui/preferences_content.html b/src/webui/preferences_content.html index 863972fca..469933cbc 100644 --- a/src/webui/preferences_content.html +++ b/src/webui/preferences_content.html @@ -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 @@ 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() { $('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() { } 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);