From f3d6c0b5fd4d8a95879c72cabe110647310d6be0 Mon Sep 17 00:00:00 2001 From: York Lee Date: Mon, 17 Apr 2023 19:55:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BA=86=E4=BB=A3?= =?UTF-8?q?=E7=90=86=E4=B8=8E=E7=AB=AF=E5=8F=A3=E4=B9=8B=E9=97=B4=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E4=BD=BF=E7=94=A8=E4=B8=8D=E5=AF=B9=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 应用代理,网络详情页面的每一行间距过大,把间距改为1 issue: https://github.com/linuxdeepin/dde-network-core/issues/141 Log: 修复了代理与端口之间控件使用不对的问题 --- dcc-network-plugin/window/appproxymodule.cpp | 14 ++++++++------ dcc-network-plugin/window/networkinfomodule.cpp | 7 +++++-- .../window/sections/secrethotspotsection.cpp | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/dcc-network-plugin/window/appproxymodule.cpp b/dcc-network-plugin/window/appproxymodule.cpp index 1c348917..e9b02b51 100644 --- a/dcc-network-plugin/window/appproxymodule.cpp +++ b/dcc-network-plugin/window/appproxymodule.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -31,8 +32,8 @@ AppProxyModule::AppProxyModule(QObject *parent) : PageModule("applicationProxy", tr("Application Proxy"), tr("Application Proxy"), QIcon::fromTheme("dcc_app_proxy"), parent) { deactive(); - - appendChild(new WidgetModule("app_proxy_type", tr("Proxy Type"), [this](ComboxWidget *proxyType) { + SettingsGroupModule *appProxyModuleGroup = new SettingsGroupModule("", tr("")); + appProxyModuleGroup->appendChild(new WidgetModule("app_proxy_type", tr("Proxy Type"), [this](ComboxWidget *proxyType) { m_proxyType = proxyType; proxyType->addBackground(); proxyType->setTitle(tr("Proxy Type")); @@ -51,7 +52,7 @@ AppProxyModule::AppProxyModule(QObject *parent) updateProxyType(NetworkController::instance()->proxyController()->appProxy().type); }); })); - appendChild(new WidgetModule("app_proxy_ip", tr("IP Address"), [this](LineEditWidget *addr) { + appProxyModuleGroup->appendChild(new WidgetModule("app_proxy_ip", tr("IP Address"), [this](LineEditWidget *addr) { m_addr = addr; m_addr->addBackground(); m_addr->setTitle(tr("IP Address")); @@ -68,7 +69,7 @@ AppProxyModule::AppProxyModule(QObject *parent) updateAddr(NetworkController::instance()->proxyController()->appProxy().ip); }); })); - appendChild(new WidgetModule("app_proxy_port", tr("Port"), [this](LineEditWidget *portWidget) { + appProxyModuleGroup->appendChild(new WidgetModule("app_proxy_port", tr("Port"), [this](LineEditWidget *portWidget) { m_port = portWidget; portWidget->addBackground(); portWidget->setTitle(tr("Port")); @@ -85,7 +86,7 @@ AppProxyModule::AppProxyModule(QObject *parent) updatePort(NetworkController::instance()->proxyController()->appProxy().port); }); })); - appendChild(new WidgetModule("app_proxy_username", tr("Username"), [this](LineEditWidget *username) { + appProxyModuleGroup->appendChild(new WidgetModule("app_proxy_username", tr("Username"), [this](LineEditWidget *username) { m_username = username; username->addBackground(); username->setTitle(tr("Username")); @@ -102,7 +103,7 @@ AppProxyModule::AppProxyModule(QObject *parent) updateUsername(NetworkController::instance()->proxyController()->appProxy().username); }); })); - appendChild(new WidgetModule("app_proxy_password", tr("Password"), [this](LineEditWidget *password) { + appProxyModuleGroup->appendChild(new WidgetModule("app_proxy_password", tr("Password"), [this](LineEditWidget *password) { m_password = password; password->addBackground(); password->setTitle(tr("Password")); @@ -120,6 +121,7 @@ AppProxyModule::AppProxyModule(QObject *parent) updatePassword(NetworkController::instance()->proxyController()->appProxy().password); }); })); + appendChild(appProxyModuleGroup); appendChild(new WidgetModule("app_proxy_tip", tr("Check \"Use a proxy\" in application context menu in Launcher after configured"), [](DTipLabel *tip) { tip->setText(tr("Check \"Use a proxy\" in application context menu in Launcher after configured")); tip->setWordWrap(true); diff --git a/dcc-network-plugin/window/networkinfomodule.cpp b/dcc-network-plugin/window/networkinfomodule.cpp index 23da44d4..33a8e907 100644 --- a/dcc-network-plugin/window/networkinfomodule.cpp +++ b/dcc-network-plugin/window/networkinfomodule.cpp @@ -10,6 +10,7 @@ #include #include #include +#include using namespace dde::network; using namespace DCC_NAMESPACE; @@ -29,6 +30,7 @@ void NetworkInfoModule::onUpdateNetworkInfo() } QList netDetails = NetworkController::instance()->networkDetails(); int size = netDetails.size(); + SettingsGroupModule *networkModuleGroup = new SettingsGroupModule("", tr("")); for (int i = 0; i < size; i++) { NetworkDetails *detail = netDetails[i]; appendChild(new WidgetModule("", tr(""), [detail](SettingsHead *head) { @@ -38,7 +40,7 @@ void NetworkInfoModule::onUpdateNetworkInfo() })); QList> items = detail->items(); for (const QPair &item : items) - appendChild(new WidgetModule("", tr(""), [item](TitleValueItem *valueItem) { + networkModuleGroup->appendChild(new WidgetModule("", tr(""), [item](TitleValueItem *valueItem) { valueItem->setTitle(item.first); valueItem->setValue(item.second); valueItem->addBackground(); @@ -46,6 +48,7 @@ void NetworkInfoModule::onUpdateNetworkInfo() valueItem->setWordWrap(false); })); if (i < size - 1) - appendChild(new WidgetModule()); + networkModuleGroup->appendChild(new WidgetModule()); } + appendChild(networkModuleGroup); } diff --git a/dcc-network-plugin/window/sections/secrethotspotsection.cpp b/dcc-network-plugin/window/sections/secrethotspotsection.cpp index 8073823c..077664c6 100644 --- a/dcc-network-plugin/window/sections/secrethotspotsection.cpp +++ b/dcc-network-plugin/window/sections/secrethotspotsection.cpp @@ -22,7 +22,7 @@ static const QList KeyMgmtList { }; SecretHotspotSection::SecretHotspotSection(WirelessSecuritySetting::Ptr wsSeting, QFrame *parent) - : AbstractSection(parent) + : AbstractSection(tr("Security"), parent) , m_keyMgmtChooser(new ComboxWidget(this)) , m_passwdEdit(new LineEditWidget(true)) , m_currentKeyMgmt(WirelessSecuritySetting::KeyMgmt::WpaNone)