Skip to content

Commit

Permalink
fix: Save button is not enabled when proxy address changed after saving
Browse files Browse the repository at this point in the history
Bug: https://pms.uniontech.com/bug-view-273365.html
Log: Save button is not enabled when proxy address changed after saving
  • Loading branch information
ArchieMeng authored and deepin-bot[bot] committed Sep 11, 2024
1 parent 76bc8b7 commit 58dcb07
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions dcc-network-plugin/window/sysproxymodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 58dcb07

Please sign in to comment.