commit
0399e290a2
|
@ -23,8 +23,7 @@
|
||||||
#include "xatom-helper.h"
|
#include "xatom-helper.h"
|
||||||
#define MAIN_SIZE_EXPAND 480,580
|
#define MAIN_SIZE_EXPAND 480,580
|
||||||
#define MAIN_SIZE_NARROW 480,484
|
#define MAIN_SIZE_NARROW 480,484
|
||||||
#define PEAP_SCRO_HEIGHT 390
|
#define SCROAREA_WIDTH 480
|
||||||
#define TLS_SCRO_HEIGHT 590
|
|
||||||
#define MAIN_LAYOUT_MARGINS 0,0,0,0
|
#define MAIN_LAYOUT_MARGINS 0,0,0,0
|
||||||
#define CENTER_LAYOUT_MARGINS 24, 16, 24, 8
|
#define CENTER_LAYOUT_MARGINS 24, 16, 24, 8
|
||||||
#define BUTTON_LAYOUT_MARGINS 24, 24, 24, 24
|
#define BUTTON_LAYOUT_MARGINS 24, 24, 24, 24
|
||||||
|
@ -127,7 +126,11 @@ void EnterpriseWlanDialog::initUI()
|
||||||
m_enterWlanScrollArea = new QScrollArea(this);
|
m_enterWlanScrollArea = new QScrollArea(this);
|
||||||
m_enterWlanScrollArea->setFrameShape(QFrame::NoFrame);
|
m_enterWlanScrollArea->setFrameShape(QFrame::NoFrame);
|
||||||
m_enterWlanScrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
m_enterWlanScrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
|
m_centerWidget->setFixedWidth(SCROAREA_WIDTH);
|
||||||
|
m_enterWlanScrollArea->setFixedWidth(SCROAREA_WIDTH);
|
||||||
m_enterWlanScrollArea->setWidget(m_centerWidget);
|
m_enterWlanScrollArea->setWidget(m_centerWidget);
|
||||||
|
m_enterWlanScrollArea->setWidgetResizable(true);
|
||||||
|
|
||||||
QPalette pal = m_enterWlanScrollArea->palette();
|
QPalette pal = m_enterWlanScrollArea->palette();
|
||||||
pal.setBrush(QPalette::Base, QColor(0,0,0,0));
|
pal.setBrush(QPalette::Base, QColor(0,0,0,0));
|
||||||
m_enterWlanScrollArea->setPalette(pal);
|
m_enterWlanScrollArea->setPalette(pal);
|
||||||
|
@ -279,21 +282,18 @@ void EnterpriseWlanDialog::onEapTypeChanged(const KyEapMethodType &type)
|
||||||
m_resource->getEnterPriseInfoTls(m_wirelessNetItem.m_connectUuid, m_info.tlsInfo);
|
m_resource->getEnterPriseInfoTls(m_wirelessNetItem.m_connectUuid, m_info.tlsInfo);
|
||||||
}
|
}
|
||||||
this->setFixedSize(MAIN_SIZE_EXPAND);
|
this->setFixedSize(MAIN_SIZE_EXPAND);
|
||||||
// m_centerWidget->setFixedHeight(TLS_SCRO_HEIGHT);
|
|
||||||
break;
|
break;
|
||||||
case KyEapMethodType::PEAP:
|
case KyEapMethodType::PEAP:
|
||||||
if (m_wirelessNetItem.m_connectUuid.isEmpty()) {
|
if (m_wirelessNetItem.m_connectUuid.isEmpty()) {
|
||||||
m_resource->getEnterPriseInfoPeap(m_wirelessNetItem.m_connectUuid, m_info.peapInfo);
|
m_resource->getEnterPriseInfoPeap(m_wirelessNetItem.m_connectUuid, m_info.peapInfo);
|
||||||
}
|
}
|
||||||
this->setFixedSize(MAIN_SIZE_NARROW);
|
this->setFixedSize(MAIN_SIZE_NARROW);
|
||||||
// m_centerWidget->setFixedHeight(PEAP_SCRO_HEIGHT);
|
|
||||||
break;
|
break;
|
||||||
case KyEapMethodType::TTLS:
|
case KyEapMethodType::TTLS:
|
||||||
if (!m_wirelessNetItem.m_connectUuid.isEmpty()) {
|
if (!m_wirelessNetItem.m_connectUuid.isEmpty()) {
|
||||||
m_resource->getEnterPriseInfoTtls(m_wirelessNetItem.m_connectUuid, m_info.ttlsInfo);
|
m_resource->getEnterPriseInfoTtls(m_wirelessNetItem.m_connectUuid, m_info.ttlsInfo);
|
||||||
}
|
}
|
||||||
this->setFixedSize(MAIN_SIZE_NARROW);
|
this->setFixedSize(MAIN_SIZE_NARROW);
|
||||||
// m_centerWidget->setFixedHeight(PEAP_SCRO_HEIGHT);
|
|
||||||
break;
|
break;
|
||||||
case KyEapMethodType::LEAP:
|
case KyEapMethodType::LEAP:
|
||||||
if (!m_wirelessNetItem.m_connectUuid.isEmpty()) {
|
if (!m_wirelessNetItem.m_connectUuid.isEmpty()) {
|
||||||
|
|
|
@ -35,9 +35,7 @@
|
||||||
#define LABEL_MIN_WIDTH 146
|
#define LABEL_MIN_WIDTH 146
|
||||||
#define LABEL_MAX_WIDTH 434
|
#define LABEL_MAX_WIDTH 434
|
||||||
#define MAX_NAME_LENGTH 32
|
#define MAX_NAME_LENGTH 32
|
||||||
#define PSK_SCRO_HEIGHT 182
|
#define SCROAREA_WIDTH 480
|
||||||
#define PEAP_SCRO_HEIGHT 340
|
|
||||||
#define TLS_SCRO_HEIGHT 560
|
|
||||||
#define MEDIUM_WEIGHT_VALUE 57
|
#define MEDIUM_WEIGHT_VALUE 57
|
||||||
|
|
||||||
JoinHiddenWiFiPage::JoinHiddenWiFiPage(QString devName, KDialog *parent)
|
JoinHiddenWiFiPage::JoinHiddenWiFiPage(QString devName, KDialog *parent)
|
||||||
|
@ -49,7 +47,6 @@ JoinHiddenWiFiPage::JoinHiddenWiFiPage(QString devName, KDialog *parent)
|
||||||
initUI();
|
initUI();
|
||||||
initComponent();
|
initComponent();
|
||||||
|
|
||||||
setFixedWidth(WINDOW_WIDTH);
|
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
|
||||||
setJoinBtnEnable();
|
setJoinBtnEnable();
|
||||||
|
@ -121,8 +118,11 @@ void JoinHiddenWiFiPage::initUI()
|
||||||
m_centerVBoxLayout->addWidget(ssidWidget);
|
m_centerVBoxLayout->addWidget(ssidWidget);
|
||||||
m_centerVBoxLayout->addSpacing(LAYOUT_SPACING);
|
m_centerVBoxLayout->addSpacing(LAYOUT_SPACING);
|
||||||
m_centerVBoxLayout->addWidget(m_secuWidget);
|
m_centerVBoxLayout->addWidget(m_secuWidget);
|
||||||
m_centerVBoxLayout->addStretch();
|
|
||||||
|
m_centerWidget->setFixedWidth(SCROAREA_WIDTH);
|
||||||
|
m_hiddenWifiScrollArea->setFixedWidth(SCROAREA_WIDTH);
|
||||||
m_hiddenWifiScrollArea->setWidget(m_centerWidget);
|
m_hiddenWifiScrollArea->setWidget(m_centerWidget);
|
||||||
|
m_hiddenWifiScrollArea->setWidgetResizable(true);
|
||||||
|
|
||||||
//底部按钮
|
//底部按钮
|
||||||
m_bottomLayout = new QHBoxLayout(m_bottomWidget);
|
m_bottomLayout = new QHBoxLayout(m_bottomWidget);
|
||||||
|
@ -151,6 +151,7 @@ void JoinHiddenWiFiPage::initUI()
|
||||||
this->setWindowIcon(QIcon::fromTheme("kylin-network"));
|
this->setWindowIcon(QIcon::fromTheme("kylin-network"));
|
||||||
|
|
||||||
this->setFixedHeight(MIN_WINDOW_HEIGHT);
|
this->setFixedHeight(MIN_WINDOW_HEIGHT);
|
||||||
|
this->setFixedWidth(WINDOW_WIDTH);
|
||||||
onPaletteChanged();
|
onPaletteChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,7 +237,6 @@ void JoinHiddenWiFiPage::onSecuTypeChanged(const KySecuType &type)
|
||||||
{
|
{
|
||||||
if (type != KySecuType::WPA_AND_WPA2_ENTERPRISE) {
|
if (type != KySecuType::WPA_AND_WPA2_ENTERPRISE) {
|
||||||
this->setFixedHeight(MIN_WINDOW_HEIGHT);
|
this->setFixedHeight(MIN_WINDOW_HEIGHT);
|
||||||
m_centerWidget->setFixedSize(WINDOW_WIDTH, PSK_SCRO_HEIGHT);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,10 +244,8 @@ void JoinHiddenWiFiPage::onEapTypeChanged(const KyEapMethodType &type)
|
||||||
{
|
{
|
||||||
if (type == KyEapMethodType::TLS) {
|
if (type == KyEapMethodType::TLS) {
|
||||||
this->setFixedHeight(TLS_WINDOW_HEIGHT);
|
this->setFixedHeight(TLS_WINDOW_HEIGHT);
|
||||||
m_centerWidget->setFixedSize(WINDOW_WIDTH, TLS_SCRO_HEIGHT);
|
|
||||||
} else if (type == KyEapMethodType::PEAP || type == KyEapMethodType::TTLS) {
|
} else if (type == KyEapMethodType::PEAP || type == KyEapMethodType::TTLS) {
|
||||||
this->setFixedHeight(PEAP_WINDOW_HEIGHT);
|
this->setFixedHeight(PEAP_WINDOW_HEIGHT);
|
||||||
m_centerWidget->setFixedSize(WINDOW_WIDTH, PEAP_SCRO_HEIGHT);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,9 +47,11 @@
|
||||||
#define CONFIG_PAGE_NUM 4
|
#define CONFIG_PAGE_NUM 4
|
||||||
#define CREATE_NET_PAGE_NUM 5
|
#define CREATE_NET_PAGE_NUM 5
|
||||||
#define PAGE_MIN_HEIGHT 40
|
#define PAGE_MIN_HEIGHT 40
|
||||||
|
#define PAGE_WIDTH 472
|
||||||
#define LAN_TAB_WIDTH 180
|
#define LAN_TAB_WIDTH 180
|
||||||
#define WLAN_TAB_WIDTH 240
|
#define WLAN_TAB_WIDTH 240
|
||||||
#define SCRO_WIDTH 472
|
#define SCRO_WIDTH 496
|
||||||
|
#define SCRO_HEIGHT 600
|
||||||
#define PEAP_SCRO_HEIGHT 300
|
#define PEAP_SCRO_HEIGHT 300
|
||||||
#define TLS_SCRO_HEIGHT 480
|
#define TLS_SCRO_HEIGHT 480
|
||||||
#define MAX_TAB_TEXT_LENGTH 44
|
#define MAX_TAB_TEXT_LENGTH 44
|
||||||
|
@ -167,7 +169,6 @@ NetDetail::NetDetail(QString interface, QString name, QString uuid, bool isActiv
|
||||||
getConInfo(m_info);
|
getConInfo(m_info);
|
||||||
startObjectThread();
|
startObjectThread();
|
||||||
pagePadding(name,isWlan);
|
pagePadding(name,isWlan);
|
||||||
setSecuPageHeight();
|
|
||||||
connect(qApp, &QApplication::paletteChanged, this, &NetDetail::onPaletteChanged);
|
connect(qApp, &QApplication::paletteChanged, this, &NetDetail::onPaletteChanged);
|
||||||
|
|
||||||
isCreateOk = !(m_isCreateNet && !isWlan);
|
isCreateOk = !(m_isCreateNet && !isWlan);
|
||||||
|
@ -281,52 +282,64 @@ void NetDetail::initUI()
|
||||||
{
|
{
|
||||||
QVBoxLayout *mainLayout = new QVBoxLayout(this);
|
QVBoxLayout *mainLayout = new QVBoxLayout(this);
|
||||||
mainLayout->setContentsMargins(0,9,0,24);
|
mainLayout->setContentsMargins(0,9,0,24);
|
||||||
mainLayout->setSpacing(24);
|
mainLayout->setSpacing(22);
|
||||||
|
|
||||||
|
this->installEventFilter(this);
|
||||||
|
pageFrame = new QFrame(this);
|
||||||
|
centerWidget = new QWidget(this);
|
||||||
|
bottomWidget = new QWidget(this);
|
||||||
|
|
||||||
detailPage = new DetailPage(isWlan, m_name.isEmpty(), this);
|
detailPage = new DetailPage(isWlan, m_name.isEmpty(), this);
|
||||||
|
|
||||||
ipv4Page = new Ipv4Page(this);
|
ipv4Page = new Ipv4Page(this);
|
||||||
ipv6Page = new Ipv6Page(this);
|
ipv6Page = new Ipv6Page(this);
|
||||||
securityPage = new SecurityPage(this);
|
securityPage = new SecurityPage(this);
|
||||||
createNetPage = new CreatNetPage(this);
|
createNetPage = new CreatNetPage(this);
|
||||||
configPage = new ConfigPage(this);
|
configPage = new ConfigPage(this);
|
||||||
|
|
||||||
this->installEventFilter(this);
|
detailPage->setFixedWidth(PAGE_WIDTH);
|
||||||
|
ipv4Page->setFixedWidth(PAGE_WIDTH);
|
||||||
|
ipv6Page->setFixedWidth(PAGE_WIDTH);
|
||||||
|
securityPage->setFixedWidth(PAGE_WIDTH);
|
||||||
|
createNetPage->setFixedWidth(PAGE_WIDTH);
|
||||||
|
configPage->setFixedWidth(PAGE_WIDTH);
|
||||||
|
|
||||||
centerWidget = new QWidget(this);
|
m_secuPageScrollArea = new QScrollArea(centerWidget);
|
||||||
bottomWidget = new QWidget(this);
|
m_secuPageScrollArea->setFixedWidth(SCRO_WIDTH);
|
||||||
|
|
||||||
m_secuPageScrollArea = new QScrollArea(this);
|
|
||||||
m_secuPageScrollArea->setFrameShape(QFrame::NoFrame);
|
m_secuPageScrollArea->setFrameShape(QFrame::NoFrame);
|
||||||
m_secuPageScrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
m_secuPageScrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
m_secuPageScrollArea->setWidget(securityPage);
|
m_secuPageScrollArea->setWidget(securityPage);
|
||||||
|
|
||||||
|
m_secuPageScrollArea->setWidgetResizable(true);
|
||||||
|
|
||||||
|
m_ipv4ScrollArea = new QScrollArea(centerWidget);
|
||||||
|
m_ipv4ScrollArea->setFixedWidth(SCRO_WIDTH);
|
||||||
|
m_ipv4ScrollArea->setFrameShape(QFrame::NoFrame);
|
||||||
|
m_ipv4ScrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
|
m_ipv4ScrollArea->setWidget(ipv4Page);
|
||||||
|
m_ipv4ScrollArea->setWidgetResizable(true);
|
||||||
|
|
||||||
|
m_ipv6ScrollArea = new QScrollArea(centerWidget);
|
||||||
|
m_ipv6ScrollArea->setFixedWidth(SCRO_WIDTH);
|
||||||
|
m_ipv6ScrollArea->setFrameShape(QFrame::NoFrame);
|
||||||
|
m_ipv6ScrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
|
m_ipv6ScrollArea->setWidget(ipv6Page);
|
||||||
|
m_ipv6ScrollArea->setWidgetResizable(true);
|
||||||
|
|
||||||
QPalette pal = m_secuPageScrollArea->palette();
|
QPalette pal = m_secuPageScrollArea->palette();
|
||||||
pal.setBrush(QPalette::Base, QColor(0,0,0,0));
|
pal.setBrush(QPalette::Base, QColor(0,0,0,0));
|
||||||
m_secuPageScrollArea->setPalette(pal);
|
m_secuPageScrollArea->setPalette(pal);
|
||||||
|
m_ipv4ScrollArea->setPalette(pal);
|
||||||
|
m_ipv6ScrollArea->setPalette(pal);
|
||||||
|
|
||||||
detailPage->setFixedWidth(SCRO_WIDTH);
|
|
||||||
ipv4Page->setFixedWidth(SCRO_WIDTH);
|
|
||||||
ipv6Page->setFixedWidth(SCRO_WIDTH);
|
|
||||||
createNetPage->setFixedWidth(SCRO_WIDTH);
|
|
||||||
configPage->setFixedWidth(SCRO_WIDTH);
|
|
||||||
|
|
||||||
stackWidget = new QStackedWidget(centerWidget);
|
stackWidget = new QStackedWidget(centerWidget);
|
||||||
stackWidget->addWidget(detailPage);
|
stackWidget->addWidget(detailPage);
|
||||||
stackWidget->addWidget(ipv4Page);
|
stackWidget->addWidget(m_ipv4ScrollArea);
|
||||||
stackWidget->addWidget(ipv6Page);
|
stackWidget->addWidget(m_ipv6ScrollArea);
|
||||||
stackWidget->addWidget(m_secuPageScrollArea);
|
stackWidget->addWidget(m_secuPageScrollArea);
|
||||||
stackWidget->addWidget(configPage);
|
stackWidget->addWidget(configPage);
|
||||||
stackWidget->addWidget(createNetPage);
|
stackWidget->addWidget(createNetPage);
|
||||||
|
|
||||||
mainLayout->addWidget(centerWidget);
|
|
||||||
mainLayout->addWidget(bottomWidget);
|
|
||||||
|
|
||||||
bottomWidget->setMinimumHeight(PAGE_MIN_HEIGHT);
|
|
||||||
|
|
||||||
pageFrame = new QFrame(this);
|
|
||||||
QHBoxLayout *pageLayout = new QHBoxLayout(pageFrame);
|
|
||||||
// pageLayout->setSpacing(PAGE_LAYOUT_SPACING);
|
|
||||||
|
|
||||||
// TabBar
|
// TabBar
|
||||||
onPaletteChanged();
|
onPaletteChanged();
|
||||||
m_networkMode = NetworkModeType(NetworkModeConfig::getInstance()->getNetworkModeConfig(m_uuid));
|
m_networkMode = NetworkModeType(NetworkModeConfig::getInstance()->getNetworkModeConfig(m_uuid));
|
||||||
|
@ -351,9 +364,6 @@ void NetDetail::initUI()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pageLayout->addWidget(m_netTabBar, Qt::AlignCenter);
|
|
||||||
pageLayout->addSpacing(24);
|
|
||||||
|
|
||||||
// TabBar关联选项卡页面
|
// TabBar关联选项卡页面
|
||||||
connect(m_netTabBar, SIGNAL(currentChanged(int)), this, SLOT(currentRowChangeSlot(int)));
|
connect(m_netTabBar, SIGNAL(currentChanged(int)), this, SLOT(currentRowChangeSlot(int)));
|
||||||
setNetTabToolTip();
|
setNetTabToolTip();
|
||||||
|
@ -366,10 +376,12 @@ void NetDetail::initUI()
|
||||||
|
|
||||||
forgetBtn = new QPushButton(this);
|
forgetBtn = new QPushButton(this);
|
||||||
|
|
||||||
|
QHBoxLayout *pageLayout = new QHBoxLayout(pageFrame);
|
||||||
|
pageLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
pageLayout->addWidget(m_netTabBar, Qt::AlignCenter);
|
||||||
|
|
||||||
QVBoxLayout *centerlayout = new QVBoxLayout(centerWidget);
|
QVBoxLayout *centerlayout = new QVBoxLayout(centerWidget);
|
||||||
centerlayout->setContentsMargins(CENTER_LAYOUT_MARGINS); // 右边距为0,为安全页滚动区域留出空间
|
centerlayout->setContentsMargins(CENTER_LAYOUT_MARGINS); // 右边距为0,为安全页滚动区域留出空间
|
||||||
centerlayout->addWidget(pageFrame);
|
|
||||||
centerlayout->addSpacing(4);
|
|
||||||
centerlayout->addWidget(stackWidget);
|
centerlayout->addWidget(stackWidget);
|
||||||
|
|
||||||
QHBoxLayout *bottomLayout = new QHBoxLayout(bottomWidget);
|
QHBoxLayout *bottomLayout = new QHBoxLayout(bottomWidget);
|
||||||
|
@ -379,11 +391,13 @@ void NetDetail::initUI()
|
||||||
bottomLayout->addStretch();
|
bottomLayout->addStretch();
|
||||||
bottomLayout->addWidget(cancelBtn);
|
bottomLayout->addWidget(cancelBtn);
|
||||||
bottomLayout->addWidget(confimBtn);
|
bottomLayout->addWidget(confimBtn);
|
||||||
|
bottomWidget->setMinimumHeight(PAGE_MIN_HEIGHT);
|
||||||
|
|
||||||
|
mainLayout->addWidget(pageFrame);
|
||||||
|
mainLayout->addWidget(centerWidget);
|
||||||
|
mainLayout->addWidget(bottomWidget);
|
||||||
|
|
||||||
// QPalette pal(this->palette());
|
|
||||||
// pal.setColor(QPalette::Background, qApp->palette().base().color());
|
|
||||||
this->setAutoFillBackground(true);
|
this->setAutoFillBackground(true);
|
||||||
// this->setPalette(pal);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetDetail::loadPage()
|
void NetDetail::loadPage()
|
||||||
|
@ -446,13 +460,6 @@ void NetDetail::initComponent()
|
||||||
setConfirmEnable();
|
setConfirmEnable();
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(securityPage, &SecurityPage::secuTypeChanged, this, [=]() {
|
|
||||||
setSecuPageHeight();
|
|
||||||
});
|
|
||||||
connect(securityPage, &SecurityPage::eapTypeChanged, this, [=]() {
|
|
||||||
setSecuPageHeight();
|
|
||||||
});
|
|
||||||
|
|
||||||
const QByteArray id(THEME_SCHAME);
|
const QByteArray id(THEME_SCHAME);
|
||||||
if(QGSettings::isSchemaInstalled(id)){
|
if(QGSettings::isSchemaInstalled(id)){
|
||||||
QGSettings * fontSetting = new QGSettings(id, QByteArray(), this);
|
QGSettings * fontSetting = new QGSettings(id, QByteArray(), this);
|
||||||
|
@ -746,22 +753,6 @@ void NetDetail::initSecuData()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetDetail::setSecuPageHeight()
|
|
||||||
{
|
|
||||||
KySecuType secuType;
|
|
||||||
KyEapMethodType eapType;
|
|
||||||
securityPage->getSecuType(secuType, eapType);
|
|
||||||
if (secuType == WPA_AND_WPA2_ENTERPRISE) {
|
|
||||||
if (eapType == TLS) {
|
|
||||||
securityPage->setFixedSize(SCRO_WIDTH, TLS_SCRO_HEIGHT);
|
|
||||||
} else {
|
|
||||||
securityPage->setFixedSize(SCRO_WIDTH, PEAP_SCRO_HEIGHT);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
securityPage->setFixedSize(SCRO_WIDTH, PEAP_SCRO_HEIGHT);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void NetDetail::initTlsInfo(ConInfo &conInfo)
|
void NetDetail::initTlsInfo(ConInfo &conInfo)
|
||||||
{
|
{
|
||||||
m_resource->getEnterPriseInfoTls(m_uuid, conInfo.tlsInfo);
|
m_resource->getEnterPriseInfoTls(m_uuid, conInfo.tlsInfo);
|
||||||
|
@ -1215,13 +1206,17 @@ NetTabBar::~NetTabBar()
|
||||||
|
|
||||||
QSize NetTabBar::sizeHint() const
|
QSize NetTabBar::sizeHint() const
|
||||||
{
|
{
|
||||||
return QSize(TAB_WIDTH, TAB_HEIGHT);
|
QSize size = KTabBar::sizeHint();
|
||||||
|
size.setWidth(TAB_WIDTH);
|
||||||
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize NetTabBar::minimumTabSizeHint(int index) const
|
QSize NetTabBar::minimumTabSizeHint(int index) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(index)
|
Q_UNUSED(index)
|
||||||
return QSize(TAB_WIDTH, TAB_HEIGHT);
|
QSize size = KTabBar::minimumTabSizeHint(index);
|
||||||
|
size.setWidth(TAB_WIDTH);
|
||||||
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ using namespace kdk;
|
||||||
|
|
||||||
#define TAB_WIDTH 60
|
#define TAB_WIDTH 60
|
||||||
#define TAB_HEIGHT 36
|
#define TAB_HEIGHT 36
|
||||||
|
#define TAB_HEIGHT_TABLET 48
|
||||||
|
|
||||||
class NetTabBar : public KTabBar
|
class NetTabBar : public KTabBar
|
||||||
{
|
{
|
||||||
|
@ -64,7 +65,7 @@ class NetTabBar : public KTabBar
|
||||||
public:
|
public:
|
||||||
explicit NetTabBar(QWidget *parent = nullptr);
|
explicit NetTabBar(QWidget *parent = nullptr);
|
||||||
~NetTabBar();
|
~NetTabBar();
|
||||||
|
protected:
|
||||||
QSize sizeHint() const;
|
QSize sizeHint() const;
|
||||||
QSize minimumTabSizeHint(int index) const;
|
QSize minimumTabSizeHint(int index) const;
|
||||||
};
|
};
|
||||||
|
@ -109,7 +110,6 @@ private:
|
||||||
void loadPage();
|
void loadPage();
|
||||||
void pagePadding(QString netName, bool isWlan);
|
void pagePadding(QString netName, bool isWlan);
|
||||||
void initSecuData();
|
void initSecuData();
|
||||||
void setSecuPageHeight();
|
|
||||||
|
|
||||||
void initTlsInfo(ConInfo &conInfo);
|
void initTlsInfo(ConInfo &conInfo);
|
||||||
void initPeapInfo(ConInfo &conInfo);
|
void initPeapInfo(ConInfo &conInfo);
|
||||||
|
@ -166,6 +166,8 @@ private:
|
||||||
QWidget * centerWidget;
|
QWidget * centerWidget;
|
||||||
QWidget * bottomWidget;
|
QWidget * bottomWidget;
|
||||||
QScrollArea * m_secuPageScrollArea;
|
QScrollArea * m_secuPageScrollArea;
|
||||||
|
QScrollArea * m_ipv4ScrollArea;
|
||||||
|
QScrollArea * m_ipv6ScrollArea;
|
||||||
|
|
||||||
QPushButton * cancelBtn;
|
QPushButton * cancelBtn;
|
||||||
QPushButton * forgetBtn;
|
QPushButton * forgetBtn;
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
#define DETAIL_MIN_LABEL_WIDTH 80
|
#define DETAIL_MIN_LABEL_WIDTH 80
|
||||||
#define DETAIL_MIN_EDIT_WIDTH 390
|
#define DETAIL_MIN_EDIT_WIDTH 390
|
||||||
#define MIN_LABEL_WIDTH 146
|
#define MIN_LABEL_WIDTH 146
|
||||||
#define MIN_EDIT_WIDTH 278
|
#define MIN_EDIT_WIDTH 286
|
||||||
|
|
||||||
SecurityPage::SecurityPage(bool isNetDetailPage, QWidget *parent) : isDetailPage(isNetDetailPage), QFrame(parent)
|
SecurityPage::SecurityPage(bool isNetDetailPage, QWidget *parent) : isDetailPage(isNetDetailPage), QFrame(parent)
|
||||||
{
|
{
|
||||||
|
@ -84,14 +84,6 @@ void SecurityPage::initUI()
|
||||||
userPwdEdit->setUseCustomPalette(true);
|
userPwdEdit->setUseCustomPalette(true);
|
||||||
userPwdFlagBox = new QCheckBox(this);
|
userPwdFlagBox = new QCheckBox(this);
|
||||||
|
|
||||||
//FAST
|
|
||||||
m_pacCheckBox = new QCheckBox(this);
|
|
||||||
m_pacProvisionComboBox = new QComboBox(this);
|
|
||||||
m_pacFilePathComboBox = new QComboBox(this);
|
|
||||||
m_pacProvisionLabel = new FixLabel(this);
|
|
||||||
m_pacFlagLabel = new FixLabel(this);
|
|
||||||
m_pacFileLabel = new QLabel(this);
|
|
||||||
|
|
||||||
QWidget *queryWidget = new QWidget(this);
|
QWidget *queryWidget = new QWidget(this);
|
||||||
QHBoxLayout *queryLayout = new QHBoxLayout(queryWidget);
|
QHBoxLayout *queryLayout = new QHBoxLayout(queryWidget);
|
||||||
queryLayout->setContentsMargins(0, 0, 0, 0);
|
queryLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
@ -99,6 +91,15 @@ void SecurityPage::initUI()
|
||||||
queryLayout->addWidget(userPwdFlagLabel);
|
queryLayout->addWidget(userPwdFlagLabel);
|
||||||
queryLayout->addStretch();
|
queryLayout->addStretch();
|
||||||
|
|
||||||
|
//FAST
|
||||||
|
m_pacCheckBox = new QCheckBox(this);
|
||||||
|
m_pacProvisionComboBox = new QComboBox(this);
|
||||||
|
m_pacFilePathComboBox = new QComboBox(this);
|
||||||
|
m_pacProvisionLabel = new FixLabel(this);
|
||||||
|
m_pacProvisionLabel->setFixedWidth(MIN_LABEL_WIDTH);
|
||||||
|
m_pacFlagLabel = new FixLabel(this);
|
||||||
|
m_pacFileLabel = new QLabel(this);
|
||||||
|
|
||||||
//记住该网络复选框
|
//记住该网络复选框
|
||||||
m_emptyLabel = new QLabel(this);
|
m_emptyLabel = new QLabel(this);
|
||||||
m_emptyLabel->setMinimumWidth(MIN_LABEL_WIDTH - 8);
|
m_emptyLabel->setMinimumWidth(MIN_LABEL_WIDTH - 8);
|
||||||
|
@ -114,22 +115,15 @@ void SecurityPage::initUI()
|
||||||
rememberLayout->addWidget(m_checkLabel);
|
rememberLayout->addWidget(m_checkLabel);
|
||||||
rememberLayout->addStretch();
|
rememberLayout->addStretch();
|
||||||
|
|
||||||
// mSecuLayout = new QFormLayout(this);
|
//允许自动PAC配置复选框
|
||||||
// mSecuLayout->setContentsMargins(0, 0, 0, 0);
|
m_pacCheckWidget = new QWidget(this);
|
||||||
// mSecuLayout->addRow(secuTypeLabel, secuTypeCombox);
|
QGridLayout *pacCheckLayout = new QGridLayout(m_pacCheckWidget);
|
||||||
// mSecuLayout->addRow(pwdLabel, pwdEdit);
|
pacCheckLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
// mSecuLayout->addRow(eapTypeLabel, eapTypeCombox);
|
pacCheckLayout->setVerticalSpacing(0);
|
||||||
// mSecuLayout->addRow(identityLable, identityEdit);
|
pacCheckLayout->setColumnMinimumWidth(0, 16);
|
||||||
// mSecuLayout->addRow(domainLable, domainEdit);
|
pacCheckLayout->addWidget(m_pacProvisionComboBox, 0, 0, 1, 2);
|
||||||
// mSecuLayout->addRow(caCertPathLabel, caCertPathCombox);
|
pacCheckLayout->addWidget(m_pacCheckBox, 1, 0);
|
||||||
// mSecuLayout->addRow(caNeedBox, caNeedFlagLabel);
|
pacCheckLayout->addWidget(m_pacFlagLabel, 1, 1);
|
||||||
// mSecuLayout->addRow(clientCertPathLabel, clientCertPathCombox);
|
|
||||||
// mSecuLayout->addRow(clientPrivateKeyLabel, clientPrivateKeyCombox);
|
|
||||||
// mSecuLayout->addRow(clientPrivateKeyPwdLabel,clientPrivateKeyPwdEdit);
|
|
||||||
// mSecuLayout->addRow(eapMethodLabel, eapMethodCombox);
|
|
||||||
// mSecuLayout->addRow(userNameLabel, userNameEdit);
|
|
||||||
// mSecuLayout->addRow(userPwdLabel, userPwdEdit);
|
|
||||||
// mSecuLayout->addRow(userPwdFlagBox, userPwdFlagLabel);
|
|
||||||
|
|
||||||
topLayout = new QGridLayout();
|
topLayout = new QGridLayout();
|
||||||
topLayout->setContentsMargins(0, 0, 0, 0);
|
topLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
@ -143,27 +137,24 @@ void SecurityPage::initUI()
|
||||||
// EAP认证 Label和选项框 第2行,第0列,第1列
|
// EAP认证 Label和选项框 第2行,第0列,第1列
|
||||||
topLayout->addWidget(eapTypeLabel, 2, 0);
|
topLayout->addWidget(eapTypeLabel, 2, 0);
|
||||||
topLayout->addWidget(eapTypeCombox, 2, 1);
|
topLayout->addWidget(eapTypeCombox, 2, 1);
|
||||||
// EAP认证 Label和选项框 第3行,第0列,第1列
|
// 匿名身份 Label和输入框 第3行,第0列,第1列
|
||||||
topLayout->addWidget(m_pacProvisionLabel, 3, 0);
|
topLayout->addWidget(identityLable, 3, 0);
|
||||||
topLayout->addWidget(m_pacProvisionComboBox, 3, 1);
|
topLayout->addWidget(identityEdit, 3, 1);
|
||||||
// pac CheckBox和Label 第4行,第0列,第1列
|
//PAC配置 允许自动PAC配置 第4行,第0列;第4行,第1列,占2行1列
|
||||||
topLayout->addWidget(m_pacCheckBox, 4, 0);
|
topLayout->addWidget(m_pacProvisionLabel, 4, 0, Qt::AlignTop);
|
||||||
topLayout->addWidget(m_pacFlagLabel, 4, 1);
|
topLayout->addWidget(m_pacCheckWidget, 4, 1);
|
||||||
// EAP认证 Label和选项框 第5行,第0列,第1列
|
// PAC文件
|
||||||
topLayout->addWidget(m_pacFileLabel, 5, 0);
|
topLayout->addWidget(m_pacFileLabel, 6, 0);
|
||||||
topLayout->addWidget(m_pacFilePathComboBox, 5, 1);
|
topLayout->addWidget(m_pacFilePathComboBox, 6, 1);
|
||||||
//内部认证 Label和选项框 第6行,第0列,第1列
|
//内部认证 Label和选项框
|
||||||
topLayout->addWidget(eapMethodLabel, 6, 0);
|
topLayout->addWidget(eapMethodLabel, 7, 0);
|
||||||
topLayout->addWidget(eapMethodCombox, 6, 1);
|
topLayout->addWidget(eapMethodCombox, 7, 1);
|
||||||
//用户名 Label和输入框 第7行,第0列,第1列
|
//用户名 Label和输入框
|
||||||
topLayout->addWidget(userNameLabel, 7, 0);
|
topLayout->addWidget(userNameLabel, 8, 0);
|
||||||
topLayout->addWidget(userNameEdit, 7, 1);
|
topLayout->addWidget(userNameEdit, 8, 1);
|
||||||
//密码 Label和密码框 第8行,第0列,第1列
|
//密码 Label和密码框
|
||||||
topLayout->addWidget(userPwdLabel, 8, 0);
|
topLayout->addWidget(userPwdLabel, 9, 0);
|
||||||
topLayout->addWidget(userPwdEdit, 8, 1);
|
topLayout->addWidget(userPwdEdit, 9, 1);
|
||||||
// 匿名身份 Label和输入框 第9行,第0列,第1列
|
|
||||||
topLayout->addWidget(identityLable, 9, 0);
|
|
||||||
topLayout->addWidget(identityEdit, 9, 1);
|
|
||||||
|
|
||||||
|
|
||||||
// CA证书选项框及CheckBox布局
|
// CA证书选项框及CheckBox布局
|
||||||
|
@ -205,14 +196,16 @@ void SecurityPage::initUI()
|
||||||
checkWidget->hide();
|
checkWidget->hide();
|
||||||
topLayout->addWidget(queryWidget, 10, 1);
|
topLayout->addWidget(queryWidget, 10, 1);
|
||||||
changeColumnWidthWithSecuType();
|
changeColumnWidthWithSecuType();
|
||||||
|
m_pacFlagLabel->setMinimumWidth(MIN_EDIT_WIDTH);
|
||||||
} else {
|
} else {
|
||||||
queryWidget->hide();
|
queryWidget->hide();
|
||||||
topLayout->setColumnMinimumWidth(0, MIN_LABEL_WIDTH);
|
topLayout->setColumnMinimumWidth(0, MIN_LABEL_WIDTH);
|
||||||
topLayout->setColumnMinimumWidth(1, MIN_EDIT_WIDTH);
|
topLayout->setColumnMinimumWidth(1, MIN_EDIT_WIDTH);
|
||||||
bottomLayout->setColumnMinimumWidth(0, MIN_LABEL_WIDTH - 8);
|
bottomLayout->setColumnMinimumWidth(0, MIN_LABEL_WIDTH - 8);
|
||||||
|
m_pacFlagLabel->setMinimumWidth(MIN_EDIT_WIDTH - 36);
|
||||||
}
|
}
|
||||||
|
|
||||||
topLayout->addWidget(tlsWidget, 7, 0, 6, 2);
|
topLayout->addWidget(tlsWidget, 10, 0, 6, 2);
|
||||||
|
|
||||||
mainLayout->setContentsMargins(0, 0, 0, 0);
|
mainLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
mainLayout->setSpacing(0);
|
mainLayout->setSpacing(0);
|
||||||
|
@ -268,18 +261,6 @@ void SecurityPage::initUI()
|
||||||
clientPrivateKeyCombox->addItem(tr("None"), QString(tr("None"))); //无
|
clientPrivateKeyCombox->addItem(tr("None"), QString(tr("None"))); //无
|
||||||
clientPrivateKeyCombox->addItem(tr("Choose from file..."), QString(tr("Choose from file..."))); //从文件中选择...
|
clientPrivateKeyCombox->addItem(tr("Choose from file..."), QString(tr("Choose from file..."))); //从文件中选择...
|
||||||
|
|
||||||
//FAST
|
|
||||||
m_pacCheckBox->setChecked(true);
|
|
||||||
m_pacProvisionLabel->setText(tr("PAC provisioning")); //PAC配置
|
|
||||||
m_pacFlagLabel->setText(tr("Allow automatic PAC provisioning")); //允许自动PAC配置
|
|
||||||
m_pacFileLabel->setText(tr("PAC file")); //PAC文件
|
|
||||||
m_pacProvisionComboBox->addItem(tr("Anonymous"), ANON); //匿名
|
|
||||||
m_pacProvisionComboBox->addItem(tr("Authenticated"), AUTHEN); //已认证
|
|
||||||
m_pacProvisionComboBox->addItem(tr("Both"), BOTH); //两者兼用
|
|
||||||
m_pacProvisionComboBox->setCurrentIndex(ANON);
|
|
||||||
m_pacFilePathComboBox->addItem(tr("None"), QString(tr("None"))); //无
|
|
||||||
m_pacFilePathComboBox->addItem(tr("Choose from file..."), QString(tr("Choose from file..."))); //从文件中选择...
|
|
||||||
|
|
||||||
//仅为该用户存储密码
|
//仅为该用户存储密码
|
||||||
pwdOptionCombox->addItem(tr("Store passwords only for this user"), QString(tr("Store password only for this user")));
|
pwdOptionCombox->addItem(tr("Store passwords only for this user"), QString(tr("Store password only for this user")));
|
||||||
//存储所有用户的密码
|
//存储所有用户的密码
|
||||||
|
@ -288,6 +269,18 @@ void SecurityPage::initUI()
|
||||||
pwdOptionCombox->addItem(tr("Ask this password every time"), QString(tr("Ask password every time")));
|
pwdOptionCombox->addItem(tr("Ask this password every time"), QString(tr("Ask password every time")));
|
||||||
pwdOptionCombox->setCurrentIndex(1);
|
pwdOptionCombox->setCurrentIndex(1);
|
||||||
|
|
||||||
|
//FAST
|
||||||
|
m_pacCheckBox->setChecked(true);
|
||||||
|
m_pacProvisionLabel->setLabelText(tr("PAC provisioning")); //PAC配置
|
||||||
|
m_pacFlagLabel->setLabelText(tr("Allow automatic PAC provisioning")); //允许自动PAC配置
|
||||||
|
m_pacFileLabel->setText(tr("PAC file")); //PAC文件
|
||||||
|
m_pacProvisionComboBox->addItem(tr("Anonymous"), ANON); //匿名
|
||||||
|
m_pacProvisionComboBox->addItem(tr("Authenticated"), AUTHEN); //已认证
|
||||||
|
m_pacProvisionComboBox->addItem(tr("Both"), BOTH); //两者兼用
|
||||||
|
m_pacProvisionComboBox->setCurrentIndex(ANON);
|
||||||
|
m_pacFilePathComboBox->addItem(tr("None"), QString(tr("None"))); //无
|
||||||
|
m_pacFilePathComboBox->addItem(tr("Choose from file..."), QString(tr("Choose from file..."))); //从文件中选择...
|
||||||
|
|
||||||
//禁用ClearBtn按钮
|
//禁用ClearBtn按钮
|
||||||
pwdEdit->setClearButtonEnabled(false);
|
pwdEdit->setClearButtonEnabled(false);
|
||||||
clientPrivateKeyPwdEdit->setClearButtonEnabled(false);
|
clientPrivateKeyPwdEdit->setClearButtonEnabled(false);
|
||||||
|
@ -305,13 +298,13 @@ void SecurityPage::initUI()
|
||||||
void SecurityPage::initConnect()
|
void SecurityPage::initConnect()
|
||||||
{
|
{
|
||||||
//安全类型变化
|
//安全类型变化
|
||||||
// connect(secuTypeCombox, &QComboBox::currentTextChanged, this, &SecurityPage::onSecuTypeComboxIndexChanged);
|
// connect(secuTypeCombox, &QComboBox::currentTextChanged, this, &SecurityPage::onSecuTypeComboxIndexChanged);
|
||||||
connect(secuTypeCombox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SecurityPage::onSecuTypeComboxIndexChanged);
|
connect(secuTypeCombox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SecurityPage::onSecuTypeComboxIndexChanged);
|
||||||
|
|
||||||
connect(secuTypeCombox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SecurityPage::changeColumnWidthWithSecuType);
|
connect(secuTypeCombox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SecurityPage::changeColumnWidthWithSecuType);
|
||||||
|
|
||||||
//EAP方式变化
|
//EAP方式变化
|
||||||
// connect(eapTypeCombox, &QComboBox::currentTextChanged, this, &SecurityPage::onEapTypeComboxIndexChanged);
|
// connect(eapTypeCombox, &QComboBox::currentTextChanged, this, &SecurityPage::onEapTypeComboxIndexChanged);
|
||||||
connect(eapTypeCombox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SecurityPage::onEapTypeComboxIndexChanged);
|
connect(eapTypeCombox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SecurityPage::onEapTypeComboxIndexChanged);
|
||||||
|
|
||||||
connect(caNeedBox, &QCheckBox::clicked, this, &SecurityPage::onCaNeedBoxClicked);
|
connect(caNeedBox, &QCheckBox::clicked, this, &SecurityPage::onCaNeedBoxClicked);
|
||||||
|
@ -490,22 +483,28 @@ void SecurityPage::setFastInfo(KyEapMethodFastInfo &info)
|
||||||
onEapTypeComboxIndexChanged();
|
onEapTypeComboxIndexChanged();
|
||||||
|
|
||||||
identityEdit->setText(info.m_anonIdentity);
|
identityEdit->setText(info.m_anonIdentity);
|
||||||
if (info.m_pacProvisioning == KyFastProvisioningAllowUnauthenticated) {
|
m_pacCheckBox->setChecked(false);
|
||||||
|
m_pacProvisionComboBox->setCurrentIndex(ANON);
|
||||||
|
if (info.m_pacProvisioning == KyFastProvisioningDisabled) {
|
||||||
|
m_pacCheckBox->setChecked(false);
|
||||||
|
m_pacProvisionComboBox->setCurrentIndex(ANON);
|
||||||
|
m_pacProvisionComboBox->setEnabled(false);
|
||||||
|
} else if (info.m_pacProvisioning == KyFastProvisioningAllowUnauthenticated) {
|
||||||
m_pacProvisionComboBox->setCurrentIndex(ANON);
|
m_pacProvisionComboBox->setCurrentIndex(ANON);
|
||||||
} else if (info.m_pacProvisioning == KyFastProvisioningAllowAuthenticated) {
|
} else if (info.m_pacProvisioning == KyFastProvisioningAllowAuthenticated) {
|
||||||
m_pacProvisionComboBox->setCurrentIndex(AUTHEN);
|
m_pacProvisionComboBox->setCurrentIndex(AUTHEN);
|
||||||
} else if (info.m_pacProvisioning == KyFastProvisioningAllowBoth) {
|
} else if (info.m_pacProvisioning == KyFastProvisioningAllowBoth) {
|
||||||
m_pacProvisionComboBox->setCurrentIndex(BOTH);
|
m_pacProvisionComboBox->setCurrentIndex(BOTH);
|
||||||
|
} else {
|
||||||
|
qWarning() << "Unknown fastProvisioning type" << Q_FUNC_INFO << __LINE__;
|
||||||
|
m_pacCheckBox->setChecked(false);
|
||||||
|
m_pacProvisionComboBox->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info.m_pacFilePath.isEmpty()) {
|
if (info.m_pacFilePath.isEmpty()) {
|
||||||
m_pacFilePathComboBox->setItemText(0, QString(tr("None")));
|
m_pacFilePathComboBox->setItemText(0, QString(tr("None")));
|
||||||
m_pacCheckBox->setChecked(true);
|
|
||||||
m_pacFilePathComboBox->setEnabled(false);
|
|
||||||
} else {
|
} else {
|
||||||
m_pacFilePathComboBox->setItemText(0, info.m_pacFilePath);
|
m_pacFilePathComboBox->setItemText(0, info.m_pacFilePath);
|
||||||
m_pacCheckBox->setChecked(false);
|
|
||||||
m_pacFilePathComboBox->setEnabled(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info.m_authMethod == KyAuthMethodGtc) {
|
if (info.m_authMethod == KyAuthMethodGtc) {
|
||||||
|
@ -611,7 +610,7 @@ bool SecurityPage::checkIsChanged(const ConInfo info)
|
||||||
if (info.secType == NONE) {
|
if (info.secType == NONE) {
|
||||||
return false;
|
return false;
|
||||||
} else if (info.secType == WPA_AND_WPA2_PERSONAL || info.secType == WPA3_PERSONAL) {
|
} else if (info.secType == WPA_AND_WPA2_PERSONAL || info.secType == WPA3_PERSONAL) {
|
||||||
return !(info.strPassword == pwdEdit->text());
|
return !(info.strPassword == pwdEdit->text());
|
||||||
} else {
|
} else {
|
||||||
if (info.enterpriseType != eapTypeCombox->currentData().toInt()) {
|
if (info.enterpriseType != eapTypeCombox->currentData().toInt()) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -659,12 +658,10 @@ void SecurityPage::showNone()
|
||||||
userPwdFlagLabel->hide();
|
userPwdFlagLabel->hide();
|
||||||
|
|
||||||
//FAST
|
//FAST
|
||||||
m_pacCheckBox->hide();
|
|
||||||
m_pacProvisionComboBox->hide();
|
|
||||||
m_pacFilePathComboBox->hide();
|
|
||||||
m_pacProvisionLabel->hide();
|
m_pacProvisionLabel->hide();
|
||||||
m_pacFlagLabel->hide();
|
m_pacCheckWidget->hide();
|
||||||
m_pacFileLabel->hide();
|
m_pacFileLabel->hide();
|
||||||
|
m_pacFilePathComboBox->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SecurityPage::showPsk()
|
void SecurityPage::showPsk()
|
||||||
|
@ -692,12 +689,10 @@ void SecurityPage::showPsk()
|
||||||
userPwdFlagLabel->hide();
|
userPwdFlagLabel->hide();
|
||||||
|
|
||||||
//FAST
|
//FAST
|
||||||
m_pacCheckBox->hide();
|
|
||||||
m_pacProvisionComboBox->hide();
|
|
||||||
m_pacFilePathComboBox->hide();
|
|
||||||
m_pacProvisionLabel->hide();
|
m_pacProvisionLabel->hide();
|
||||||
m_pacFlagLabel->hide();
|
m_pacCheckWidget->hide();
|
||||||
m_pacFileLabel->hide();
|
m_pacFileLabel->hide();
|
||||||
|
m_pacFilePathComboBox->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SecurityPage::showTls()
|
void SecurityPage::showTls()
|
||||||
|
@ -724,12 +719,10 @@ void SecurityPage::showTls()
|
||||||
userPwdFlagLabel->hide();
|
userPwdFlagLabel->hide();
|
||||||
|
|
||||||
//FAST
|
//FAST
|
||||||
m_pacCheckBox->hide();
|
|
||||||
m_pacProvisionComboBox->hide();
|
|
||||||
m_pacFilePathComboBox->hide();
|
|
||||||
m_pacProvisionLabel->hide();
|
m_pacProvisionLabel->hide();
|
||||||
m_pacFlagLabel->hide();
|
m_pacCheckWidget->hide();
|
||||||
m_pacFileLabel->hide();
|
m_pacFileLabel->hide();
|
||||||
|
m_pacFilePathComboBox->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SecurityPage::showPeapOrTtls()
|
void SecurityPage::showPeapOrTtls()
|
||||||
|
@ -746,14 +739,6 @@ void SecurityPage::showPeapOrTtls()
|
||||||
identityEdit->hide();
|
identityEdit->hide();
|
||||||
tlsWidget->hide();
|
tlsWidget->hide();
|
||||||
|
|
||||||
//FAST
|
|
||||||
m_pacCheckBox->hide();
|
|
||||||
m_pacProvisionComboBox->hide();
|
|
||||||
m_pacFilePathComboBox->hide();
|
|
||||||
m_pacProvisionLabel->hide();
|
|
||||||
m_pacFlagLabel->hide();
|
|
||||||
m_pacFileLabel->hide();
|
|
||||||
|
|
||||||
//PEAP TTLS共有
|
//PEAP TTLS共有
|
||||||
eapMethodLabel->show();
|
eapMethodLabel->show();
|
||||||
userNameLabel->show();
|
userNameLabel->show();
|
||||||
|
@ -764,96 +749,74 @@ void SecurityPage::showPeapOrTtls()
|
||||||
userNameEdit->show();
|
userNameEdit->show();
|
||||||
userPwdEdit->show();
|
userPwdEdit->show();
|
||||||
userPwdFlagLabel->show();
|
userPwdFlagLabel->show();
|
||||||
|
|
||||||
|
//FAST
|
||||||
|
m_pacProvisionLabel->hide();
|
||||||
|
m_pacCheckWidget->hide();
|
||||||
|
m_pacFileLabel->hide();
|
||||||
|
m_pacFilePathComboBox->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SecurityPage::showLeapOrPwd()
|
void SecurityPage::showLeapOrPwd()
|
||||||
{
|
{
|
||||||
pwdEdit->hide();
|
|
||||||
eapTypeCombox->show();
|
|
||||||
|
|
||||||
identityEdit->hide();
|
|
||||||
domainEdit->hide();
|
|
||||||
caCertPathCombox->hide();
|
|
||||||
caNeedBox->hide();
|
|
||||||
clientCertPathCombox->hide();
|
|
||||||
clientPrivateKeyCombox->hide();
|
|
||||||
clientPrivateKeyPwdEdit->hide();
|
|
||||||
|
|
||||||
eapMethodCombox->hide();
|
|
||||||
userNameEdit->show();
|
|
||||||
userPwdEdit->show();
|
|
||||||
userPwdFlagBox->show();
|
|
||||||
|
|
||||||
pwdLabel->hide();
|
pwdLabel->hide();
|
||||||
|
pwdEdit->hide();
|
||||||
|
|
||||||
//企业wifi共有
|
//企业wifi共有
|
||||||
eapTypeLabel->show();
|
eapTypeLabel->show();
|
||||||
|
eapTypeCombox->show();
|
||||||
|
|
||||||
//TLS
|
//TLS
|
||||||
identityLable->hide();
|
identityLable->hide();
|
||||||
domainLable->hide();
|
identityEdit->hide();
|
||||||
caCertPathLabel->hide();
|
tlsWidget->hide();
|
||||||
caNeedFlagLabel->hide();
|
|
||||||
clientCertPathLabel->hide();
|
|
||||||
clientPrivateKeyLabel->hide();
|
|
||||||
clientPrivateKeyPwdLabel->hide();
|
|
||||||
|
|
||||||
//PEAP TTLS共有
|
|
||||||
eapMethodLabel->hide();
|
|
||||||
userNameLabel->show();
|
|
||||||
userPwdLabel->show();
|
|
||||||
userPwdFlagLabel->show();
|
|
||||||
|
|
||||||
//FAST
|
//FAST
|
||||||
m_pacCheckBox->hide();
|
|
||||||
m_pacProvisionComboBox->hide();
|
|
||||||
m_pacFilePathComboBox->hide();
|
|
||||||
m_pacProvisionLabel->hide();
|
m_pacProvisionLabel->hide();
|
||||||
m_pacFlagLabel->hide();
|
m_pacCheckWidget->hide();
|
||||||
m_pacFileLabel->hide();
|
m_pacFileLabel->hide();
|
||||||
|
m_pacFilePathComboBox->hide();
|
||||||
|
|
||||||
|
eapMethodLabel->hide();
|
||||||
|
eapMethodCombox->hide();
|
||||||
|
userPwdFlagBox->show();
|
||||||
|
userPwdFlagLabel->show();
|
||||||
|
|
||||||
|
userNameLabel->show();
|
||||||
|
userNameEdit->show();
|
||||||
|
userPwdLabel->show();
|
||||||
|
userPwdEdit->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SecurityPage::showFast()
|
void SecurityPage::showFast()
|
||||||
{
|
{
|
||||||
pwdEdit->hide();
|
|
||||||
eapTypeCombox->show();
|
|
||||||
|
|
||||||
identityEdit->show();
|
|
||||||
domainEdit->hide();
|
|
||||||
caCertPathCombox->hide();
|
|
||||||
caNeedBox->hide();
|
|
||||||
clientCertPathCombox->hide();
|
|
||||||
clientPrivateKeyCombox->hide();
|
|
||||||
clientPrivateKeyPwdEdit->hide();
|
|
||||||
|
|
||||||
eapMethodCombox->show();
|
|
||||||
userNameEdit->show();
|
|
||||||
userPwdEdit->show();
|
|
||||||
userPwdFlagBox->hide();
|
|
||||||
|
|
||||||
pwdLabel->hide();
|
pwdLabel->hide();
|
||||||
|
pwdEdit->hide();
|
||||||
|
|
||||||
//企业wifi共有
|
//企业wifi共有
|
||||||
eapTypeLabel->show();
|
eapTypeLabel->show();
|
||||||
|
eapTypeCombox->show();
|
||||||
|
|
||||||
//TLS
|
//TLS
|
||||||
identityLable->show();
|
identityLable->show();
|
||||||
domainLable->hide();
|
identityEdit->show();
|
||||||
caCertPathLabel->hide();
|
tlsWidget->hide();
|
||||||
caNeedFlagLabel->hide();
|
|
||||||
clientCertPathLabel->hide();
|
|
||||||
clientPrivateKeyLabel->hide();
|
|
||||||
clientPrivateKeyPwdLabel->hide();
|
|
||||||
|
|
||||||
//PEAP TTLS共有
|
|
||||||
eapMethodLabel->show();
|
|
||||||
userNameLabel->show();
|
|
||||||
userPwdLabel->show();
|
|
||||||
userPwdFlagLabel->hide();
|
|
||||||
|
|
||||||
//FAST
|
//FAST
|
||||||
m_pacCheckBox->show();
|
|
||||||
m_pacProvisionComboBox->show();
|
|
||||||
m_pacFilePathComboBox->show();
|
|
||||||
m_pacProvisionLabel->show();
|
m_pacProvisionLabel->show();
|
||||||
m_pacFlagLabel->show();
|
m_pacCheckWidget->show();
|
||||||
m_pacFileLabel->show();
|
m_pacFileLabel->show();
|
||||||
|
m_pacFilePathComboBox->show();
|
||||||
|
|
||||||
|
eapMethodLabel->show();
|
||||||
|
eapMethodCombox->show();
|
||||||
|
userPwdFlagBox->show();
|
||||||
|
userPwdFlagLabel->show();
|
||||||
|
|
||||||
|
userNameLabel->show();
|
||||||
|
userNameEdit->show();
|
||||||
|
userPwdLabel->show();
|
||||||
|
userPwdEdit->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
KyEapMethodTlsInfo SecurityPage::assembleTlsInfo()
|
KyEapMethodTlsInfo SecurityPage::assembleTlsInfo()
|
||||||
|
@ -885,7 +848,7 @@ KyEapMethodTlsInfo SecurityPage::assembleTlsInfo()
|
||||||
KyEapMethodPeapInfo SecurityPage::assemblePeapInfo()
|
KyEapMethodPeapInfo SecurityPage::assemblePeapInfo()
|
||||||
{
|
{
|
||||||
KyEapMethodPeapInfo info;
|
KyEapMethodPeapInfo info;
|
||||||
// info.phase2AuthMethod = (KyNoEapMethodAuth)eapMethodCombox->currentData().toInt();
|
// info.phase2AuthMethod = (KyNoEapMethodAuth)eapMethodCombox->currentData().toInt();
|
||||||
switch (eapMethodCombox->currentIndex()) {
|
switch (eapMethodCombox->currentIndex()) {
|
||||||
case 0:
|
case 0:
|
||||||
info.phase2AuthMethod = KyAuthMethodMschapv2;
|
info.phase2AuthMethod = KyAuthMethodMschapv2;
|
||||||
|
@ -967,37 +930,37 @@ KyEapMethodPwdInfo SecurityPage::assemblePwdInfo()
|
||||||
KyEapMethodFastInfo SecurityPage::assembleFastInfo()
|
KyEapMethodFastInfo SecurityPage::assembleFastInfo()
|
||||||
{
|
{
|
||||||
KyEapMethodFastInfo info;
|
KyEapMethodFastInfo info;
|
||||||
info.m_anonIdentity = identityEdit->text();
|
info.m_anonIdentity = identityEdit->text();
|
||||||
switch (m_pacProvisionComboBox->currentIndex()) {
|
switch (m_pacProvisionComboBox->currentIndex()) {
|
||||||
case ANON:
|
case ANON:
|
||||||
info.m_pacProvisioning = KyFastProvisioningAllowUnauthenticated;
|
info.m_pacProvisioning = KyFastProvisioningAllowUnauthenticated;
|
||||||
break;
|
break;
|
||||||
case AUTHEN:
|
case AUTHEN:
|
||||||
info.m_pacProvisioning = KyFastProvisioningAllowAuthenticated;
|
info.m_pacProvisioning = KyFastProvisioningAllowAuthenticated;
|
||||||
break;
|
break;
|
||||||
case BOTH:
|
case BOTH:
|
||||||
info.m_pacProvisioning = KyFastProvisioningAllowBoth;
|
info.m_pacProvisioning = KyFastProvisioningAllowBoth;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
info.m_allowAutoPacFlag = m_pacCheckBox->isChecked();
|
info.m_allowAutoPacFlag = m_pacCheckBox->isChecked();
|
||||||
info.m_pacFilePath = m_pacFilePathComboBox->currentText();
|
info.m_pacFilePath = m_pacFilePathComboBox->currentText();
|
||||||
|
|
||||||
switch (eapMethodCombox->currentIndex()) {
|
switch (eapMethodCombox->currentIndex()) {
|
||||||
case GTC_FAST:
|
case GTC_FAST:
|
||||||
info.m_authMethod = KyAuthMethodGtc;
|
info.m_authMethod = KyAuthMethodGtc;
|
||||||
break;
|
break;
|
||||||
case MSCHAPV2_FAST:
|
case MSCHAPV2_FAST:
|
||||||
info.m_authMethod = KyAuthMethodMschapv2;
|
info.m_authMethod = KyAuthMethodMschapv2;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
info.m_userName = userNameEdit->text();
|
info.m_userName = userNameEdit->text();
|
||||||
info.m_userPwd = userPwdEdit->text();
|
info.m_userPwd = userPwdEdit->text();
|
||||||
info.m_passwdFlag = (userPwdFlagBox->isChecked() ? NetworkManager::Setting::NotSaved : NetworkManager::Setting::None);
|
info.m_passwdFlag = (userPwdFlagBox->isChecked() ? NetworkManager::Setting::NotSaved : NetworkManager::Setting::None);
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SecurityPage::updateSecurityChange(KyWirelessConnectSetting &setting)
|
void SecurityPage::updateSecurityChange(KyWirelessConnectSetting &setting)
|
||||||
|
@ -1064,13 +1027,11 @@ bool SecurityPage::checkConnectBtnIsEnabled()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (type == FAST) {
|
} else if (type == FAST) {
|
||||||
if (identityEdit->text().isEmpty()) {
|
|
||||||
qDebug() << "fast anonymous identity is empty";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if(!m_pacCheckBox->isChecked()) {
|
if(!m_pacCheckBox->isChecked()) {
|
||||||
qDebug() << "Not allow automatic PAC provisioning ";
|
if (m_pacFilePathComboBox->currentText() == QString(tr("None"))) {
|
||||||
return false;
|
qDebug() << "Not allow automatic PAC provisioning && pac file is empty";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(userNameEdit->text().isEmpty() || userPwdEdit->text().isEmpty()) {
|
if(userNameEdit->text().isEmpty() || userPwdEdit->text().isEmpty()) {
|
||||||
qDebug() << "user name or user password is empty";
|
qDebug() << "user name or user password is empty";
|
||||||
|
@ -1233,6 +1194,39 @@ void SecurityPage::onClientPrivateKeyComboxIndexChanged(QString str)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SecurityPage::onPwdOptionComboxIndexChanged(QString str)
|
||||||
|
{
|
||||||
|
KyEapMethodTlsInfo info;
|
||||||
|
if (str.contains("Store passwords only for this user") || str.contains("仅为该用户存储密码")) {
|
||||||
|
info.m_privateKeyPWDFlag = NetworkManager::Setting::AgentOwned;
|
||||||
|
clientPrivateKeyPwdEdit->setPlaceholderText(emptyhint);
|
||||||
|
} else if (str.contains("Store passwords for all users") || str.contains("存储所有用户的密码")) {
|
||||||
|
info.m_privateKeyPWDFlag = NetworkManager::Setting::None;
|
||||||
|
clientPrivateKeyPwdEdit->setPlaceholderText(hintRequired);
|
||||||
|
} else {
|
||||||
|
info.m_privateKeyPWDFlag = NetworkManager::Setting::NotSaved;
|
||||||
|
clientPrivateKeyPwdEdit->setPlaceholderText(emptyhint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SecurityPage::changeColumnWidthWithSecuType()
|
||||||
|
{
|
||||||
|
if (!isDetailPage) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (secuTypeCombox->currentData().toInt() == WPA_AND_WPA2_ENTERPRISE) {
|
||||||
|
if (eapMethodCombox->currentData().toInt() == TLS || eapMethodCombox->currentData().toInt() == FAST) {
|
||||||
|
topLayout->setColumnMinimumWidth(0, MIN_LABEL_WIDTH);
|
||||||
|
topLayout->setColumnMinimumWidth(1, MIN_EDIT_WIDTH);
|
||||||
|
bottomLayout->setColumnMinimumWidth(0, MIN_LABEL_WIDTH - 8);
|
||||||
|
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
topLayout->setColumnMinimumWidth(0, DETAIL_MIN_LABEL_WIDTH);
|
||||||
|
topLayout->setColumnMinimumWidth(1, DETAIL_MIN_EDIT_WIDTH);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void SecurityPage::onPacFilePathComboxIndexChanged(QString str)
|
void SecurityPage::onPacFilePathComboxIndexChanged(QString str)
|
||||||
{
|
{
|
||||||
if (str.contains("Choose from file...") || str.contains("从文件选择..."))
|
if (str.contains("Choose from file...") || str.contains("从文件选择..."))
|
||||||
|
@ -1256,35 +1250,3 @@ void SecurityPage::onPacFilePathComboxIndexChanged(QString str)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SecurityPage::onPwdOptionComboxIndexChanged(QString str)
|
|
||||||
{
|
|
||||||
KyEapMethodTlsInfo info;
|
|
||||||
if (str.contains("Store passwords only for this user") || str.contains("仅为该用户存储密码")) {
|
|
||||||
info.m_privateKeyPWDFlag = NetworkManager::Setting::AgentOwned;
|
|
||||||
clientPrivateKeyPwdEdit->setPlaceholderText(emptyhint);
|
|
||||||
} else if (str.contains("Store passwords for all users") || str.contains("存储所有用户的密码")) {
|
|
||||||
info.m_privateKeyPWDFlag = NetworkManager::Setting::None;
|
|
||||||
clientPrivateKeyPwdEdit->setPlaceholderText(hintRequired);
|
|
||||||
} else {
|
|
||||||
info.m_privateKeyPWDFlag = NetworkManager::Setting::NotSaved;
|
|
||||||
clientPrivateKeyPwdEdit->setPlaceholderText(emptyhint);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SecurityPage::changeColumnWidthWithSecuType()
|
|
||||||
{
|
|
||||||
if (!isDetailPage) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (secuTypeCombox->currentData().toInt() == WPA_AND_WPA2_ENTERPRISE &&
|
|
||||||
eapMethodCombox->currentData().toInt() == TLS) {
|
|
||||||
topLayout->setColumnMinimumWidth(0, MIN_LABEL_WIDTH);
|
|
||||||
topLayout->setColumnMinimumWidth(1, MIN_EDIT_WIDTH);
|
|
||||||
bottomLayout->setColumnMinimumWidth(0, MIN_LABEL_WIDTH - 8);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
topLayout->setColumnMinimumWidth(0, DETAIL_MIN_LABEL_WIDTH);
|
|
||||||
topLayout->setColumnMinimumWidth(1, DETAIL_MIN_EDIT_WIDTH);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue