Skip to content

Commit

Permalink
fix: 修复了代理与端口之间控件使用不对的问题
Browse files Browse the repository at this point in the history
应用代理,网络详情页面的每一行间距过大,把间距改为1

issue: #141

Log: 修复了代理与端口之间控件使用不对的问题
  • Loading branch information
sdpyly authored and Zhengyu Zhu committed Apr 20, 2023
1 parent ec5dc8a commit f3d6c0b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
14 changes: 8 additions & 6 deletions dcc-network-plugin/window/appproxymodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <widgets/comboxwidget.h>
#include <widgets/lineeditwidget.h>
#include <widgets/widgetmodule.h>
#include <widgets/settingsgroupmodule.h>

#include <QLineEdit>
#include <QPushButton>
Expand All @@ -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<ComboxWidget>("app_proxy_type", tr("Proxy Type"), [this](ComboxWidget *proxyType) {
SettingsGroupModule *appProxyModuleGroup = new SettingsGroupModule("", tr(""));
appProxyModuleGroup->appendChild(new WidgetModule<ComboxWidget>("app_proxy_type", tr("Proxy Type"), [this](ComboxWidget *proxyType) {
m_proxyType = proxyType;
proxyType->addBackground();
proxyType->setTitle(tr("Proxy Type"));
Expand All @@ -51,7 +52,7 @@ AppProxyModule::AppProxyModule(QObject *parent)
updateProxyType(NetworkController::instance()->proxyController()->appProxy().type);
});
}));
appendChild(new WidgetModule<LineEditWidget>("app_proxy_ip", tr("IP Address"), [this](LineEditWidget *addr) {
appProxyModuleGroup->appendChild(new WidgetModule<LineEditWidget>("app_proxy_ip", tr("IP Address"), [this](LineEditWidget *addr) {
m_addr = addr;
m_addr->addBackground();
m_addr->setTitle(tr("IP Address"));
Expand All @@ -68,7 +69,7 @@ AppProxyModule::AppProxyModule(QObject *parent)
updateAddr(NetworkController::instance()->proxyController()->appProxy().ip);
});
}));
appendChild(new WidgetModule<LineEditWidget>("app_proxy_port", tr("Port"), [this](LineEditWidget *portWidget) {
appProxyModuleGroup->appendChild(new WidgetModule<LineEditWidget>("app_proxy_port", tr("Port"), [this](LineEditWidget *portWidget) {
m_port = portWidget;
portWidget->addBackground();
portWidget->setTitle(tr("Port"));
Expand All @@ -85,7 +86,7 @@ AppProxyModule::AppProxyModule(QObject *parent)
updatePort(NetworkController::instance()->proxyController()->appProxy().port);
});
}));
appendChild(new WidgetModule<LineEditWidget>("app_proxy_username", tr("Username"), [this](LineEditWidget *username) {
appProxyModuleGroup->appendChild(new WidgetModule<LineEditWidget>("app_proxy_username", tr("Username"), [this](LineEditWidget *username) {
m_username = username;
username->addBackground();
username->setTitle(tr("Username"));
Expand All @@ -102,7 +103,7 @@ AppProxyModule::AppProxyModule(QObject *parent)
updateUsername(NetworkController::instance()->proxyController()->appProxy().username);
});
}));
appendChild(new WidgetModule<LineEditWidget>("app_proxy_password", tr("Password"), [this](LineEditWidget *password) {
appProxyModuleGroup->appendChild(new WidgetModule<LineEditWidget>("app_proxy_password", tr("Password"), [this](LineEditWidget *password) {
m_password = password;
password->addBackground();
password->setTitle(tr("Password"));
Expand All @@ -120,6 +121,7 @@ AppProxyModule::AppProxyModule(QObject *parent)
updatePassword(NetworkController::instance()->proxyController()->appProxy().password);
});
}));
appendChild(appProxyModuleGroup);
appendChild(new WidgetModule<DTipLabel>("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);
Expand Down
7 changes: 5 additions & 2 deletions dcc-network-plugin/window/networkinfomodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <widgets/settingshead.h>
#include <widgets/widgetmodule.h>
#include <widgets/titlevalueitem.h>
#include <widgets/settingsgroupmodule.h>

using namespace dde::network;
using namespace DCC_NAMESPACE;
Expand All @@ -29,6 +30,7 @@ void NetworkInfoModule::onUpdateNetworkInfo()
}
QList<NetworkDetails *> 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<SettingsHead>("", tr(""), [detail](SettingsHead *head) {
Expand All @@ -38,14 +40,15 @@ void NetworkInfoModule::onUpdateNetworkInfo()
}));
QList<QPair<QString, QString>> items = detail->items();
for (const QPair<QString, QString> &item : items)
appendChild(new WidgetModule<TitleValueItem>("", tr(""), [item](TitleValueItem *valueItem) {
networkModuleGroup->appendChild(new WidgetModule<TitleValueItem>("", tr(""), [item](TitleValueItem *valueItem) {
valueItem->setTitle(item.first);
valueItem->setValue(item.second);
valueItem->addBackground();
if (item.first == "IPv6")
valueItem->setWordWrap(false);
}));
if (i < size - 1)
appendChild(new WidgetModule<QWidget>());
networkModuleGroup->appendChild(new WidgetModule<QWidget>());
}
appendChild(networkModuleGroup);
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static const QList<WirelessSecuritySetting::KeyMgmt> 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)
Expand Down

0 comments on commit f3d6c0b

Please sign in to comment.