fix(icon):修改内网检测地址后,图标相应变化(#197648)
This commit is contained in:
parent
ebfe2ebf21
commit
aae488426c
|
@ -81,6 +81,7 @@ KyConnectResourse::KyConnectResourse(QObject *parent) : QObject(parent)
|
|||
connect(m_networkResourceInstance, &KyNetworkResourceManager::connectionUpdate, this, &KyConnectResourse::connectionUpdate);
|
||||
connect(m_networkResourceInstance, &KyNetworkResourceManager::connectivityChanged, this, &KyConnectResourse::connectivityChanged);
|
||||
|
||||
connect(m_networkResourceInstance, &KyNetworkResourceManager::connectivityCheckSpareUriChanged, this, &KyConnectResourse::connectivityCheckSpareUriChanged);
|
||||
connect(m_networkResourceInstance, &KyNetworkResourceManager::needShowDesktop, this, &KyConnectResourse::needShowDesktop);
|
||||
}
|
||||
|
||||
|
|
|
@ -86,6 +86,7 @@ Q_SIGNALS:
|
|||
void connectionUpdate(QString uuid);
|
||||
void connectionRemove(QString path);
|
||||
void connectivityChanged(NetworkManager::Connectivity connectivity);
|
||||
void connectivityCheckSpareUriChanged();
|
||||
|
||||
void needShowDesktop(QString);
|
||||
|
||||
|
|
|
@ -598,6 +598,12 @@ void KyNetworkResourceManager::onPropertiesChanged(QVariantMap qvm)
|
|||
Q_EMIT wiredEnabledChanged(wiredEnable);
|
||||
}
|
||||
}
|
||||
for(QString keyStr : qvm.keys()) {
|
||||
//内网检测地址变化
|
||||
if (keyStr == "ConnectivityCheckSpareUri") {
|
||||
Q_EMIT connectivityCheckSpareUriChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KyNetworkResourceManager::onConnectionUpdated()
|
||||
|
|
|
@ -129,6 +129,7 @@ Q_SIGNALS:
|
|||
void wifiNetworkDeviceDisappear();
|
||||
void wifiEnabledChanged(bool);
|
||||
void wiredEnabledChanged(bool);
|
||||
void connectivityCheckSpareUriChanged();
|
||||
|
||||
void activeConnectionsReset();
|
||||
void activeConnectionAdd(QString uuid);
|
||||
|
|
|
@ -400,6 +400,7 @@ void MainWindow::initDbusConnnect()
|
|||
connect(m_wlanWidget, &WlanPage::timeToUpdate , this, &MainWindow::onTimeUpdateTrayIcon);
|
||||
connect(m_wlanWidget, &WlanPage::showMainWindow, this, &MainWindow::onShowMainWindow);
|
||||
connect(m_wlanWidget, &WlanPage::connectivityChanged, this, &MainWindow::onConnectivityChanged);
|
||||
connect(m_wlanWidget, &WlanPage::connectivityCheckSpareUriChanged, this, &MainWindow::onConnectivityCheckSpareUriChanged);
|
||||
|
||||
connect(m_lanWidget, &LanPage::lanConnectChanged, this, &MainWindow::onRefreshTrayIconTooltip);
|
||||
connect(m_lanWidget, &LanPage::deviceStatusChanged, this, &MainWindow::onRefreshTrayIconTooltip);
|
||||
|
@ -901,6 +902,19 @@ void MainWindow::onConnectivityChanged(NetworkManager::Connectivity connectivity
|
|||
onRefreshTrayIcon();
|
||||
}
|
||||
|
||||
void MainWindow::onConnectivityCheckSpareUriChanged()
|
||||
{
|
||||
if (!m_trayIcon) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (iconStatus == ACTIVATING) {
|
||||
return;
|
||||
}
|
||||
|
||||
onRefreshTrayIcon();
|
||||
}
|
||||
|
||||
void MainWindow::onTimeUpdateTrayIcon()
|
||||
{
|
||||
if (!m_trayIcon) {
|
||||
|
|
|
@ -226,6 +226,7 @@ private Q_SLOTS:
|
|||
void onLanConnectStatusToChangeTrayIcon(int state);
|
||||
void onWlanConnectStatusToChangeTrayIcon(int state);
|
||||
void onConnectivityChanged(NetworkManager::Connectivity connectivity);
|
||||
void onConnectivityCheckSpareUriChanged();
|
||||
void onTimeUpdateTrayIcon();
|
||||
void onTabletModeChanged(bool mode);
|
||||
void onRefreshTrayIconTooltip();
|
||||
|
|
|
@ -81,6 +81,7 @@ WlanPage::WlanPage(QWidget *parent) : TabPage(parent)
|
|||
connect(m_wirelessConnectOpreation, &KyWirelessConnectOperation::wifiEnabledChanged, this, &WlanPage::onWifiEnabledChanged);
|
||||
|
||||
connect(m_connectResource, &KyConnectResourse::connectivityChanged, this, &WlanPage::connectivityChanged);
|
||||
connect(m_connectResource, &KyConnectResourse::connectivityCheckSpareUriChanged, this, &WlanPage::connectivityCheckSpareUriChanged);
|
||||
connect(m_netSwitch, &KSwitchButton::clicked, this, [=](bool checked) {
|
||||
//解决 switchBtn不支持点击的情况下,点击按钮,有无线网卡后不自动开启的问题
|
||||
if (getSwitchBtnEnable()) {
|
||||
|
|
|
@ -104,6 +104,7 @@ Q_SIGNALS:
|
|||
void showMainWindow(int type);
|
||||
|
||||
void connectivityChanged(NetworkManager::Connectivity connectivity);
|
||||
void connectivityCheckSpareUriChanged();
|
||||
|
||||
void wirelessSwitchBtnChanged(bool state);
|
||||
|
||||
|
|
Loading…
Reference in New Issue