[gui] Add phone connected string

This commit is contained in:
hawkeyexp 2018-06-26 20:45:46 +02:00
parent 9d60eba90e
commit ff89fe6f11
2 changed files with 26 additions and 0 deletions

View File

@ -213,6 +213,7 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
ui_->pushButtonReboot->hide();
ui_->pushButtonCancel->hide();
ui_->phoneConnected->hide();
// init bg's on startup
if (!this->nightModeEnabled) {
if (this->devModeEnabled) {
@ -420,6 +421,18 @@ void f1x::openauto::autoapp::ui::MainWindow::showTime()
}
}**/
QFileInfo phoneConnectedFile("/tmp/android_device");
if (phoneConnectedFile.exists()) {
if (ui_->phoneConnected->isVisible() == false) {
ui_->phoneConnected->setText("Phone connected");
ui_->phoneConnected->show();
}
} else {
if (ui_->phoneConnected->isVisible() == true) {
ui_->phoneConnected->hide();
}
}
QFileInfo nightModeFile("/tmp/night_mode_enabled");
this->nightModeEnabled = nightModeFile.exists();

View File

@ -37,6 +37,19 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" name="phoneConnected">
<property name="geometry">
<rect>
<x>578</x>
<y>408</y>
<width>210</width>
<height>20</height>
</rect>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" name="versionString">
<property name="geometry">
<rect>