mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-02 21:52:32 -06:00
Add option for enable/disable performance warnings from libtorrent
This commit is contained in:
@@ -97,8 +97,9 @@ void AppController::shutdownAction()
|
||||
|
||||
void AppController::preferencesAction()
|
||||
{
|
||||
const Preferences *const pref = Preferences::instance();
|
||||
const auto *pref = Preferences::instance();
|
||||
const auto *session = BitTorrent::Session::instance();
|
||||
|
||||
QJsonObject data;
|
||||
|
||||
// Downloads
|
||||
@@ -231,6 +232,7 @@ void AppController::preferencesAction()
|
||||
// Web UI
|
||||
// Language
|
||||
data["locale"] = pref->getLocale();
|
||||
data["performance_warning"] = session->isPerformanceWarningEnabled();
|
||||
// HTTP Server
|
||||
data["web_ui_domain_list"] = pref->getServerDomains();
|
||||
data["web_ui_address"] = pref->getWebUiAddress();
|
||||
@@ -370,8 +372,8 @@ void AppController::setPreferencesAction()
|
||||
{
|
||||
requireParams({"json"});
|
||||
|
||||
Preferences *const pref = Preferences::instance();
|
||||
auto session = BitTorrent::Session::instance();
|
||||
auto *pref = Preferences::instance();
|
||||
auto *session = BitTorrent::Session::instance();
|
||||
const QVariantHash m = QJsonDocument::fromJson(params()["json"].toUtf8()).toVariant().toHash();
|
||||
|
||||
QVariantHash::ConstIterator it;
|
||||
@@ -643,6 +645,8 @@ void AppController::setPreferencesAction()
|
||||
pref->setLocale(locale);
|
||||
}
|
||||
}
|
||||
if (hasKey("performance_warning"))
|
||||
session->setPerformanceWarningEnabled(it.value().toBool());
|
||||
// HTTP Server
|
||||
if (hasKey("web_ui_domain_list"))
|
||||
pref->setServerDomains(it.value().toString());
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include "base/utils/net.h"
|
||||
#include "base/utils/version.h"
|
||||
|
||||
inline const Utils::Version<int, 3, 2> API_VERSION {2, 8, 7};
|
||||
inline const Utils::Version<int, 3, 2> API_VERSION {2, 8, 8};
|
||||
|
||||
class APIController;
|
||||
class WebApplication;
|
||||
|
||||
@@ -693,6 +693,11 @@
|
||||
</select>
|
||||
</fieldset>
|
||||
|
||||
<div class="formRow">
|
||||
<input type="checkbox" id="performanceWarning" />
|
||||
<label for="performanceWarning">QBT_TR(Log performance warnings)QBT_TR[CONTEXT=OptionsDialog]</label>
|
||||
</div>
|
||||
|
||||
<fieldset class="settings">
|
||||
<legend>QBT_TR(Web User Interface (Remote control))QBT_TR[CONTEXT=OptionsDialog]</legend>
|
||||
<table>
|
||||
@@ -1881,6 +1886,7 @@
|
||||
// Web UI tab
|
||||
// Language
|
||||
$('locale_select').setProperty('value', pref.locale);
|
||||
$('performanceWarning').setProperty('checked', pref.performance_warning);
|
||||
|
||||
// HTTP Server
|
||||
$('webui_domain_textarea').setProperty('value', pref.web_ui_domain_list);
|
||||
@@ -2259,6 +2265,7 @@
|
||||
// Web UI tab
|
||||
// Language
|
||||
settings.set('locale', $('locale_select').getProperty('value'));
|
||||
settings.set('performance_warning', $('performanceWarning').getProperty('checked'));
|
||||
|
||||
// HTTP Server
|
||||
settings.set('web_ui_domain_list', $('webui_domain_textarea').getProperty('value'));
|
||||
|
||||
Reference in New Issue
Block a user