diff --git a/assets/christmas.png b/assets/christmas.png
new file mode 100644
index 0000000..68f089b
Binary files /dev/null and b/assets/christmas.png differ
diff --git a/assets/firework.png b/assets/firework.png
new file mode 100644
index 0000000..0a7dace
Binary files /dev/null and b/assets/firework.png differ
diff --git a/assets/resources.qrc b/assets/resources.qrc
index ba03ab5..d1e5cd9 100644
--- a/assets/resources.qrc
+++ b/assets/resources.qrc
@@ -37,6 +37,8 @@
player-hot.png
coverlogo.png
black.png
+ christmas.png
+ firework.png
Roboto-Regular.ttf
diff --git a/include/f1x/openauto/autoapp/UI/MainWindow.hpp b/include/f1x/openauto/autoapp/UI/MainWindow.hpp
index 25e2373..3f7686d 100644
--- a/include/f1x/openauto/autoapp/UI/MainWindow.hpp
+++ b/include/f1x/openauto/autoapp/UI/MainWindow.hpp
@@ -117,7 +117,6 @@ private slots:
void customButtonPressed4();
void customButtonPressed5();
void customButtonPressed6();
- void customButtonPressed7();
void playerShow();
void playerHide();
void updateBG();
@@ -146,6 +145,7 @@ private slots:
void setTrigger();
void setRetryUSBConnect();
void resetRetryUSBMessage();
+ bool check_file_exist(const char *filename);
private:
Ui::MainWindow* ui_;
@@ -157,18 +157,24 @@ private:
QFile *brightnessFileAlt;
char brightness_str[6];
char volume_str[6];
- //char alpha_str[6];
int alpha_current_str;
QString bversion;
QString bdate;
- QString custom_button_file_c1 = "/boot/crankshaft/button_1";
- QString custom_button_file_c2 = "/boot/crankshaft/button_2";
- QString custom_button_file_c3 = "/boot/crankshaft/button_3";
- QString custom_button_file_c4 = "/boot/crankshaft/button_4";
- QString custom_button_file_c5 = "/boot/crankshaft/button_5";
- QString custom_button_file_c6 = "/boot/crankshaft/button_6";
- QString custom_button_file_c7 = "/boot/crankshaft/button_7";
+ char nightModeFile[32] = "/tmp/night_mode_enabled";
+ char devModeFile[32] = "/tmp/dev_mode_enabled";
+ char wifiButtonFile[32] = "/etc/button_wifi_visible";
+ char cameraButtonFile[32] = "/etc/button_camera_visible";
+ char brightnessButtonFile[32] = "/etc/button_brightness_visible";
+ char debugModeFile[32] = "/tmp/usb_debug_mode";
+ char lsFile[32] = "/etc/cs_lightsensor";
+
+ char custom_button_file_c1[26] = "/boot/crankshaft/button_1";
+ char custom_button_file_c2[26] = "/boot/crankshaft/button_2";
+ char custom_button_file_c3[26] = "/boot/crankshaft/button_3";
+ char custom_button_file_c4[26] = "/boot/crankshaft/button_4";
+ char custom_button_file_c5[26] = "/boot/crankshaft/button_5";
+ char custom_button_file_c6[26] = "/boot/crankshaft/button_6";
QString custom_button_command_c1;
QString custom_button_command_c2;
@@ -176,7 +182,6 @@ private:
QString custom_button_command_c4;
QString custom_button_command_c5;
QString custom_button_command_c6;
- QString custom_button_command_c7;
QString custom_button_color_c1 = "186,189,192";
QString custom_button_color_c2 = "186,189,192";
@@ -184,11 +189,11 @@ private:
QString custom_button_color_c4 = "186,189,192";
QString custom_button_color_c5 = "186,189,192";
QString custom_button_color_c6 = "186,189,192";
- QString custom_button_color_c7 = "186,189,192";
QString selectedMp3file;
QString musicfolder = "/media/CSSTORAGE/Music";
QString albumfolder = "/";
+ QString date_text;
QMediaPlaylist *playlist;
@@ -230,7 +235,6 @@ private:
bool c4ButtonForce = false;
bool c5ButtonForce = false;
bool c6ButtonForce = false;
- bool c7ButtonForce = false;
bool hotspotActive = false;
int currentPlaylistIndex = 0;
@@ -238,6 +242,7 @@ private:
bool mediacontentchanged = true;
bool lightsensor = false;
+ bool holidaybg = false;
};
}
diff --git a/include/f1x/openauto/autoapp/UI/Warning.hpp b/include/f1x/openauto/autoapp/UI/Warning.hpp
index 0b72d93..42f74c9 100644
--- a/include/f1x/openauto/autoapp/UI/Warning.hpp
+++ b/include/f1x/openauto/autoapp/UI/Warning.hpp
@@ -22,6 +22,9 @@ public:
~Warning() override;
Ui::Warning* ui_;
+
+private slots:
+ void Autoclose();
};
}
diff --git a/src/autoapp/UI/MainWindow.cpp b/src/autoapp/UI/MainWindow.cpp
index 086c481..2ffb024 100644
--- a/src/autoapp/UI/MainWindow.cpp
+++ b/src/autoapp/UI/MainWindow.cpp
@@ -61,88 +61,26 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
this->configuration_ = configuration;
// trigger files
- QFileInfo nightModeFile("/tmp/night_mode_enabled");
- this->nightModeEnabled = nightModeFile.exists();
-
- QFileInfo devModeFile("/tmp/dev_mode_enabled");
- this->devModeEnabled = devModeFile.exists();
-
- QFileInfo wifiButtonFile("/etc/button_wifi_visible");
- this->wifiButtonForce = wifiButtonFile.exists();
-
- QFileInfo cameraButtonFile("/etc/button_camera_visible");
- this->cameraButtonForce = cameraButtonFile.exists();
-
- QFileInfo brightnessButtonFile("/etc/button_brightness_visible");
- this->brightnessButtonForce = brightnessButtonFile.exists();
-
- QFileInfo DebugmodeFile("/tmp/usb_debug_mode");
- this->systemDebugmode = DebugmodeFile.exists();
-
- QFileInfo lightsensorFile("/etc/cs_lightsensor");
- this->lightsensor = lightsensorFile.exists();
-
- QFileInfo c1ButtonFile(this->custom_button_file_c1);
- this->c1ButtonForce = c1ButtonFile.exists();
-
- QFileInfo c2ButtonFile(this->custom_button_file_c2);
- this->c2ButtonForce = c2ButtonFile.exists();
-
- QFileInfo c3ButtonFile(this->custom_button_file_c3);
- this->c3ButtonForce = c3ButtonFile.exists();
-
- QFileInfo c4ButtonFile(this->custom_button_file_c4);
- this->c4ButtonForce = c4ButtonFile.exists();
-
- QFileInfo c5ButtonFile(this->custom_button_file_c5);
- this->c5ButtonForce = c5ButtonFile.exists();
-
- QFileInfo c6ButtonFile(this->custom_button_file_c6);
- this->c6ButtonForce = c6ButtonFile.exists();
-
- QFileInfo c7ButtonFile(this->custom_button_file_c7);
- this->c7ButtonForce = c7ButtonFile.exists();
+ this->nightModeEnabled = check_file_exist(this->nightModeFile);
+ this->devModeEnabled = check_file_exist(this->devModeFile);
+ this->wifiButtonForce = check_file_exist(this->wifiButtonFile);
+ this->cameraButtonForce = check_file_exist(this->cameraButtonFile);
+ this->brightnessButtonForce = check_file_exist(this->brightnessButtonFile);
+ this->systemDebugmode = check_file_exist(this->debugModeFile);
+ this->lightsensor = check_file_exist(this->lsFile);
+ this->c1ButtonForce = check_file_exist(this->custom_button_file_c1);
+ this->c2ButtonForce = check_file_exist(this->custom_button_file_c2);
+ this->c3ButtonForce = check_file_exist(this->custom_button_file_c3);
+ this->c4ButtonForce = check_file_exist(this->custom_button_file_c4);
+ this->c5ButtonForce = check_file_exist(this->custom_button_file_c5);
+ this->c6ButtonForce = check_file_exist(this->custom_button_file_c6);
// wallpaper stuff
- QFileInfo wallpaperDayFile("wallpaper.png");
- this->wallpaperDayFileExists = wallpaperDayFile.exists();
-
- QFileInfo wallpaperNightFile("wallpaper-night.png");
- this->wallpaperNightFileExists = wallpaperNightFile.exists();
-
- QFileInfo wallpaperClassicDayFile("wallpaper-classic.png");
- this->wallpaperDayFileExists = wallpaperDayFile.exists();
-
- QFileInfo wallpaperClassicNightFile("wallpaper-classic-night.png");
- this->wallpaperNightFileExists = wallpaperNightFile.exists();
-
- QFileInfo wallpaperEQFile("wallpaper-eq.png");
- this->wallpaperEQFileExists = wallpaperEQFile.exists();
-
- if (wallpaperDayFile.isSymLink()) {
- QFileInfo linkTarget(wallpaperDayFile.symLinkTarget());
- this->wallpaperDayFileExists = linkTarget.exists();
- }
-
- if (wallpaperNightFile.isSymLink()) {
- QFileInfo linkTarget(wallpaperNightFile.symLinkTarget());
- this->wallpaperNightFileExists = linkTarget.exists();
- }
-
- if (wallpaperClassicDayFile.isSymLink()) {
- QFileInfo linkTarget(wallpaperClassicDayFile.symLinkTarget());
- this->wallpaperClassicDayFileExists = linkTarget.exists();
- }
-
- if (wallpaperClassicNightFile.isSymLink()) {
- QFileInfo linkTarget(wallpaperClassicNightFile.symLinkTarget());
- this->wallpaperClassicNightFileExists = linkTarget.exists();
- }
-
- if (wallpaperEQFile.isSymLink()) {
- QFileInfo linkTarget(wallpaperEQFile.symLinkTarget());
- this->wallpaperEQFileExists = linkTarget.exists();
- }
+ this->wallpaperDayFileExists = check_file_exist("wallpaper.png");
+ this->wallpaperNightFileExists = check_file_exist("wallpaper-night.png");
+ this->wallpaperClassicDayFileExists = check_file_exist("wallpaper-classic.png");
+ this->wallpaperClassicNightFileExists = check_file_exist("wallpaper-classic-night.png");
+ this->wallpaperEQFileExists = check_file_exist("wallpaper-eq.png");
ui_->setupUi(this);
connect(ui_->pushButtonSettings, &QPushButton::clicked, this, &MainWindow::openSettings);
@@ -445,38 +383,13 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
}
// set bg's on startup
+ MainWindow::updateBG();
if (!this->nightModeEnabled) {
- if (this->oldGUIStyle) {
- if (this->wallpaperClassicDayFileExists) {
- this->setStyleSheet("QMainWindow { background: url(wallpaper-classic.png); background-repeat: no-repeat; background-position: center; }");
- } else {
- this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
- }
- } else {
- if (this->wallpaperDayFileExists) {
- this->setStyleSheet("QMainWindow { background: url(wallpaper.png); background-repeat: no-repeat; background-position: center; }");
- } else {
- this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
- }
- }
ui_->pushButtonDay->hide();
ui_->pushButtonDay2->hide();
ui_->pushButtonNight->show();
ui_->pushButtonNight2->show();
} else {
- if (this->oldGUIStyle) {
- if (this->wallpaperClassicNightFileExists) {
- this->setStyleSheet("QMainWindow { background: url(wallpaper-classic-night.png); background-repeat: no-repeat; background-position: center; }");
- } else {
- this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
- }
- } else {
- if (this->wallpaperNightFileExists) {
- this->setStyleSheet("QMainWindow { background: url(wallpaper-night.png); background-repeat: no-repeat; background-position: center; }");
- } else {
- this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
- }
- }
ui_->pushButtonNight->hide();
ui_->pushButtonNight2->hide();
ui_->pushButtonDay->show();
@@ -517,7 +430,6 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
}
// init alpha values
- //MainWindow::updateAlpha(int(configuration->getAlphaTrans()));
MainWindow::updateAlpha();
// Hide auto day/night if needed
@@ -615,10 +527,6 @@ void f1x::openauto::autoapp::ui::MainWindow::customButtonPressed6()
system(qPrintable(this->custom_button_command_c6 + " &"));
}
-void f1x::openauto::autoapp::ui::MainWindow::customButtonPressed7()
-{
- system(qPrintable(this->custom_button_command_c7 + " &"));
-}
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonBrightness_clicked()
{
@@ -783,19 +691,7 @@ void f1x::openauto::autoapp::ui::MainWindow::updateAlpha()
void f1x::openauto::autoapp::ui::MainWindow::switchGuiToNight()
{
MainWindow::on_pushButtonVolume_clicked();
- if (this->oldGUIStyle) {
- if (this->wallpaperClassicNightFileExists) {
- this->setStyleSheet("QMainWindow { background: url(wallpaper-classic-night.png); background-repeat: no-repeat; background-position: center; }");
- } else {
- this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
- }
- } else {
- if (this->wallpaperNightFileExists) {
- this->setStyleSheet("QMainWindow { background: url(wallpaper-night.png); background-repeat: no-repeat; background-position: center; }");
- } else {
- this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
- }
- }
+ f1x::openauto::autoapp::ui::MainWindow::updateBG();
ui_->pushButtonDay->show();
ui_->pushButtonDay2->show();
ui_->pushButtonNight->hide();
@@ -805,19 +701,7 @@ void f1x::openauto::autoapp::ui::MainWindow::switchGuiToNight()
void f1x::openauto::autoapp::ui::MainWindow::switchGuiToDay()
{
MainWindow::on_pushButtonVolume_clicked();
- if (this->oldGUIStyle) {
- if (this->wallpaperClassicDayFileExists) {
- this->setStyleSheet("QMainWindow { background: url(wallpaper-classic.png); background-repeat: no-repeat; background-position: center; }");
- } else {
- this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
- }
- } else {
- if (this->wallpaperDayFileExists) {
- this->setStyleSheet("QMainWindow { background: url(wallpaper.png); background-repeat: no-repeat; background-position: center; }");
- } else {
- this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
- }
- }
+ f1x::openauto::autoapp::ui::MainWindow::updateBG();
ui_->pushButtonNight->show();
ui_->pushButtonNight2->show();
ui_->pushButtonDay->hide();
@@ -942,32 +826,46 @@ void f1x::openauto::autoapp::ui::MainWindow::toggleGUI()
void f1x::openauto::autoapp::ui::MainWindow::updateBG()
{
- if (!this->nightModeEnabled) {
- if (this->oldGUIStyle) {
- if (this->wallpaperClassicDayFileExists) {
- this->setStyleSheet( this->styleSheet().append("QMainWindow { background: url(wallpaper-classic.png); background-repeat: no-repeat; background-position: center; }") );
+ if (this->date_text == "12/24") {
+ this->setStyleSheet("QMainWindow { background: url(:/christmas.png); background-repeat: no-repeat; background-position: center; }");
+ this->holidaybg = true;
+ }
+ else if (this->date_text == "12/31") {
+ this->setStyleSheet("QMainWindow { background: url(:/firework.png); background-repeat: no-repeat; background-position: center; }");
+ this->holidaybg = true;
+ }
+ else {
+ if (!this->nightModeEnabled) {
+ if (this->oldGUIStyle) {
+ if (this->wallpaperClassicDayFileExists) {
+ //this->setStyleSheet( this->styleSheet().append("QMainWindow { background: url(wallpaper-classic.png); background-repeat: no-repeat; background-position: center; }") );
+ this->setStyleSheet("QMainWindow { background: url(wallpaper-classic.png); background-repeat: no-repeat; background-position: center; }");
+ } else {
+ this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
+ }
} else {
- this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
+ if (this->wallpaperDayFileExists) {
+ //this->setStyleSheet( this->styleSheet().append("QMainWindow { background: url(wallpaper.png); background-repeat: no-repeat; background-position: center; }") );
+ this->setStyleSheet("QMainWindow { background: url(wallpaper.png); background-repeat: no-repeat; background-position: center; }");
+ } else {
+ this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
+ }
}
} else {
- if (this->wallpaperDayFileExists) {
- this->setStyleSheet( this->styleSheet().append("QMainWindow { background: url(wallpaper.png); background-repeat: no-repeat; background-position: center; }") );
+ if (this->oldGUIStyle) {
+ if (this->wallpaperClassicNightFileExists) {
+ //this->setStyleSheet( this->styleSheet().append("QMainWindow { background: url(wallpaper-classic-night.png); background-repeat: no-repeat; background-position: center; }") );
+ this->setStyleSheet( "QMainWindow { background: url(wallpaper-classic-night.png); background-repeat: no-repeat; background-position: center; }");
+ } else {
+ this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
+ }
} else {
- this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
- }
- }
- } else {
- if (this->oldGUIStyle) {
- if (this->wallpaperClassicNightFileExists) {
- this->setStyleSheet( this->styleSheet().append("QMainWindow { background: url(wallpaper-classic-night.png); background-repeat: no-repeat; background-position: center; }") );
- } else {
- this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
- }
- } else {
- if (this->wallpaperNightFileExists) {
- this->setStyleSheet( this->styleSheet().append("QMainWindow { background: url(wallpaper-night.png); background-repeat: no-repeat; background-position: center; }") );
- } else {
- this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
+ if (this->wallpaperNightFileExists) {
+ //this->setStyleSheet( this->styleSheet().append("QMainWindow { background: url(wallpaper-night.png); background-repeat: no-repeat; background-position: center; }") );
+ this->setStyleSheet("QMainWindow { background: url(wallpaper-night.png); background-repeat: no-repeat; background-position: center; }");
+ } else {
+ this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
+ }
}
}
}
@@ -996,13 +894,26 @@ void f1x::openauto::autoapp::ui::MainWindow::setUnMute()
void f1x::openauto::autoapp::ui::MainWindow::showTime()
{
QTime time=QTime::currentTime();
+ QDate date=QDate::currentDate();
QString time_text=time.toString("hh : mm : ss");
+ this->date_text=date.toString("MM/dd");
+
if ((time.second() % 2) == 0) {
time_text[3] = ' ';
time_text[8] = ' ';
}
+
ui_->Digital_clock->setText(time_text);
ui_->bigClock->setText(time_text);
+
+ if (!this->holidaybg) {
+ if (this->date_text == "12/24") {
+ MainWindow::updateBG();
+ }
+ else if (this->date_text == "12/31") {
+ MainWindow::updateBG();
+ }
+ }
}
@@ -1341,6 +1252,24 @@ void f1x::openauto::autoapp::ui::MainWindow::on_StateChanged(QMediaPlayer::State
}
}
+
+bool f1x::openauto::autoapp::ui::MainWindow::check_file_exist(const char *fileName)
+{
+ std::ifstream ifile(fileName, std::ios::in);
+ // file not ok - checking if symlink
+ if (!ifile.good()) {
+ QFileInfo linkFile = QString(fileName);
+ if (linkFile.isSymLink()) {
+ QFileInfo linkTarget(linkFile.symLinkTarget());
+ return linkTarget.exists();
+ } else {
+ return ifile.good();
+ }
+ } else {
+ return ifile.good();
+ }
+}
+
void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
{
try {
@@ -1400,8 +1329,7 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
}
// check if bluetooth available
- QFileInfo bluetoothButtonFile("/tmp/button_bluetooth_visible");
- this->bluetoothEnabled = bluetoothButtonFile.exists();
+ this->bluetoothEnabled = check_file_exist("/tmp/button_bluetooth_visible");
if (this->bluetoothEnabled) {
if (ui_->pushButtonBluetooth->isVisible() == false) {
@@ -1473,8 +1401,7 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
}
// update day/night state
- QFileInfo nightModeFile("/tmp/night_mode_enabled");
- this->nightModeEnabled = nightModeFile.exists();
+ this->nightModeEnabled = check_file_exist("/tmp/night_mode_enabled");
if (this->nightModeEnabled) {
if (!this->DayNightModeState) {
@@ -1492,9 +1419,7 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
if (this->cameraButtonForce) {
// check if dashcam is recording
- QFileInfo dashCamRecordingFile("/tmp/dashcam_is_recording");
- this->dashCamRecording = dashCamRecordingFile.exists();
-
+ this->dashCamRecording = check_file_exist("/tmp/dashcam_is_recording");
// show recording state if dashcam is visible
if (ui_->cameraWidget->isVisible() == true) {
if (this->dashCamRecording) {
@@ -1511,9 +1436,7 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
}
// check if rearcam is eanbled
- QFileInfo rearCamFile("/tmp/rearcam_enabled");
- this->rearCamEnabled = rearCamFile.exists();
-
+ this->rearCamEnabled = check_file_exist("/tmp/rearcam_enabled");
if (this->rearCamEnabled) {
if (!this->rearCamVisible) {
this->rearCamVisible = true;
@@ -1532,8 +1455,7 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
f1x::openauto::autoapp::ui::MainWindow::MainWindow::exit();
}
- QFileInfo hotspotFile("/tmp/hotspot_active");
- this->hotspotActive = hotspotFile.exists();
+ this->hotspotActive = check_file_exist("/tmp/hotspot_active");
// hide wifi if hotspot disabled
if (!this->hotspotActive) {
diff --git a/src/autoapp/UI/SettingsWindow.cpp b/src/autoapp/UI/SettingsWindow.cpp
index 7e4fdc3..5597e56 100644
--- a/src/autoapp/UI/SettingsWindow.cpp
+++ b/src/autoapp/UI/SettingsWindow.cpp
@@ -328,6 +328,19 @@ void SettingsWindow::onSave()
params.append("1");
}
params.append("#");
+ if(ui_->radioButtonAnimatedCSNG->isChecked())
+ {
+ params.append("0");
+ }
+ else if(ui_->radioButtonCSNG->isChecked())
+ {
+ params.append("1");
+ }
+ else if(ui_->radioButtonCustom->isChecked())
+ {
+ params.append("2");
+ }
+ params.append("#");
system((std::string("/usr/local/bin/autoapp_helper setparams#") + std::string(params) + std::string(" &") ).c_str());
@@ -910,6 +923,15 @@ void SettingsWindow::loadSystemValues()
} else {
ui_->checkBoxDisableDayNightRTC->setChecked(true);
}
+ if (getparams[43] == "csnganimation") {
+ ui_->radioButtonAnimatedCSNG->setChecked(true);
+ }
+ else if (getparams[43] == "crankshaft") {
+ ui_->radioButtonCSNG->setChecked(true);
+ }
+ else if (getparams[43] == "custom") {
+ ui_->radioButtonCustom->setChecked(true);
+ }
}
}
diff --git a/src/autoapp/UI/Warning.cpp b/src/autoapp/UI/Warning.cpp
index 1b6cada..a4e85d4 100644
--- a/src/autoapp/UI/Warning.cpp
+++ b/src/autoapp/UI/Warning.cpp
@@ -1,5 +1,6 @@
#include
#include
+#include
namespace f1x
{
@@ -17,6 +18,7 @@ Warning::Warning(QWidget *parent)
ui_->setupUi(this);
connect(ui_->pushButtonClose, &QPushButton::clicked, this, &Warning::close);
+ QTimer::singleShot(5000, this, SLOT(Autoclose()));
}
Warning::~Warning()
@@ -24,6 +26,11 @@ Warning::~Warning()
delete ui_;
}
+void Warning::Autoclose()
+{
+ Warning::close();
+}
+
}
}
}
diff --git a/src/autoapp/UI/settingswindow.ui b/src/autoapp/UI/settingswindow.ui
index 7304348..6f68b71 100644
--- a/src/autoapp/UI/settingswindow.ui
+++ b/src/autoapp/UI/settingswindow.ui
@@ -7,7 +7,7 @@
0
0
963
- 3536
+ 3602
@@ -683,6 +683,18 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}
-
+
+
+ 0
+ 24
+
+
+
+
+ 16777215
+ 24
+
+
auto play
@@ -696,6 +708,18 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}
0
+
+
+ 0
+ 24
+
+
+
+
+ 16777215
+ 24
+
+
Auto playback last played song on startup if available
@@ -883,6 +907,12 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}
30
+
+
+ 30
+ 30
+
+
<html><head/><body><p><img src=":/ico_warning.png"/></p></body></html>
@@ -1431,7 +1461,13 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}
0
- 40
+ 30
+
+
+
+
+ 16777215
+ 30
@@ -1453,13 +1489,13 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}
0
- 40
+ 30
16777215
- 40
+ 30
@@ -1498,8 +1534,8 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}
- 16777215
- 180
+ 180
+ 16777215
@@ -1934,8 +1970,14 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}
-
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
+
- 9
+ 0
2
@@ -1960,6 +2002,12 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}
30
+
+
+ 30
+ 30
+
+
<html><head/><body><p><img src=":/ico_warning.png"/></p></body></html>
@@ -1968,11 +2016,23 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}
-
-
+
0
0
+
+
+ 0
+ 30
+
+
+
+
+ 16777215
+ 30
+
+
true
@@ -2827,6 +2887,9 @@ outline: none;
+
+ 0
+
2
@@ -2847,6 +2910,12 @@ outline: none;
30
+
+
+ 30
+ 30
+
+
<html><head/><body><p><img src=":/ico_warning.png"/></p></body></html>
@@ -2855,11 +2924,23 @@ outline: none;
-
-
+
0
0
+
+
+ 0
+ 30
+
+
+
+
+ 16777215
+ 30
+
+
true
@@ -3226,292 +3307,105 @@ outline: none;
-
-
+
-
+
0
0
- Auto Day / Night
+ Boot Screen
-
-
- 0
-
-
- 0
-
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
+
+
-
-
+
-
+
0
0
-
-
-
-
-
-
- 0
- 0
-
-
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
-
-
- 0
- 0
-
-
-
-
- 120
- 32
-
-
-
-
- 120
- 32
-
-
-
-
- 10
-
-
-
- Start Day
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 100
- 32
-
-
-
-
- 16777215
- 32
-
-
-
- QSpinBox::up-button { width: 32px; height: 32px;
-subcontrol-origin: margin;
-subcontrol-position: center right;
-}
-QSpinBox::down-button { width: 32px; height: 32px;
-subcontrol-origin: margin;
-subcontrol-position: center left;
-}
-
-
- 23
-
-
- 8
-
-
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
-
-
- 0
-
-
- 0
-
-
- 0
-
-
- 0
-
-
-
-
-
-
- 0
- 0
-
-
-
-
- 120
- 32
-
-
-
-
- 120
- 32
-
-
-
- Start Night
-
-
- Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 100
- 32
-
-
-
-
- 16777215
- 32
-
-
-
- QSpinBox::up-button { width: 32px; height: 32px;
-subcontrol-origin: margin;
-subcontrol-position: center right;
-}
-QSpinBox::down-button { width: 32px; height: 32px;
-subcontrol-origin: margin;
-subcontrol-position: center left;
-}
-
-
- 23
-
-
- 18
-
-
-
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
- <html><head/><body><p><img src=":/ico_info.png"/></p></body></html>
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 0
- 32
-
-
-
-
- 16777215
- 32
-
-
-
-
- 10
- true
-
-
-
- Needs a RTC!
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 80
- 32
-
-
-
-
- 80
- 32
-
-
-
- Disable
-
-
-
-
+
+
+ 150
+ 0
+
+
+
+
+ 150
+ 16777215
+
+
+
+ Animation
+
+
+ true
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 150
+ 0
+
+
+
+
+ 150
+ 16777215
+
+
+
+ Classic
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 150
+ 0
+
+
+
+ Custom
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 40
+ 20
+
+
+
+
@@ -3830,6 +3724,9 @@ subcontrol-position: center left;
+
+ 0
+
2
@@ -3850,6 +3747,12 @@ subcontrol-position: center left;
30
+
+
+ 30
+ 30
+
+
<html><head/><body><p><img src=":/ico_warning.png"/></p></body></html>
@@ -3858,11 +3761,23 @@ subcontrol-position: center left;
-
-
+
0
0
+
+
+ 0
+ 30
+
+
+
+
+ 16777215
+ 30
+
+
true
@@ -5593,6 +5508,296 @@ subcontrol-position: center left;
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Auto Day / Night
+
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 120
+ 32
+
+
+
+
+ 120
+ 32
+
+
+
+
+ 10
+
+
+
+ Start Day
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 100
+ 32
+
+
+
+
+ 16777215
+ 32
+
+
+
+ QSpinBox::up-button { width: 32px; height: 32px;
+subcontrol-origin: margin;
+subcontrol-position: center right;
+}
+QSpinBox::down-button { width: 32px; height: 32px;
+subcontrol-origin: margin;
+subcontrol-position: center left;
+}
+
+
+ 23
+
+
+ 8
+
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
+ 0
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 120
+ 32
+
+
+
+
+ 120
+ 32
+
+
+
+ Start Night
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 100
+ 32
+
+
+
+
+ 16777215
+ 32
+
+
+
+ QSpinBox::up-button { width: 32px; height: 32px;
+subcontrol-origin: margin;
+subcontrol-position: center right;
+}
+QSpinBox::down-button { width: 32px; height: 32px;
+subcontrol-origin: margin;
+subcontrol-position: center left;
+}
+
+
+ 23
+
+
+ 18
+
+
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ <html><head/><body><p><img src=":/ico_info.png"/></p></body></html>
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 32
+
+
+
+
+ 16777215
+ 32
+
+
+
+
+ 10
+ true
+
+
+
+ Needs a RTC!
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 80
+ 32
+
+
+
+
+ 80
+ 32
+
+
+
+ Disable
+
+
+
+
+
+
+
+
+
-
@@ -5616,7 +5821,7 @@ subcontrol-position: center left;
- 9
+ 0
2
@@ -5641,6 +5846,12 @@ subcontrol-position: center left;
30
+
+
+ 30
+ 30
+
+
<html><head/><body><p><img src=":/ico_warning.png"/></p></body></html>
@@ -5649,11 +5860,23 @@ subcontrol-position: center left;
-
-
+
0
0
+
+
+ 0
+ 30
+
+
+
+
+ 16777215
+ 30
+
+
true
@@ -6450,7 +6673,7 @@ or lower
-
-
+
0
@@ -6459,7 +6682,7 @@ or lower
- 9
+ 0
2
@@ -6473,11 +6696,23 @@ or lower
-
-
+
0
0
+
+
+ 30
+ 30
+
+
+
+
+ 30
+ 30
+
+
<html><head/><body><p><img src=":/ico_warning.png"/></p></body></html>
@@ -6486,11 +6721,23 @@ or lower
-
-
+
0
0
+
+
+ 0
+ 30
+
+
+
+
+ 16777215
+ 30
+
+
true
@@ -7428,6 +7675,69 @@ QComboBox::item:selected {
+ -
+
+
+ 0
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 30
+ 30
+
+
+
+
+ 30
+ 30
+
+
+
+ <html><head/><body><p><img src=":/ico_warning.png"/></p></body></html>
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 30
+
+
+
+
+ 16777215
+ 30
+
+
+
+
+ 10
+ true
+
+
+
+ This must be selected if any hw config should be done on save!
+
+
+
+
+
-
@@ -7454,36 +7764,6 @@ QComboBox::item:selected {
- -
-
-
-
-
-
- <html><head/><body><p><img src=":/ico_warning.png"/></p></body></html>
-
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 10
- true
-
-
-
- This must be selected if any hw config should be done on save!
-
-
-
-
-
diff --git a/src/autoapp/autoapp.cpp b/src/autoapp/autoapp.cpp
index 55c6085..e12759b 100644
--- a/src/autoapp/autoapp.cpp
+++ b/src/autoapp/autoapp.cpp
@@ -239,7 +239,7 @@ int main(int argc, char* argv[])
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::TriggerAppStart, [&app]() {
OPENAUTO_LOG(info) << "[CS] Manual start android auto entity by reset usb.";
if (std::ifstream("/tmp/android_device")) {
- system("/usr/local/bin/autoapp_helper usbreset &");
+ system("/usr/local/bin/autoapp_helper usbreset");
app->waitForUSBDevice();
}
});
@@ -251,7 +251,6 @@ int main(int argc, char* argv[])
usleep(500000);
app->stop();
} else {
- //app->onAndroidAutoQuit();
app->stop();
}
});
@@ -261,6 +260,7 @@ int main(int argc, char* argv[])
app->waitForUSBDevice();
auto result = qApplication.exec();
+
std::for_each(threadPool.begin(), threadPool.end(), std::bind(&std::thread::join, std::placeholders::_1));
libusb_exit(usbContext);