modify get channel method

This commit is contained in:
jzxc95 2021-09-16 11:24:48 +08:00
parent 6697722d4a
commit 2a2d2fbf29
3 changed files with 18 additions and 4 deletions

View File

@ -54,6 +54,7 @@ void KyWirelessNetItem::init(NetworkManager::WirelessNetwork::Ptr net)
m_NetSsid = net->ssid(); m_NetSsid = net->ssid();
m_signalStrength = net->signalStrength(); m_signalStrength = net->signalStrength();
m_frequency = net->referenceAccessPoint()->frequency(); m_frequency = net->referenceAccessPoint()->frequency();
m_channel = NetworkManager::findChannel(m_frequency);
NetworkManager::AccessPoint::Capabilities cap = net->referenceAccessPoint()->capabilities(); NetworkManager::AccessPoint::Capabilities cap = net->referenceAccessPoint()->capabilities();
NetworkManager::AccessPoint::WpaFlags wpaFlag = net->referenceAccessPoint()->wpaFlags(); NetworkManager::AccessPoint::WpaFlags wpaFlag = net->referenceAccessPoint()->wpaFlags();
NetworkManager::AccessPoint::WpaFlags rsnFlag = net->referenceAccessPoint()->rsnFlags(); NetworkManager::AccessPoint::WpaFlags rsnFlag = net->referenceAccessPoint()->rsnFlags();
@ -81,7 +82,6 @@ void KyWirelessNetItem::initInfoBySsid()
m_connName = conn->name(); m_connName = conn->name();
m_connDbusPath = conn->path(); m_connDbusPath = conn->path();
m_isConfigured = true; m_isConfigured = true;
m_channel = wifi_sett->channel();
return; return;
} }
} }

View File

@ -111,15 +111,28 @@ void NetDetail::initUI()
detailBtn = new QPushButton(this); detailBtn = new QPushButton(this);
detailBtn->setText(tr("Detail")); detailBtn->setText(tr("Detail"));
detailBtn->setCheckable(true);
detailBtn->setChecked(true);
ipv4Btn = new QPushButton(this); ipv4Btn = new QPushButton(this);
ipv4Btn->setText(tr("Ipv4")); ipv4Btn->setText(tr("Ipv4"));
ipv4Btn->setCheckable(true);
ipv6Btn = new QPushButton(this); ipv6Btn = new QPushButton(this);
ipv6Btn->setText(tr("Ipv6")); ipv6Btn->setText(tr("Ipv6"));
ipv6Btn->setCheckable(true);
securityBtn = new QPushButton(this); securityBtn = new QPushButton(this);
securityBtn->setText(tr("Security")); securityBtn->setText(tr("Security"));
securityBtn->setCheckable(true);
group = new QButtonGroup(this);
group->addButton(detailBtn);
group->addButton(ipv4Btn);
group->addButton(ipv6Btn);
if (isWlan) {
group->addButton(securityBtn);
}
pageLayout->addStretch(); pageLayout->addStretch();
pageLayout->addWidget(detailBtn); pageLayout->addWidget(detailBtn);
@ -360,9 +373,7 @@ void NetDetail::getBaseInfo(ConInfo &conInfo)
qDebug() << "KeyMgmt not support now " << type; qDebug() << "KeyMgmt not support now " << type;
} }
conInfo.strHz = QString::number(item.m_frequency); conInfo.strHz = QString::number(item.m_frequency);
if (item.m_isConfigured) {
conInfo.strChan = QString::number(item.m_channel); conInfo.strChan = QString::number(item.m_channel);
}
initSecuData(); initSecuData();
} }

View File

@ -13,6 +13,7 @@
#include <QApplication> #include <QApplication>
#include <QDebug> #include <QDebug>
#include <QSettings> #include <QSettings>
#include <QButtonGroup>
#include <QDBusMessage> #include <QDBusMessage>
#include <QDBusObjectPath> #include <QDBusObjectPath>
@ -119,6 +120,8 @@ private:
ConInfo m_info; ConInfo m_info;
QButtonGroup *group;
private slots: private slots:
void on_btnConfirm_clicked(); void on_btnConfirm_clicked();
void on_btnForget_clicked(); void on_btnForget_clicked();