无线、有线无设备时,开关状态
This commit is contained in:
parent
745bae5fca
commit
3e18517407
|
@ -557,7 +557,7 @@ void WlanConnect::onSwitchBtnChanged(bool state)
|
|||
if (getSwitchBtnState() == state) {
|
||||
return;
|
||||
}
|
||||
|
||||
setSwitchBtnEnable(true);
|
||||
setSwitchBtnState(state);
|
||||
if (!getSwitchBtnState()) {
|
||||
hideLayout(ui->availableLayout);
|
||||
|
@ -716,6 +716,7 @@ void WlanConnect::initSwtichState()
|
|||
}
|
||||
|
||||
bool state = result.arguments().at(0).toBool();
|
||||
setSwitchBtnEnable(true);
|
||||
setSwitchBtnState(state);
|
||||
}
|
||||
|
||||
|
|
|
@ -127,12 +127,12 @@ private:
|
|||
void initSwtichState();
|
||||
inline void setSwitchBtnEnable(bool state) {
|
||||
if (m_wifiSwitch != nullptr) {
|
||||
m_wifiSwitch->setCheckable(state);
|
||||
m_wifiSwitch->setEnabled(state);
|
||||
}
|
||||
}
|
||||
inline bool getSwitchBtnEnable() {
|
||||
if (m_wifiSwitch != nullptr) {
|
||||
return m_wifiSwitch->isCheckable();
|
||||
return m_wifiSwitch->isEnabled();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ WlanPage::WlanPage(QWidget *parent) : TabPage(parent)
|
|||
|
||||
connect(m_connectResource, &KyConnectResourse::connectivityChanged, this, &WlanPage::connectivityChanged);
|
||||
connect(m_netSwitch, &KSwitchButton::clicked, this, [=](bool checked) {
|
||||
//解决switchBtn不支持点击的情况下,点击按钮,有无线网卡后不自动开启的问题
|
||||
//解决 switchBtn不支持点击的情况下,点击按钮,有无线网卡后不自动开启的问题
|
||||
if (getSwitchBtnEnable()) {
|
||||
setSwitchBtnState(!checked);
|
||||
setWirelessEnable(checked);
|
||||
|
@ -803,6 +803,7 @@ void WlanPage::onWlanStateChanged(NetworkManager::Device::State newstate, Networ
|
|||
if (getSwitchBtnState() == getWirelessDevieceUseable()) {
|
||||
return ;
|
||||
}
|
||||
setSwitchBtnEnable(true);
|
||||
setSwitchBtnState(getWirelessDevieceUseable());
|
||||
initDeviceCombox();
|
||||
initWlanArea();
|
||||
|
|
|
@ -196,12 +196,12 @@ private:
|
|||
}
|
||||
inline void setSwitchBtnEnable(bool state) {
|
||||
if (m_netSwitch != nullptr) {
|
||||
m_netSwitch->setCheckable(state);
|
||||
m_netSwitch->setEnabled(state);
|
||||
}
|
||||
}
|
||||
inline bool getSwitchBtnEnable() {
|
||||
if (m_netSwitch != nullptr) {
|
||||
return m_netSwitch->isCheckable();
|
||||
return m_netSwitch->isEnabled();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue