Fix bug can not show normal in some 2k screen
This commit is contained in:
parent
5c7c71c0ee
commit
739b387cc5
|
@ -236,6 +236,8 @@ void BackThread::execConnLan(QString connName)
|
||||||
syslog(LOG_DEBUG, "In function execConnLan, wired net state is: %d", execGetIface()->lstate);
|
syslog(LOG_DEBUG, "In function execConnLan, wired net state is: %d", execGetIface()->lstate);
|
||||||
emit connDone(0);
|
emit connDone(0);
|
||||||
} else {
|
} else {
|
||||||
|
qDebug()<<"connect wired network failed for without wired cable plug in.";
|
||||||
|
syslog(LOG_DEBUG, "connect wired network failed for without wired cable plug in.");
|
||||||
emit connDone(1);
|
emit connDone(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -415,7 +415,7 @@ void KylinDBus::initConnectionInfo()
|
||||||
// qDebug()<<" ";
|
// qDebug()<<" ";
|
||||||
|
|
||||||
|
|
||||||
//获取当前wifi是否连接
|
//获取当前wifi的开关状态
|
||||||
QDBusReply<QVariant> m_result = interface.call("Get", "org.freedesktop.NetworkManager", "WirelessEnabled");
|
QDBusReply<QVariant> m_result = interface.call("Get", "org.freedesktop.NetworkManager", "WirelessEnabled");
|
||||||
qDebug()<<"debug: *****初始的无线网络开关状态是: "<<m_result.value().toBool();
|
qDebug()<<"debug: *****初始的无线网络开关状态是: "<<m_result.value().toBool();
|
||||||
oldWifiSwitchState = m_result.value().toBool();
|
oldWifiSwitchState = m_result.value().toBool();
|
||||||
|
@ -712,8 +712,12 @@ void KylinDBus::getWifiSwitchState()
|
||||||
bool judge = getSwitchStatus(key);
|
bool judge = getSwitchStatus(key);
|
||||||
if (judge) {
|
if (judge) {
|
||||||
mw->onBtnWifiClicked(1); //打开wifi开关
|
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 {
|
} else {
|
||||||
mw->onBtnWifiClicked(2); //关闭wifi开关
|
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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
10
src/main.cpp
10
src/main.cpp
|
@ -25,16 +25,24 @@
|
||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QDesktopWidget>
|
||||||
|
|
||||||
#define LOG_IDENT "ukui_kylin_nm"
|
#define LOG_IDENT "ukui_kylin_nm"
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
//QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||||
|
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
|
|
||||||
|
if (QApplication::desktop()->width() >= 2560) {
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
|
||||||
|
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||||
|
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
openlog(LOG_IDENT, LOG_NDELAY | LOG_NOWAIT | LOG_PID, LOG_USER);
|
openlog(LOG_IDENT, LOG_NDELAY | LOG_NOWAIT | LOG_PID, LOG_USER);
|
||||||
|
|
||||||
syslog(LOG_DEBUG, "Kylin Network Manager Is Already Launched");
|
syslog(LOG_DEBUG, "Kylin Network Manager Is Already Launched");
|
||||||
|
|
|
@ -1135,6 +1135,8 @@ void MainWindow::onBtnWifiClicked(int flag)
|
||||||
|
|
||||||
QString txt(tr("please insert the wireless network adapter"));
|
QString txt(tr("please insert the wireless network adapter"));
|
||||||
objKyDBus->showDesktopNotify(txt);
|
objKyDBus->showDesktopNotify(txt);
|
||||||
|
qDebug()<<"please insert the wireless network adapter";
|
||||||
|
syslog(LOG_DEBUG, "please insert the wireless network adapter");
|
||||||
//QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';notify-send '" + txt + "' -t 3800";
|
//QString cmd = "export LANG='en_US.UTF-8';export LANGUAGE='en_US';notify-send '" + txt + "' -t 3800";
|
||||||
//int status = system(cmd.toUtf8().data());
|
//int status = system(cmd.toUtf8().data());
|
||||||
//if (status != 0){ syslog(LOG_ERR, "execute 'notify-send' in function 'onBtnWifiClicked' failed");}
|
//if (status != 0){ syslog(LOG_ERR, "execute 'notify-send' in function 'onBtnWifiClicked' failed");}
|
||||||
|
@ -2339,10 +2341,12 @@ void MainWindow::onExternalWifiSwitchChange(bool wifiEnabled)
|
||||||
if (!is_stop_check_net_state) {
|
if (!is_stop_check_net_state) {
|
||||||
is_stop_check_net_state = 1;
|
is_stop_check_net_state = 1;
|
||||||
if (wifiEnabled) {
|
if (wifiEnabled) {
|
||||||
qDebug()<<"debug: ccccccccccccccccccccccccccccccccc";
|
qDebug()<<"debug: external wifi switch turn on";
|
||||||
|
syslog(LOG_DEBUG, "debug: external wifi switch turn on");
|
||||||
QTimer::singleShot(4*1000, this, SLOT(onExternalWifiChange() ));
|
QTimer::singleShot(4*1000, this, SLOT(onExternalWifiChange() ));
|
||||||
} else {
|
} else {
|
||||||
qDebug()<<"debug: ddddddddddddddddddddddddddddddddd";
|
qDebug()<<"debug: external wifi switch turn off";
|
||||||
|
syslog(LOG_DEBUG, "debug: external wifi switch turn off");
|
||||||
QTimer::singleShot(3*1000, this, SLOT(onExternalWifiChange() ));
|
QTimer::singleShot(3*1000, this, SLOT(onExternalWifiChange() ));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue