Fix bug show abnormal desktop notification sometimes when start operation system

This commit is contained in:
chenlelin 2020-08-11 17:21:36 +08:00
parent 549cbe5a70
commit d5d97a68eb
8 changed files with 130 additions and 121 deletions

View File

@ -803,15 +803,17 @@ void KylinDBus::getWifiSwitchState()
connect(m_gsettings, &QGSettings::changed, this, [=] (const QString &key) {
if (key == "switch") {
bool judge = getSwitchStatus(key);
if (judge) {
mw->onBtnWifiClicked(1); //打开wifi开关
qDebug()<<"receive a signal to turn on wifi switch from control-center";
syslog(LOG_DEBUG, "receive a signal to turn on wifi switch from control-center");
} else {
mw->onBtnWifiClicked(2); //关闭wifi开关
qDebug()<<"receive a signal to turn off wifi switch from control-center";
syslog(LOG_DEBUG, "receive a signal to turn off wifi switch from control-center");
if (isWirelessCardOn) {
bool judge = getSwitchStatus(key);
if (judge) {
mw->onBtnWifiClicked(1); //打开wifi开关
qDebug()<<"receive a signal to turn on wifi switch from control-center";
syslog(LOG_DEBUG, "receive a signal to turn on wifi switch from control-center");
} else {
mw->onBtnWifiClicked(2); //关闭wifi开关
qDebug()<<"receive a signal to turn off wifi switch from control-center";
syslog(LOG_DEBUG, "receive a signal to turn off wifi switch from control-center");
}
}
}
});

View File

@ -1044,6 +1044,7 @@ void MainWindow::on_btnNet_clicked()
void MainWindow::onBtnWifiClicked(int flag)
{
qDebug()<<"Value of flag passed into function 'onBtnWifiClicked' is: "<<flag;
syslog(LOG_DEBUG, "Value of flag passed into function 'onBtnWifiClicked' is: %d", flag);
if (is_wireless_adapter_ready == 1) {
// 当连接上无线网卡时才能打开wifi开关
@ -1137,10 +1138,10 @@ void MainWindow::onBtnWifiClicked(int flag)
objKyDBus->setWifiCardState(false);
}
QString txt(tr("please insert the wireless network adapter"));
QString txt(tr("No wireless card detected"));
objKyDBus->showDesktopNotify(txt);
qDebug()<<"please insert the wireless network adapter";
syslog(LOG_DEBUG, "please insert the wireless network adapter");
qDebug()<<"No wireless card detected";
syslog(LOG_DEBUG, "No wireless card detected");
//QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';notify-send '" + txt + "' -t 3800";
//int status = system(cmd.toUtf8().data());
//if (status != 0){ syslog(LOG_ERR, "execute 'notify-send' in function 'onBtnWifiClicked' failed");}
@ -2319,12 +2320,10 @@ void MainWindow::onExternalConnectionChange(QString type)
if (!is_stop_check_net_state) {
is_stop_check_net_state = 1;
if (type == "802-3-ethernet" || type == "ethernet") {
qDebug()<<"debug: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
QTimer::singleShot(2*1000, this, SLOT(onExternalLanChange() ));
}
if (type == "802-11-wireless" || type == "wifi") {
qDebug()<<"debug: bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
QTimer::singleShot(4*1000, this, SLOT(onExternalWifiChange() ));
}
}

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>424</width>
<height>60</height>
<height>250</height>
</rect>
</property>
<property name="windowTitle">
@ -115,7 +115,7 @@
<rect>
<x>63</x>
<y>86</y>
<width>246</width>
<width>250</width>
<height>20</height>
</rect>
</property>

View File

@ -1208,7 +1208,7 @@
<context>
<name>KylinDBus</name>
<message>
<location filename="../src/kylin-dbus-interface.cpp" line="618"/>
<location filename="../src/kylin-dbus-interface.cpp" line="712"/>
<source>kylin network applet desktop message</source>
<translation type="unfinished"></translation>
</message>
@ -1222,14 +1222,14 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="379"/>
<location filename="../src/mainwindow.cpp" line="377"/>
<location filename="../src/mainwindow.cpp" line="537"/>
<source>Advanced</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="338"/>
<location filename="../src/mainwindow.cpp" line="1173"/>
<location filename="../src/mainwindow.cpp" line="340"/>
<location filename="../src/mainwindow.cpp" line="1177"/>
<source>Ethernet</source>
<translation type="unfinished"></translation>
</message>
@ -1244,40 +1244,45 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="344"/>
<location filename="../src/mainwindow.cpp" line="1232"/>
<location filename="../src/mainwindow.cpp" line="346"/>
<location filename="../src/mainwindow.cpp" line="1236"/>
<source>Wifi</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="359"/>
<location filename="../src/mainwindow.cpp" line="357"/>
<source>HotSpot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="369"/>
<location filename="../src/mainwindow.cpp" line="367"/>
<source>FlyMode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="1271"/>
<location filename="../src/mainwindow.cpp" line="1348"/>
<location filename="../src/mainwindow.cpp" line="1493"/>
<location filename="../src/mainwindow.cpp" line="2188"/>
<location filename="../src/mainwindow.cpp" line="2273"/>
<location filename="../src/mainwindow.cpp" line="1140"/>
<source>No wireless card detected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="1276"/>
<location filename="../src/mainwindow.cpp" line="1353"/>
<location filename="../src/mainwindow.cpp" line="1501"/>
<location filename="../src/mainwindow.cpp" line="2197"/>
<location filename="../src/mainwindow.cpp" line="2282"/>
<source>Not connected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="1274"/>
<location filename="../src/mainwindow.cpp" line="1350"/>
<location filename="../src/mainwindow.cpp" line="1413"/>
<location filename="../src/mainwindow.cpp" line="1414"/>
<location filename="../src/mainwindow.cpp" line="1496"/>
<location filename="../src/mainwindow.cpp" line="1575"/>
<location filename="../src/mainwindow.cpp" line="1727"/>
<location filename="../src/mainwindow.cpp" line="2190"/>
<location filename="../src/mainwindow.cpp" line="2275"/>
<location filename="../src/mainwindow.cpp" line="1279"/>
<location filename="../src/mainwindow.cpp" line="1355"/>
<location filename="../src/mainwindow.cpp" line="1421"/>
<location filename="../src/mainwindow.cpp" line="1422"/>
<location filename="../src/mainwindow.cpp" line="1504"/>
<location filename="../src/mainwindow.cpp" line="1583"/>
<location filename="../src/mainwindow.cpp" line="1735"/>
<location filename="../src/mainwindow.cpp" line="2199"/>
<location filename="../src/mainwindow.cpp" line="2284"/>
<source>Disconnected</source>
<translation type="unfinished"></translation>
</message>
@ -1302,53 +1307,48 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="1438"/>
<location filename="../src/mainwindow.cpp" line="1446"/>
<source>No Other Wired Network Scheme</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="1597"/>
<location filename="../src/mainwindow.cpp" line="1605"/>
<source>No Other Wireless Network Scheme</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="2503"/>
<location filename="../src/mainwindow.cpp" line="2513"/>
<source>Confirm your Wi-Fi password or usable of wireless card</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="1136"/>
<source>please insert the wireless network adapter</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="1395"/>
<location filename="../src/mainwindow.cpp" line="1553"/>
<location filename="../src/mainwindow.cpp" line="1400"/>
<location filename="../src/mainwindow.cpp" line="1561"/>
<source>NetOn,</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="2100"/>
<location filename="../src/mainwindow.cpp" line="2108"/>
<source>Wired net is disconnected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="2128"/>
<location filename="../src/mainwindow.cpp" line="2136"/>
<source>Wi-Fi is disconnected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="2459"/>
<location filename="../src/mainwindow.cpp" line="2469"/>
<source>Conn Ethernet Success</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="2471"/>
<location filename="../src/mainwindow.cpp" line="2481"/>
<source>Conn Ethernet Fail</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="2494"/>
<location filename="../src/mainwindow.cpp" line="2504"/>
<source>Conn Wifi Success</source>
<translation type="unfinished"></translation>
</message>

Binary file not shown.

View File

@ -1247,7 +1247,7 @@
<context>
<name>KylinDBus</name>
<message>
<location filename="../src/kylin-dbus-interface.cpp" line="618"/>
<location filename="../src/kylin-dbus-interface.cpp" line="712"/>
<source>kylin network applet desktop message</source>
<translation type="unfinished">Kylin uygulaması masaüstü mesajı</translation>
</message>
@ -1265,14 +1265,14 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="379"/>
<location filename="../src/mainwindow.cpp" line="377"/>
<location filename="../src/mainwindow.cpp" line="537"/>
<source>Advanced</source>
<translation>Gelişmiş</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="338"/>
<location filename="../src/mainwindow.cpp" line="1173"/>
<location filename="../src/mainwindow.cpp" line="340"/>
<location filename="../src/mainwindow.cpp" line="1177"/>
<source>Ethernet</source>
<translation>Kablolu </translation>
</message>
@ -1281,8 +1281,8 @@
<translation type="vanished">Gizli ı Bağlan</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="344"/>
<location filename="../src/mainwindow.cpp" line="1232"/>
<location filename="../src/mainwindow.cpp" line="346"/>
<location filename="../src/mainwindow.cpp" line="1236"/>
<source>Wifi</source>
<translation>Wi-Fi</translation>
</message>
@ -1295,12 +1295,12 @@
<translation type="vanished">Pasif</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="359"/>
<location filename="../src/mainwindow.cpp" line="357"/>
<source>HotSpot</source>
<translation>HotSpot</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="369"/>
<location filename="../src/mainwindow.cpp" line="367"/>
<source>FlyMode</source>
<translation></translation>
</message>
@ -1310,49 +1310,54 @@
<translation>Ana Pencereyi Göster</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="1271"/>
<location filename="../src/mainwindow.cpp" line="1348"/>
<location filename="../src/mainwindow.cpp" line="1493"/>
<location filename="../src/mainwindow.cpp" line="2188"/>
<location filename="../src/mainwindow.cpp" line="2273"/>
<location filename="../src/mainwindow.cpp" line="1140"/>
<source>No wireless card detected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="1276"/>
<location filename="../src/mainwindow.cpp" line="1353"/>
<location filename="../src/mainwindow.cpp" line="1501"/>
<location filename="../src/mainwindow.cpp" line="2197"/>
<location filename="../src/mainwindow.cpp" line="2282"/>
<source>Not connected</source>
<translation>Bağlanamadı</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="1274"/>
<location filename="../src/mainwindow.cpp" line="1350"/>
<location filename="../src/mainwindow.cpp" line="1413"/>
<location filename="../src/mainwindow.cpp" line="1414"/>
<location filename="../src/mainwindow.cpp" line="1496"/>
<location filename="../src/mainwindow.cpp" line="1575"/>
<location filename="../src/mainwindow.cpp" line="1727"/>
<location filename="../src/mainwindow.cpp" line="2190"/>
<location filename="../src/mainwindow.cpp" line="2275"/>
<location filename="../src/mainwindow.cpp" line="1279"/>
<location filename="../src/mainwindow.cpp" line="1355"/>
<location filename="../src/mainwindow.cpp" line="1421"/>
<location filename="../src/mainwindow.cpp" line="1422"/>
<location filename="../src/mainwindow.cpp" line="1504"/>
<location filename="../src/mainwindow.cpp" line="1583"/>
<location filename="../src/mainwindow.cpp" line="1735"/>
<location filename="../src/mainwindow.cpp" line="2199"/>
<location filename="../src/mainwindow.cpp" line="2284"/>
<source>Disconnected</source>
<translation>Bağlantı Kesildi</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="1438"/>
<location filename="../src/mainwindow.cpp" line="1446"/>
<source>No Other Wired Network Scheme</source>
<translation type="unfinished">Başka Kablolu Düzeni Yok</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="1597"/>
<location filename="../src/mainwindow.cpp" line="1605"/>
<source>No Other Wireless Network Scheme</source>
<translation type="unfinished">Başka Kablosuz Düzeni Yok</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="2100"/>
<location filename="../src/mainwindow.cpp" line="2108"/>
<source>Wired net is disconnected</source>
<translation type="unfinished">Kablolu bağlantısı kesildi</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="2128"/>
<location filename="../src/mainwindow.cpp" line="2136"/>
<source>Wi-Fi is disconnected</source>
<translation type="unfinished">Kablosuz bağlantı kesildi</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="2503"/>
<location filename="../src/mainwindow.cpp" line="2513"/>
<source>Confirm your Wi-Fi password or usable of wireless card</source>
<translation type="unfinished">Kablosuz şifrenizi veya kablosuz kart kullanılabilirliğini onaylayın</translation>
</message>
@ -1377,8 +1382,8 @@
<translation type="unfinished">Listede kullanılabilir yok</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="1395"/>
<location filename="../src/mainwindow.cpp" line="1553"/>
<location filename="../src/mainwindow.cpp" line="1400"/>
<location filename="../src/mainwindow.cpp" line="1561"/>
<source>NetOn,</source>
<translation></translation>
</message>
@ -1396,9 +1401,8 @@
<translation type="vanished">Kablosuz anahtarı açmadan önce kablolu anahtarını ık tut</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="1136"/>
<source>please insert the wireless network adapter</source>
<translation>Lütfen kablosuz adaptörünü takın</translation>
<translation type="vanished">Lütfen kablosuz adaptörünü takın</translation>
</message>
<message>
<source>Abnormal connection exist, program will delete it</source>
@ -1413,17 +1417,17 @@
<translation type="vanished">Kablosuz listesini şimdi güncelle</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="2459"/>
<location filename="../src/mainwindow.cpp" line="2469"/>
<source>Conn Ethernet Success</source>
<translation>Ethernet Bağlantısı Başarılı</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="2471"/>
<location filename="../src/mainwindow.cpp" line="2481"/>
<source>Conn Ethernet Fail</source>
<translation>Ethernet Bağlantısı Hatası</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="2494"/>
<location filename="../src/mainwindow.cpp" line="2504"/>
<source>Conn Wifi Success</source>
<translation>Wi-Fi Bağlantısı Başarılı</translation>
</message>

Binary file not shown.

View File

@ -1255,7 +1255,7 @@
<context>
<name>KylinDBus</name>
<message>
<location filename="../src/kylin-dbus-interface.cpp" line="618"/>
<location filename="../src/kylin-dbus-interface.cpp" line="712"/>
<source>kylin network applet desktop message</source>
<translation type="unfinished"></translation>
</message>
@ -1273,14 +1273,14 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="379"/>
<location filename="../src/mainwindow.cpp" line="377"/>
<location filename="../src/mainwindow.cpp" line="537"/>
<source>Advanced</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="338"/>
<location filename="../src/mainwindow.cpp" line="1173"/>
<location filename="../src/mainwindow.cpp" line="340"/>
<location filename="../src/mainwindow.cpp" line="1177"/>
<source>Ethernet</source>
<translation>线</translation>
</message>
@ -1289,8 +1289,8 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="344"/>
<location filename="../src/mainwindow.cpp" line="1232"/>
<location filename="../src/mainwindow.cpp" line="346"/>
<location filename="../src/mainwindow.cpp" line="1236"/>
<source>Wifi</source>
<translation>线</translation>
</message>
@ -1303,12 +1303,12 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="359"/>
<location filename="../src/mainwindow.cpp" line="357"/>
<source>HotSpot</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="369"/>
<location filename="../src/mainwindow.cpp" line="367"/>
<source>FlyMode</source>
<translation></translation>
</message>
@ -1318,49 +1318,54 @@
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="1271"/>
<location filename="../src/mainwindow.cpp" line="1348"/>
<location filename="../src/mainwindow.cpp" line="1493"/>
<location filename="../src/mainwindow.cpp" line="2188"/>
<location filename="../src/mainwindow.cpp" line="2273"/>
<location filename="../src/mainwindow.cpp" line="1140"/>
<source>No wireless card detected</source>
<translation type="unfinished">线</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="1276"/>
<location filename="../src/mainwindow.cpp" line="1353"/>
<location filename="../src/mainwindow.cpp" line="1501"/>
<location filename="../src/mainwindow.cpp" line="2197"/>
<location filename="../src/mainwindow.cpp" line="2282"/>
<source>Not connected</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="1274"/>
<location filename="../src/mainwindow.cpp" line="1350"/>
<location filename="../src/mainwindow.cpp" line="1413"/>
<location filename="../src/mainwindow.cpp" line="1414"/>
<location filename="../src/mainwindow.cpp" line="1496"/>
<location filename="../src/mainwindow.cpp" line="1575"/>
<location filename="../src/mainwindow.cpp" line="1727"/>
<location filename="../src/mainwindow.cpp" line="2190"/>
<location filename="../src/mainwindow.cpp" line="2275"/>
<location filename="../src/mainwindow.cpp" line="1279"/>
<location filename="../src/mainwindow.cpp" line="1355"/>
<location filename="../src/mainwindow.cpp" line="1421"/>
<location filename="../src/mainwindow.cpp" line="1422"/>
<location filename="../src/mainwindow.cpp" line="1504"/>
<location filename="../src/mainwindow.cpp" line="1583"/>
<location filename="../src/mainwindow.cpp" line="1735"/>
<location filename="../src/mainwindow.cpp" line="2199"/>
<location filename="../src/mainwindow.cpp" line="2284"/>
<source>Disconnected</source>
<translation></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="1438"/>
<location filename="../src/mainwindow.cpp" line="1446"/>
<source>No Other Wired Network Scheme</source>
<translation type="unfinished">线</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="1597"/>
<location filename="../src/mainwindow.cpp" line="1605"/>
<source>No Other Wireless Network Scheme</source>
<translation type="unfinished">线</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="2100"/>
<location filename="../src/mainwindow.cpp" line="2108"/>
<source>Wired net is disconnected</source>
<translation type="unfinished">线</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="2128"/>
<location filename="../src/mainwindow.cpp" line="2136"/>
<source>Wi-Fi is disconnected</source>
<translation type="unfinished">线</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="2503"/>
<location filename="../src/mainwindow.cpp" line="2513"/>
<source>Confirm your Wi-Fi password or usable of wireless card</source>
<translation type="unfinished">Wi-Fi密码或无线设备</translation>
</message>
@ -1385,8 +1390,8 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="1395"/>
<location filename="../src/mainwindow.cpp" line="1553"/>
<location filename="../src/mainwindow.cpp" line="1400"/>
<location filename="../src/mainwindow.cpp" line="1561"/>
<source>NetOn,</source>
<translation></translation>
</message>
@ -1404,9 +1409,8 @@
<translation type="vanished">线线</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="1136"/>
<source>please insert the wireless network adapter</source>
<translation>线</translation>
<translation type="vanished">线</translation>
</message>
<message>
<source>Abnormal connection exist, program will delete it</source>
@ -1421,17 +1425,17 @@
<translation type="vanished"> Wi-Fi列表</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="2459"/>
<location filename="../src/mainwindow.cpp" line="2469"/>
<source>Conn Ethernet Success</source>
<translation>线</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="2471"/>
<location filename="../src/mainwindow.cpp" line="2481"/>
<source>Conn Ethernet Fail</source>
<translation>线</translation>
</message>
<message>
<location filename="../src/mainwindow.cpp" line="2494"/>
<location filename="../src/mainwindow.cpp" line="2504"/>
<source>Conn Wifi Success</source>
<translation>线</translation>
</message>