diff --git a/src/frontend/netdetails/detailpage.cpp b/src/frontend/netdetails/detailpage.cpp index 54f94893..4f40d057 100644 --- a/src/frontend/netdetails/detailpage.cpp +++ b/src/frontend/netdetails/detailpage.cpp @@ -3,7 +3,7 @@ #include #define MAX_NAME_LENGTH 32 -#define MAX_LABEL_WIDTH 276 +#define MAX_LABEL_WIDTH 250 extern void qt_blurImage(QImage &blurImage, qreal radius, bool quality, int transposed); DetailPage::DetailPage(bool isWlan, bool isCreate, QWidget *parent) @@ -160,7 +160,9 @@ void DetailPage::initUI() { m_ipv4DnsWidget = new DetailWidget(qobject_cast(mIPV4Dns), m_listWidget); m_ipv4DnsWidget->setKey(tr("IPV4 Dns:")); - mIPV6 = new QLabel(this); + mIPV6 = new FixLabel(this); + mIPV6->setFixedWidth(MAX_LABEL_WIDTH); + mIPV6->setAlignment(Qt::AlignRight | Qt::AlignVCenter); m_ipv6Widget = new DetailWidget(qobject_cast(mIPV6), m_listWidget); m_ipv6Widget->setKey(tr("IPV6:")); diff --git a/src/frontend/netdetails/detailpage.h b/src/frontend/netdetails/detailpage.h index eb9e9fdd..851ccffa 100644 --- a/src/frontend/netdetails/detailpage.h +++ b/src/frontend/netdetails/detailpage.h @@ -61,7 +61,7 @@ public: QLabel *mBandWidth; QLabel *mIPV4; QLabel *mIPV4Dns; - QLabel *mIPV6; + FixLabel *mIPV6; QLabel *mMac; QLabel *autoConnect; diff --git a/src/frontend/netdetails/detailwidget.cpp b/src/frontend/netdetails/detailwidget.cpp index e8f07dea..54359865 100644 --- a/src/frontend/netdetails/detailwidget.cpp +++ b/src/frontend/netdetails/detailwidget.cpp @@ -5,6 +5,8 @@ #define ITEM_HEIGHT 36 #define ITEM_MARGINS 18,0,16,0 +#define MAX_LABEL_WIDTH 138 + FixLabel::FixLabel(QWidget *parent): QLabel(parent) { @@ -56,7 +58,9 @@ void DetailWidget::initUI() m_mainLayout = new QHBoxLayout(this); m_mainLayout->setContentsMargins(ITEM_MARGINS); - m_keyLabel = new QLabel(this); + m_keyLabel = new FixLabel(this); + m_keyLabel->setMaximumWidth(MAX_LABEL_WIDTH); + m_keyLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); m_mainLayout->addWidget(m_keyLabel); m_mainLayout->addStretch(); m_mainLayout->addWidget(m_valueWidget); diff --git a/src/frontend/netdetails/detailwidget.h b/src/frontend/netdetails/detailwidget.h index 68c311bf..28ee8046 100644 --- a/src/frontend/netdetails/detailwidget.h +++ b/src/frontend/netdetails/detailwidget.h @@ -32,7 +32,7 @@ public: private: QHBoxLayout * m_mainLayout = nullptr; - QLabel * m_keyLabel = nullptr; + FixLabel * m_keyLabel = nullptr; QWidget * m_valueWidget = nullptr; void initUI(); diff --git a/src/frontend/netdetails/netdetail.cpp b/src/frontend/netdetails/netdetail.cpp index 4bfdc635..bbe3fa25 100644 --- a/src/frontend/netdetails/netdetail.cpp +++ b/src/frontend/netdetails/netdetail.cpp @@ -429,6 +429,9 @@ void NetDetail::getBaseInfo(ConInfo &conInfo) conInfo.strChan = QString::number(item.m_channel); //无线特有 conInfo.strSecType = item.m_secuType; + if (conInfo.strSecType.isEmpty()) { + conInfo.strSecType = "None"; + } } } else { uint iHz,iChan; @@ -536,14 +539,21 @@ void NetDetail::getStaticIpInfo(ConInfo &conInfo, bool bActived) void NetDetail::initSecuData() { - QString password; + QString password(""); int type = m_info.secType; switch (type) { case NONE: break; case WPA_AND_WPA2_PERSONAL: case WPA3_PERSONAL: - password = m_wirelessConnOpration->getPsk(m_uuid); + if (!m_uuid.isEmpty()) { + NetworkManager::Setting::SecretFlags flag; + if (m_wirelessConnOpration->getConnSecretFlags(m_uuid, flag)) { + if (!flag) { + password = m_wirelessConnOpration->getPsk(m_uuid); + } + } + } m_info.strPassword = password; securityPage->setPsk(password); break;