Show black bg if kodi is running

This commit is contained in:
hawkeyexp 2018-08-06 16:10:54 +02:00
parent e936f7439d
commit 10516c7017
4 changed files with 32 additions and 2 deletions

BIN
assets/black.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -31,6 +31,7 @@
<file>rearcam-hot.png</file>
<file>recordactive-hot.png</file>
<file>lock-hot.png</file>
<file>black.png</file>
<file>Roboto-Regular.ttf</file>
</qresource>
</RCC>

View File

@ -227,8 +227,11 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
this->customBrightnessControl = true;
}
ui_->kodiBG->hide();
if (!this->kodiButtonForce) {
ui_->pushButtonKodi->hide();
} else {
system("/usr/local/bin/autoapp_helper startkodimonitor &");
}
ui_->horizontalSliderBrightness->hide();
@ -569,9 +572,24 @@ void f1x::openauto::autoapp::ui::MainWindow::showTime()
if (externalExitFile.exists()) {
f1x::openauto::autoapp::ui::MainWindow::MainWindow::exit();
}
}
if (this->kodiButtonForce) {
QFileInfo kodiRunningFile("/tmp/kodi_running");
if (kodiRunningFile.exists()) {
if (ui_->kodiBG->isVisible() == false) {
ui_->kodiBG->hide();
QPixmap image;
image.load(":/black.png");
ui_->kodiBG->setPixmap(image);
ui_->kodiBG->show();
}
} else {
if (ui_->kodiBG->isVisible() == true) {
ui_->kodiBG->hide();
}
}
}
}
ui_->Digital_clock->setText(time_text);
sleep_for(milliseconds(10));
}

View File

@ -748,6 +748,16 @@ QPushButton:pressed { background: orange; border: none; }</string>
<bool>true</bool>
</property>
</widget>
<widget class="QLabel" name="kodiBG">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>480</height>
</rect>
</property>
</widget>
<zorder>masterButtonBG</zorder>
<zorder>pushButtonSettings</zorder>
<zorder>pushButtonLock</zorder>
@ -777,6 +787,7 @@ QPushButton:pressed { background: orange; border: none; }</string>
<zorder>pushButtonCancel</zorder>
<zorder>systemConfigInProgress</zorder>
<zorder>systemDebugging</zorder>
<zorder>kodiBG</zorder>
<zorder>pushButtonRearcamBack</zorder>
</widget>
</widget>