From 54af927d27739e7c141b63a57ba57ed289bdef7a Mon Sep 17 00:00:00 2001 From: Yutao Meng Date: Wed, 11 Sep 2024 14:26:12 +0800 Subject: [PATCH] fix: Save button is not enabled when proxy address changed after saving Bug: https://pms.uniontech.com/bug-view-273365.html Log: Save button is not enabled when proxy address changed after saving --- dcc-network-plugin/window/sysproxymodule.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dcc-network-plugin/window/sysproxymodule.cpp b/dcc-network-plugin/window/sysproxymodule.cpp index 0471aac8..7e4ac7f1 100644 --- a/dcc-network-plugin/window/sysproxymodule.cpp +++ b/dcc-network-plugin/window/sysproxymodule.cpp @@ -183,6 +183,11 @@ void SysProxyModule::initManualView(QWidget *w) portEdit->textEdit()->installEventFilter(this); group->appendItem(proxyEdit); group->appendItem(portEdit); + connect(proxyEdit->textEdit(), &QLineEdit::textChanged, this, [this] (const QString &text) { + if (!text.isEmpty()) { + m_buttonTuple->setEnabled(true); + } + }); connect(portEdit->textEdit(), &QLineEdit::textChanged, this, [portEdit](const QString &str) { if (str.toInt() < 0) { portEdit->setText("0"); @@ -229,6 +234,11 @@ void SysProxyModule::initManualView(QWidget *w) resetData(ProxyMethod::Manual); ProxyController *proxyController = NetworkController::instance()->proxyController(); + connect(m_ignoreList, &DTextEdit::textChanged, this, [this] { + if (!m_ignoreList->toPlainText().isEmpty()) { + m_buttonTuple->setEnabled(true); + } + }); connect(proxyController, &ProxyController::proxyIgnoreHostsChanged, m_ignoreList, [this](const QString &hosts) { const QTextCursor cursor = m_ignoreList->textCursor(); m_ignoreList->blockSignals(true);