diff --git a/src/backend/dbus-interface/kywirelessnetitem.cpp b/src/backend/dbus-interface/kywirelessnetitem.cpp index 44252ca0..db3ed6fc 100644 --- a/src/backend/dbus-interface/kywirelessnetitem.cpp +++ b/src/backend/dbus-interface/kywirelessnetitem.cpp @@ -54,6 +54,7 @@ void KyWirelessNetItem::init(NetworkManager::WirelessNetwork::Ptr net) m_NetSsid = net->ssid(); m_signalStrength = net->signalStrength(); m_frequency = net->referenceAccessPoint()->frequency(); + m_channel = NetworkManager::findChannel(m_frequency); NetworkManager::AccessPoint::Capabilities cap = net->referenceAccessPoint()->capabilities(); NetworkManager::AccessPoint::WpaFlags wpaFlag = net->referenceAccessPoint()->wpaFlags(); NetworkManager::AccessPoint::WpaFlags rsnFlag = net->referenceAccessPoint()->rsnFlags(); @@ -81,7 +82,6 @@ void KyWirelessNetItem::initInfoBySsid() m_connName = conn->name(); m_connDbusPath = conn->path(); m_isConfigured = true; - m_channel = wifi_sett->channel(); return; } } diff --git a/src/frontend/netdetails/netdetail.cpp b/src/frontend/netdetails/netdetail.cpp index d352f838..3c87f9fc 100644 --- a/src/frontend/netdetails/netdetail.cpp +++ b/src/frontend/netdetails/netdetail.cpp @@ -111,15 +111,28 @@ void NetDetail::initUI() detailBtn = new QPushButton(this); detailBtn->setText(tr("Detail")); + detailBtn->setCheckable(true); + detailBtn->setChecked(true); ipv4Btn = new QPushButton(this); ipv4Btn->setText(tr("Ipv4")); + ipv4Btn->setCheckable(true); ipv6Btn = new QPushButton(this); ipv6Btn->setText(tr("Ipv6")); + ipv6Btn->setCheckable(true); securityBtn = new QPushButton(this); 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->addWidget(detailBtn); @@ -360,9 +373,7 @@ void NetDetail::getBaseInfo(ConInfo &conInfo) qDebug() << "KeyMgmt not support now " << type; } 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(); } diff --git a/src/frontend/netdetails/netdetail.h b/src/frontend/netdetails/netdetail.h index 7c139818..bc353213 100644 --- a/src/frontend/netdetails/netdetail.h +++ b/src/frontend/netdetails/netdetail.h @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -119,6 +120,8 @@ private: ConInfo m_info; + QButtonGroup *group; + private slots: void on_btnConfirm_clicked(); void on_btnForget_clicked();