Skip to content

Commit

Permalink
fix: Responding to proxy change signals
Browse files Browse the repository at this point in the history
Responding to proxy change signals

Issue: linuxdeepin/developer-center#9711
  • Loading branch information
caixr23 committed Jul 19, 2024
1 parent 77db1b2 commit 627bc66
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dcc-network-plugin/window/sysproxymodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ SysProxyModule::SysProxyModule(QObject *parent)
proxySwitch->setLeftWidget(lblTitle);
proxySwitch->switchButton()->setAccessibleName(lblTitle->text());

auto updateSwitch = [proxySwitch]() {
auto updateSwitch = [proxySwitch, this]() {
ProxyMethod method = NetworkController::instance()->proxyController()->proxyMethod();
proxySwitch->blockSignals(true);
proxySwitch->setChecked(method != ProxyMethod::None);
uiMethodChanged(method);
proxySwitch->blockSignals(false);
};
updateSwitch();
Expand Down
1 change: 1 addition & 0 deletions src/networkdbusproxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class NetworkDBusProxy : public QObject
void ActiveConnectionInfoChanged();
void DeviceEnabled(const QString &device, bool enabled);
void IPConflict(const QString &in0, const QString &in1);
void ProxyMethodChanged(const QString &method);
// begin property changed signals
void ActiveConnectionsChanged(const QString &value) const;
void ConnectionsChanged(const QString &value) const;
Expand Down
1 change: 1 addition & 0 deletions src/proxycontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ ProxyController::ProxyController(NetworkDBusProxy *networkInter, QObject *parent
connect(m_networkInter, &NetworkDBusProxy::TypeChanged, this, &ProxyController::onTypeChanged);
connect(m_networkInter, &NetworkDBusProxy::UserChanged, this, &ProxyController::onUserChanged);
connect(m_networkInter, &NetworkDBusProxy::PortChanged, this, &ProxyController::onPortChanged);
connect(m_networkInter, &NetworkDBusProxy::ProxyMethodChanged, this, &ProxyController::queryProxyMethod);
// 初始化应用代理的相关的数据
m_appProxyConfig.type = appProxyType(m_networkInter->type());
m_appProxyConfig.ip = m_networkInter->iP();
Expand Down

0 comments on commit 627bc66

Please sign in to comment.