From 28180b6efa8ee37406604cac3e3b3c6c38db3840 Mon Sep 17 00:00:00 2001 From: hawkeyexp Date: Wed, 17 Oct 2018 00:42:02 +0200 Subject: [PATCH] Add sdoc / Add display wake lock while playing media --- .../f1x/openauto/autoapp/UI/MainWindow.hpp | 1 + src/autoapp/UI/MainWindow.cpp | 10 ++ src/autoapp/UI/SettingsWindow.cpp | 9 ++ src/autoapp/UI/settingswindow.ui | 122 +++++++++++++++++- 4 files changed, 138 insertions(+), 4 deletions(-) diff --git a/include/f1x/openauto/autoapp/UI/MainWindow.hpp b/include/f1x/openauto/autoapp/UI/MainWindow.hpp index 5c14cd9..7b80d8d 100644 --- a/include/f1x/openauto/autoapp/UI/MainWindow.hpp +++ b/include/f1x/openauto/autoapp/UI/MainWindow.hpp @@ -134,6 +134,7 @@ private slots: void on_pushButtonBackToPlayer_clicked(); void on_comboBoxAlbum_currentIndexChanged(const QString &arg1); void on_mp3List_currentRowChanged(int currentRow); + void on_StateChanged(QMediaPlayer::State state); void scanFolders(); void scanFiles(); diff --git a/src/autoapp/UI/MainWindow.cpp b/src/autoapp/UI/MainWindow.cpp index e5466f4..cb16047 100644 --- a/src/autoapp/UI/MainWindow.cpp +++ b/src/autoapp/UI/MainWindow.cpp @@ -556,6 +556,7 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi connect(player, &QMediaPlayer::positionChanged, this, &MainWindow::on_positionChanged); connect(player, &QMediaPlayer::durationChanged, this, &MainWindow::on_durationChanged); connect(player, &QMediaPlayer::metaDataAvailableChanged, this, &MainWindow::metaDataChanged); + connect(player, &QMediaPlayer::stateChanged, this, &MainWindow::on_StateChanged); ui_->pushButtonList->hide(); ui_->pushButtonBackToPlayer->hide(); @@ -1556,3 +1557,12 @@ void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonBackToPlayer_clicked() ui_->pushButtonList->show(); ui_->pushButtonUSB->hide(); } + +void f1x::openauto::autoapp::ui::MainWindow::on_StateChanged(QMediaPlayer::State state) +{ + if (state == QMediaPlayer::StoppedState || state == QMediaPlayer::PausedState) { + system("rm -f /tmp/media_playing"); + } else { + system("touch /tmp/media_playing"); + } +} diff --git a/src/autoapp/UI/SettingsWindow.cpp b/src/autoapp/UI/SettingsWindow.cpp index c25f736..cc6fdff 100644 --- a/src/autoapp/UI/SettingsWindow.cpp +++ b/src/autoapp/UI/SettingsWindow.cpp @@ -74,6 +74,7 @@ SettingsWindow::SettingsWindow(configuration::IConfiguration::Pointer configurat ui_->tab7->hide(); ui_->tab8->hide(); ui_->horizontalGroupBox->hide(); + ui_->groupBoxNetworking->hide(); QFileInfo devModeFile("/tmp/dev_mode_enabled"); QFileInfo DebugmodeFile("/tmp/usb_debug_mode"); @@ -264,6 +265,8 @@ void SettingsWindow::onSave() params.append("0"); } params.append("#"); + params.append( std::string(ui_->comboBoxSDOC->currentText().split(" ")[0].toStdString()) ); + params.append("#"); system((std::string("/usr/local/bin/autoapp_helper setparams#") + std::string(params) + std::string(" &") ).c_str()); @@ -693,6 +696,12 @@ void SettingsWindow::loadSystemValues() } else { ui_->radioButtonUSBDetectDisabled->setChecked(true); } + // set sdoc + if (getparams[40] == "enabled") { + ui_->comboBoxSDOC->setCurrentIndex(1); + } else { + ui_->comboBoxSDOC->setCurrentIndex(0); + } } void SettingsWindow::onShowBindings() diff --git a/src/autoapp/UI/settingswindow.ui b/src/autoapp/UI/settingswindow.ui index 8c6d369..225a3b4 100644 --- a/src/autoapp/UI/settingswindow.ui +++ b/src/autoapp/UI/settingswindow.ui @@ -7,7 +7,7 @@ 0 0 800 - 3192 + 3243 @@ -2421,6 +2421,36 @@ outline: none; + + + + Networking + + + + + + No wifi network + + + + + + + wifi client + + + + + + + wifi hotspot + + + + + + @@ -3715,7 +3745,7 @@ subcontrol-position: center left; 2 - 9 + 2 @@ -4355,7 +4385,7 @@ subcontrol-position: center left; 2 - 9 + 2 @@ -4874,7 +4904,10 @@ subcontrol-position: center left; - + QScrollBar { + width: 40px; + background-color: rgba(85, 87, 83, 0.7); +} @@ -5562,6 +5595,12 @@ outline: none; Hardware Setup + + 2 + + + 2 + @@ -6039,6 +6078,81 @@ QComboBox::item:selected { + + + + + 0 + 0 + + + + + 100 + 30 + + + + SDCard OC + + + + + + + + 0 + 0 + + + + + 0 + 32 + + + + + 16777215 + 32 + + + + + 12 + 75 + true + + + + QScrollBar { + width: 40px; + background-color: rgba(85, 87, 83, 0.7); +} +QComboBox::item { + padding-top: 6px; + padding-bottom: 6px; + height: 32px; +} +QComboBox::item:selected { + background-color: rgb(78, 154, 6); + padding-top: 6px; + padding-bottom: 6px; + height: 32px; +} + + + + disabled + + + + + enabled (This can cause demaged sdcard - use at your own risk!) + + + +