From 4d90184c2211cf594cd831f06cbdda8cd9315b64 Mon Sep 17 00:00:00 2001 From: hawkeyexp Date: Sat, 29 Sep 2018 01:05:37 +0200 Subject: [PATCH] Add display blank option --- src/autoapp/UI/MainWindow.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/autoapp/UI/MainWindow.cpp b/src/autoapp/UI/MainWindow.cpp index e84d456..f5126fa 100644 --- a/src/autoapp/UI/MainWindow.cpp +++ b/src/autoapp/UI/MainWindow.cpp @@ -991,6 +991,18 @@ void f1x::openauto::autoapp::ui::MainWindow::showTime() time_text[3] = ' '; time_text[8] = ' '; + // check if system is in display off mode (tap2wake) + QFileInfo blankFile("/tmp/blankscreen"); + if (blankFile.exists()) { + if (ui_->centralWidget->isVisible() == true) { + ui_->centralWidget->hide(); + } + } else { + if (ui_->centralWidget->isVisible() == false) { + ui_->centralWidget->show(); + } + } + // check if phone is conencted to usb QFileInfo phoneConnectedFile("/tmp/android_device"); if (phoneConnectedFile.exists()) {