Fix bug can not show normal in some 2k screen

This commit is contained in:
chenlelin 2020-07-20 13:52:51 +08:00
parent 5c7c71c0ee
commit 739b387cc5
4 changed files with 22 additions and 4 deletions

View File

@ -236,6 +236,8 @@ void BackThread::execConnLan(QString connName)
syslog(LOG_DEBUG, "In function execConnLan, wired net state is: %d", execGetIface()->lstate);
emit connDone(0);
} 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);
}

View File

@ -415,7 +415,7 @@ void KylinDBus::initConnectionInfo()
// qDebug()<<" ";
//获取当前wifi是否连接
//获取当前wifi的开关状态
QDBusReply<QVariant> m_result = interface.call("Get", "org.freedesktop.NetworkManager", "WirelessEnabled");
qDebug()<<"debug: *****初始的无线网络开关状态是: "<<m_result.value().toBool();
oldWifiSwitchState = m_result.value().toBool();
@ -712,8 +712,12 @@ void KylinDBus::getWifiSwitchState()
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

@ -25,16 +25,24 @@
#include <QLocale>
#include <QApplication>
#include <QDebug>
#include <QDesktopWidget>
#define LOG_IDENT "ukui_kylin_nm"
int main(int argc, char *argv[])
{
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
//QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
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);
syslog(LOG_DEBUG, "Kylin Network Manager Is Already Launched");

View File

@ -1135,6 +1135,8 @@ void MainWindow::onBtnWifiClicked(int flag)
QString txt(tr("please insert the wireless network adapter"));
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";
//int status = system(cmd.toUtf8().data());
//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) {
is_stop_check_net_state = 1;
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() ));
} 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() ));
}
}