Remove alpha slider mainwindow / add brightness day/night control to settings / update system notify
This commit is contained in:
parent
a7fb685a65
commit
1ff179eca4
@ -92,14 +92,13 @@ signals:
|
||||
private slots:
|
||||
void on_horizontalSliderBrightness_valueChanged(int value);
|
||||
void on_horizontalSliderVolume_valueChanged(int value);
|
||||
void on_horizontalSliderAlpha_valueChanged(int value);
|
||||
void updateAlpha();
|
||||
|
||||
private slots:
|
||||
void on_pushButtonBrightness_clicked();
|
||||
void on_pushButtonBrightness2_clicked();
|
||||
void on_pushButtonVolume_clicked();
|
||||
void on_pushButtonVolume2_clicked();
|
||||
void on_pushButtonAlpha_clicked();
|
||||
void switchGuiToDay();
|
||||
void switchGuiToNight();
|
||||
void showTime();
|
||||
@ -158,7 +157,8 @@ private:
|
||||
QFile *brightnessFileAlt;
|
||||
char brightness_str[6];
|
||||
char volume_str[6];
|
||||
char alpha_str[6];
|
||||
//char alpha_str[6];
|
||||
int alpha_current_str;
|
||||
QString bversion;
|
||||
QString bdate;
|
||||
|
||||
|
@ -54,6 +54,8 @@ private slots:
|
||||
void onResetToDefaults();
|
||||
void onUpdateScreenDPI(int value);
|
||||
void onUpdateAlphaTrans(int value);
|
||||
void onUpdateBrightnessDay(int value);
|
||||
void onUpdateBrightnessNight(int value);
|
||||
void onShowBindings();
|
||||
void onUpdateSystemVolume(int value);
|
||||
void onUpdateSystemCapture(int value);
|
||||
|
@ -160,7 +160,6 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
|
||||
connect(ui_->pushButtonBrightness2, &QPushButton::clicked, this, &MainWindow::showBrightnessSlider);
|
||||
connect(ui_->pushButtonVolume, &QPushButton::clicked, this, &MainWindow::showVolumeSlider);
|
||||
connect(ui_->pushButtonVolume2, &QPushButton::clicked, this, &MainWindow::showVolumeSlider);
|
||||
connect(ui_->pushButtonAlpha, &QPushButton::clicked, this, &MainWindow::showAlphaSlider);
|
||||
connect(ui_->pushButtonDebug, &QPushButton::clicked, this, &MainWindow::createDebuglog);
|
||||
connect(ui_->pushButtonDebug2, &QPushButton::clicked, this, &MainWindow::createDebuglog);
|
||||
connect(ui_->pushButtonBluetooth, &QPushButton::clicked, this, &MainWindow::setPairable);
|
||||
@ -220,7 +219,6 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
|
||||
ui_->pushButtonDebug2->hide();
|
||||
}
|
||||
|
||||
ui_->systemConfigInProgress->hide();
|
||||
ui_->pushButtonLock->hide();
|
||||
ui_->pushButtonLock2->hide();
|
||||
ui_->btDevice->hide();
|
||||
@ -234,10 +232,6 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
|
||||
// as default hide brightness slider
|
||||
ui_->BrightnessSliderControl->hide();
|
||||
|
||||
// as default hide alpha slider and button
|
||||
ui_->pushButtonAlpha->hide();
|
||||
ui_->AlphaSliderControl->hide();
|
||||
|
||||
// as default hide volume slider player
|
||||
ui_->VolumeSliderControlPlayer->hide();
|
||||
|
||||
@ -510,14 +504,9 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
|
||||
ui_->pushButtonToggleGUI2->hide();
|
||||
}
|
||||
|
||||
// hide alpha controls if enabled in settings
|
||||
//if (!configuration->hideAlpha()) {
|
||||
// ui_->pushButtonAlpha->show();
|
||||
//}
|
||||
|
||||
// init alpha values
|
||||
ui_->horizontalSliderAlpha->setValue(int(configuration->getAlphaTrans()));
|
||||
MainWindow::on_horizontalSliderAlpha_valueChanged(int(configuration->getAlphaTrans()));
|
||||
//MainWindow::updateAlpha(int(configuration->getAlphaTrans()));
|
||||
MainWindow::updateAlpha();
|
||||
|
||||
// Hide auto day/night if needed
|
||||
if (this->lightsensor) {
|
||||
@ -648,7 +637,6 @@ void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonBrightness_clicked()
|
||||
}
|
||||
ui_->BrightnessSliderControl->show();
|
||||
ui_->VolumeSliderControl->hide();
|
||||
ui_->AlphaSliderControl->hide();
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonBrightness2_clicked()
|
||||
@ -680,7 +668,6 @@ void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonBrightness2_clicked()
|
||||
}
|
||||
ui_->BrightnessSliderControl->show();
|
||||
ui_->VolumeSliderControl->hide();
|
||||
ui_->AlphaSliderControl->hide();
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonVolume_clicked()
|
||||
@ -694,8 +681,6 @@ void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonVolume_clicked()
|
||||
}
|
||||
ui_->VolumeSliderControl->show();
|
||||
ui_->BrightnessSliderControl->hide();
|
||||
ui_->AlphaSliderControl->hide();
|
||||
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonVolume2_clicked()
|
||||
@ -709,14 +694,6 @@ void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonVolume2_clicked()
|
||||
}
|
||||
ui_->VolumeSliderControl->show();
|
||||
ui_->BrightnessSliderControl->hide();
|
||||
ui_->AlphaSliderControl->hide();
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonAlpha_clicked()
|
||||
{
|
||||
ui_->AlphaSliderControl->show();
|
||||
ui_->VolumeSliderControl->hide();
|
||||
ui_->BrightnessSliderControl->hide();
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_horizontalSliderBrightness_valueChanged(int value)
|
||||
@ -752,41 +729,43 @@ void f1x::openauto::autoapp::ui::MainWindow::on_horizontalSliderVolume_valueChan
|
||||
system(("/usr/local/bin/autoapp_helper setvolume " + std::to_string(value) + "&").c_str());
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_horizontalSliderAlpha_valueChanged(int value)
|
||||
void f1x::openauto::autoapp::ui::MainWindow::updateAlpha()
|
||||
{
|
||||
int n = snprintf(this->alpha_str, 5, "%d", value);
|
||||
double alpha = value/100.0;
|
||||
QString alp=QString::number(alpha);
|
||||
ui_->alphaValueLabel->setText(alp);
|
||||
ui_->pushButtonAlpha->setStyleSheet( "background-color: rgba(243, 243, 243, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonExit->setStyleSheet( "background-color: rgba(164, 0, 0, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonShutdown->setStyleSheet( "background-color: rgba(239, 41, 41, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonReboot->setStyleSheet( "background-color: rgba(252, 175, 62, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonCancel->setStyleSheet( "background-color: rgba(32, 74, 135, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonBrightness->setStyleSheet( "background-color: rgba(245, 121, 0, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonVolume->setStyleSheet( "background-color: rgba(64, 191, 191, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonAlpha->setStyleSheet( "background-color: rgba(173, 127, 168, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonLock->setStyleSheet( "background-color: rgba(15, 54, 5, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonSettings->setStyleSheet( "background-color: rgba(138, 226, 52, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonDay->setStyleSheet( "background: rgba(252, 233, 79, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonNight->setStyleSheet( "background-color: rgba(114, 159, 207, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonCameraShow->setStyleSheet( "background-color: rgba(100, 62, 4, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonWifi->setStyleSheet( "background-color: rgba(252, 175, 62, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonToggleGUI->setStyleSheet( "background-color: rgba(237, 164, 255, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButton_c1->setStyleSheet( "background-color: rgba(" + this->custom_button_color_c1 + ", " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
||||
ui_->pushButton_c2->setStyleSheet( "background-color: rgba(" + this->custom_button_color_c2 + ", " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
||||
ui_->pushButton_c3->setStyleSheet( "background-color: rgba(" + this->custom_button_color_c3 + ", " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
||||
ui_->pushButton_c4->setStyleSheet( "background-color: rgba(" + this->custom_button_color_c4 + ", " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
||||
ui_->pushButton_c5->setStyleSheet( "background-color: rgba(" + this->custom_button_color_c5 + ", " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
||||
ui_->pushButton_c6->setStyleSheet( "background-color: rgba(" + this->custom_button_color_c6 + ", " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
||||
ui_->pushButtonDummy1->setStyleSheet( "background-color: rgba(186, 189, 182, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonDummy2->setStyleSheet( "background-color: rgba(186, 189, 182, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonDummy3->setStyleSheet( "background-color: rgba(186, 189, 182, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonDebug->setStyleSheet( "background-color: rgba(85, 87, 83, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonMusic->setStyleSheet( "background-color: rgba(78, 154, 6, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
||||
ui_->pushButtonAndroidAuto->setStyleSheet( "background-color: rgba(48, 140, 198, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
||||
ui_->pushButtonNoDevice->setStyleSheet( "background-color: rgba(48, 140, 198, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
||||
ui_->pushButtonNoWiFiDevice->setStyleSheet( "background-color: rgba(252, 175, 62, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
||||
int value = configuration_->getAlphaTrans();
|
||||
//int n = snprintf(this->alpha_str, 5, "%d", value);
|
||||
|
||||
if (value != this->alpha_current_str) {
|
||||
this->alpha_current_str = value;
|
||||
double alpha = value/100.0;
|
||||
QString alp=QString::number(alpha);
|
||||
ui_->pushButtonExit->setStyleSheet( "background-color: rgba(164, 0, 0, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonShutdown->setStyleSheet( "background-color: rgba(239, 41, 41, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonReboot->setStyleSheet( "background-color: rgba(252, 175, 62, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonCancel->setStyleSheet( "background-color: rgba(32, 74, 135, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonBrightness->setStyleSheet( "background-color: rgba(245, 121, 0, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonVolume->setStyleSheet( "background-color: rgba(64, 191, 191, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonLock->setStyleSheet( "background-color: rgba(15, 54, 5, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonSettings->setStyleSheet( "background-color: rgba(138, 226, 52, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonDay->setStyleSheet( "background: rgba(252, 233, 79, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonNight->setStyleSheet( "background-color: rgba(114, 159, 207, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonCameraShow->setStyleSheet( "background-color: rgba(100, 62, 4, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonWifi->setStyleSheet( "background-color: rgba(252, 175, 62, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonToggleGUI->setStyleSheet( "background-color: rgba(237, 164, 255, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButton_c1->setStyleSheet( "background-color: rgba(" + this->custom_button_color_c1 + ", " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
||||
ui_->pushButton_c2->setStyleSheet( "background-color: rgba(" + this->custom_button_color_c2 + ", " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
||||
ui_->pushButton_c3->setStyleSheet( "background-color: rgba(" + this->custom_button_color_c3 + ", " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
||||
ui_->pushButton_c4->setStyleSheet( "background-color: rgba(" + this->custom_button_color_c4 + ", " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
||||
ui_->pushButton_c5->setStyleSheet( "background-color: rgba(" + this->custom_button_color_c5 + ", " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
||||
ui_->pushButton_c6->setStyleSheet( "background-color: rgba(" + this->custom_button_color_c6 + ", " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
||||
ui_->pushButtonDummy1->setStyleSheet( "background-color: rgba(186, 189, 182, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonDummy2->setStyleSheet( "background-color: rgba(186, 189, 182, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonDummy3->setStyleSheet( "background-color: rgba(186, 189, 182, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonDebug->setStyleSheet( "background-color: rgba(85, 87, 83, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
||||
ui_->pushButtonMusic->setStyleSheet( "background-color: rgba(78, 154, 6, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
||||
ui_->pushButtonAndroidAuto->setStyleSheet( "background-color: rgba(48, 140, 198, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
||||
ui_->pushButtonNoDevice->setStyleSheet( "background-color: rgba(48, 140, 198, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
||||
ui_->pushButtonNoWiFiDevice->setStyleSheet( "background-color: rgba(252, 175, 62, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
||||
}
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::switchGuiToNight()
|
||||
@ -869,7 +848,6 @@ void f1x::openauto::autoapp::ui::MainWindow::playerShow()
|
||||
ui_->VolumeSliderControlPlayer->show();
|
||||
ui_->VolumeSliderControl->hide();
|
||||
ui_->BrightnessSliderControl->hide();
|
||||
ui_->AlphaSliderControl->hide();
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::playerHide()
|
||||
@ -883,7 +861,6 @@ void f1x::openauto::autoapp::ui::MainWindow::playerHide()
|
||||
ui_->VolumeSliderControl->show();
|
||||
ui_->VolumeSliderControlPlayer->hide();
|
||||
ui_->BrightnessSliderControl->hide();
|
||||
ui_->AlphaSliderControl->hide();
|
||||
f1x::openauto::autoapp::ui::MainWindow::updateBG();
|
||||
f1x::openauto::autoapp::ui::MainWindow::tmpChanged();
|
||||
}
|
||||
@ -1437,41 +1414,37 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
|
||||
}
|
||||
}
|
||||
|
||||
// check the need for system messages
|
||||
QFileInfo configInProgressFile("/tmp/config_in_progress");
|
||||
QFileInfo debugInProgressFile("/tmp/debug_in_progress");
|
||||
QFileInfo enablePairingFile("/tmp/enable_pairing");
|
||||
|
||||
if (std::ifstream("/tmp/config_in_progress") || std::ifstream("/tmp/debug_in_progress") || std::ifstream("/tmp/enable_pairing")) {
|
||||
if (ui_->systemConfigInProgress->isVisible() == false) {
|
||||
if (ui_->SysinfoTopLeft->isVisible() == false) {
|
||||
if (std::ifstream("/tmp/config_in_progress")) {
|
||||
ui_->systemConfigInProgress->setText("System config in progress - please wait ...");
|
||||
ui_->pushButtonSettings->hide();
|
||||
ui_->pushButtonSettings2->hide();
|
||||
ui_->pushButtonLock->show();
|
||||
ui_->pushButtonLock2->show();
|
||||
ui_->systemConfigInProgress->show();
|
||||
ui_->SysinfoTopLeft->setText("Config in progress ...");
|
||||
ui_->SysinfoTopLeft->show();
|
||||
}
|
||||
if (std::ifstream("/tmp/debug_in_progress")) {
|
||||
ui_->systemConfigInProgress->setText("Creating debug.zip on /boot - please wait ...");
|
||||
ui_->pushButtonSettings->hide();
|
||||
ui_->pushButtonSettings2->hide();
|
||||
ui_->pushButtonDebug->hide();
|
||||
ui_->pushButtonDebug2->hide();
|
||||
ui_->pushButtonLock->show();
|
||||
ui_->pushButtonLock2->show();
|
||||
ui_->systemConfigInProgress->show();
|
||||
ui_->SysinfoTopLeft->setText("Creating debug.zip ...");
|
||||
ui_->SysinfoTopLeft->show();
|
||||
}
|
||||
if (std::ifstream("/tmp/enable_pairing")) {
|
||||
ui_->systemConfigInProgress->setText("Auto Bluetooth Pairing enabled for 120 seconds!");
|
||||
ui_->pushButtonDebug->hide();
|
||||
ui_->pushButtonDebug2->hide();
|
||||
ui_->systemConfigInProgress->show();
|
||||
ui_->SysinfoTopLeft->setText("Pairing enabled for 120 seconds!");
|
||||
ui_->SysinfoTopLeft->show();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (ui_->systemConfigInProgress->isVisible() == true) {
|
||||
ui_->systemConfigInProgress->hide();
|
||||
if (ui_->SysinfoTopLeft->isVisible() == true) {
|
||||
ui_->SysinfoTopLeft->setText("");
|
||||
ui_->SysinfoTopLeft->hide();
|
||||
ui_->pushButtonSettings->show();
|
||||
ui_->pushButtonSettings2->show();
|
||||
ui_->pushButtonLock->hide();
|
||||
@ -1653,16 +1626,6 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
|
||||
ui_->pushButtonToggleGUI2->show();
|
||||
}
|
||||
|
||||
// hide alpha controls if enabled in settings
|
||||
if (!this->configuration_->hideAlpha()) {
|
||||
ui_->pushButtonAlpha->show();
|
||||
} else {
|
||||
ui_->pushButtonAlpha->hide();
|
||||
}
|
||||
if (QString::number(this->configuration_->getAlphaTrans()) != QString::number(ui_->horizontalSliderAlpha->value())) {
|
||||
ui_->horizontalSliderAlpha->setValue(static_cast<int>(this->configuration_->getAlphaTrans()));
|
||||
}
|
||||
|
||||
// read value from tsl2561
|
||||
if (std::ifstream("/tmp/tsl2561") && this->configuration_->showLux()) {
|
||||
QFile paramFile("/tmp/tsl2561");
|
||||
@ -1683,4 +1646,5 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
|
||||
ui_->label_right->setText("");
|
||||
}
|
||||
}
|
||||
MainWindow::updateAlpha();
|
||||
}
|
||||
|
@ -50,6 +50,8 @@ SettingsWindow::SettingsWindow(configuration::IConfiguration::Pointer configurat
|
||||
connect(ui_->pushButtonUnpair , &QPushButton::clicked, this, &SettingsWindow::close);
|
||||
connect(ui_->horizontalSliderScreenDPI, &QSlider::valueChanged, this, &SettingsWindow::onUpdateScreenDPI);
|
||||
connect(ui_->horizontalSliderAlphaTrans, &QSlider::valueChanged, this, &SettingsWindow::onUpdateAlphaTrans);
|
||||
connect(ui_->horizontalSliderDay, &QSlider::valueChanged, this, &SettingsWindow::onUpdateBrightnessDay);
|
||||
connect(ui_->horizontalSliderNight, &QSlider::valueChanged, this, &SettingsWindow::onUpdateBrightnessNight);
|
||||
connect(ui_->radioButtonUseExternalBluetoothAdapter, &QRadioButton::clicked, [&](bool checked) { ui_->lineEditExternalBluetoothAdapterAddress->setEnabled(checked); });
|
||||
connect(ui_->radioButtonDisableBluetooth, &QRadioButton::clicked, [&]() { ui_->lineEditExternalBluetoothAdapterAddress->setEnabled(false); });
|
||||
connect(ui_->radioButtonUseLocalBluetoothAdapter, &QRadioButton::clicked, [&]() { ui_->lineEditExternalBluetoothAdapterAddress->setEnabled(false); });
|
||||
@ -79,7 +81,6 @@ SettingsWindow::SettingsWindow(configuration::IConfiguration::Pointer configurat
|
||||
ui_->labelBluetoothAdapterAddress->hide();
|
||||
ui_->lineEditExternalBluetoothAdapterAddress->hide();
|
||||
ui_->labelTestInProgress->hide();
|
||||
ui_->checkBoxHideAlpha->hide();
|
||||
|
||||
connect(ui_->pushButtonTab1, &QPushButton::clicked, this, &SettingsWindow::show_tab1);
|
||||
connect(ui_->pushButtonTab2, &QPushButton::clicked, this, &SettingsWindow::show_tab2);
|
||||
@ -131,7 +132,6 @@ void SettingsWindow::onSave()
|
||||
configuration_->oldGUI(ui_->checkBoxOldGUI->isChecked());
|
||||
configuration_->setAlphaTrans(static_cast<size_t>(ui_->horizontalSliderAlphaTrans->value()));
|
||||
configuration_->hideMenuToggle(ui_->checkBoxHideMenuToggle->isChecked());
|
||||
configuration_->hideAlpha(ui_->checkBoxHideAlpha->isChecked());
|
||||
configuration_->showLux(ui_->checkBoxShowLux->isChecked());
|
||||
configuration_->mp3AutoPlay(ui_->checkBoxAutoPlay->isChecked());
|
||||
|
||||
@ -282,6 +282,10 @@ void SettingsWindow::onSave()
|
||||
params.append("#");
|
||||
params.append( std::string(ui_->comboBoxDayNight->currentText().toStdString()) );
|
||||
params.append("#");
|
||||
params.append( std::to_string(ui_->horizontalSliderDay->value()) );
|
||||
params.append("#");
|
||||
params.append( std::to_string(ui_->horizontalSliderNight->value()) );
|
||||
params.append("#");
|
||||
|
||||
system((std::string("/usr/local/bin/autoapp_helper setparams#") + std::string(params) + std::string(" &") ).c_str());
|
||||
|
||||
@ -315,7 +319,6 @@ void SettingsWindow::load()
|
||||
ui_->checkBoxShowBigClock->setChecked(configuration_->showBigClock());
|
||||
ui_->checkBoxOldGUI->setChecked(configuration_->oldGUI());
|
||||
ui_->checkBoxHideMenuToggle->setChecked(configuration_->hideMenuToggle());
|
||||
ui_->checkBoxHideAlpha->setChecked(configuration_->hideAlpha());
|
||||
ui_->checkBoxShowLux->setChecked(configuration_->showLux());
|
||||
ui_->checkBoxAutoPlay->setChecked(configuration_->mp3AutoPlay());
|
||||
|
||||
@ -433,6 +436,16 @@ void SettingsWindow::onUpdateAlphaTrans(int value)
|
||||
ui_->labelAlphaTransValue->setText(QString::number(alpha));
|
||||
}
|
||||
|
||||
void SettingsWindow::onUpdateBrightnessDay(int value)
|
||||
{
|
||||
ui_->labelBrightnessDay->setText(QString::number(value));
|
||||
}
|
||||
|
||||
void SettingsWindow::onUpdateBrightnessNight(int value)
|
||||
{
|
||||
ui_->labelBrightnessNight->setText(QString::number(value));
|
||||
}
|
||||
|
||||
void SettingsWindow::onUpdateSystemVolume(int value)
|
||||
{
|
||||
ui_->labelSystemVolumeValue->setText(QString::number(value));
|
||||
@ -469,6 +482,26 @@ void SettingsWindow::loadSystemValues()
|
||||
system("/usr/local/bin/autoapp_helper getoutputs");
|
||||
system("/usr/local/bin/autoapp_helper getinputs");
|
||||
system("/usr/local/bin/autoapp_helper getparams");
|
||||
system("/usr/local/bin/autoapp_helper getbrightnessvalues");
|
||||
|
||||
// set brightness slider attribs
|
||||
QFile paramFile(QString("/tmp/br_values"));
|
||||
paramFile.open(QIODevice::ReadOnly);
|
||||
QTextStream data_param(¶mFile);
|
||||
QStringList brigthnessvalues = data_param.readAll().split("#");
|
||||
paramFile.close();
|
||||
|
||||
ui_->horizontalSliderDay->setMinimum(brigthnessvalues[0].toInt());
|
||||
ui_->horizontalSliderDay->setMaximum(brigthnessvalues[1].toInt());
|
||||
ui_->horizontalSliderDay->setSingleStep(brigthnessvalues[2].toInt());
|
||||
ui_->horizontalSliderDay->setTickInterval(brigthnessvalues[2].toInt());
|
||||
ui_->horizontalSliderDay->setValue(brigthnessvalues[3].toInt());
|
||||
|
||||
ui_->horizontalSliderNight->setMinimum(brigthnessvalues[0].toInt());
|
||||
ui_->horizontalSliderNight->setMaximum(brigthnessvalues[1].toInt());
|
||||
ui_->horizontalSliderNight->setSingleStep(brigthnessvalues[2].toInt());
|
||||
ui_->horizontalSliderNight->setTickInterval(brigthnessvalues[2].toInt());
|
||||
ui_->horizontalSliderNight->setValue(brigthnessvalues[4].toInt());
|
||||
|
||||
if (std::ifstream("/tmp/return_value")) {
|
||||
QFile paramFile(QString("/tmp/return_value"));
|
||||
|
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>862</width>
|
||||
<height>1419</height>
|
||||
<height>1351</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -855,39 +855,6 @@ outline: none;</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButtonAlpha">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgba(173, 127, 168, 0.5);
|
||||
border-radius: 4px;
|
||||
border: 2px solid rgba(255,255,255,0.5);
|
||||
outline: none;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset>
|
||||
<normalon>:/skin-hot.png</normalon>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>64</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButtonCameraShow">
|
||||
<property name="sizePolicy">
|
||||
@ -4110,47 +4077,6 @@ outline: none;</string>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="systemConfigInProgress">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(92, 231, 57);
|
||||
color: rgb(0, 0, 0);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>System messages</string>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="VolumeSliderControl" native="true">
|
||||
<property name="sizePolicy">
|
||||
@ -4535,110 +4461,6 @@ background-color: #6d6d6d;</string>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="AlphaSliderControl" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="Layout_Alpha">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QSlider" name="horizontalSliderAlpha">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}
|
||||
QSlider::handle:horizontal { background: rgb(173, 127, 168); height: 52px; width: 52px; margin: 0 0;};
|
||||
outline: none;</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="pageStep">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>50</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="alphaValueLabel">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(255, 255, 255);
|
||||
background-color: #6d6d6d;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0.5</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>963</width>
|
||||
<height>3062</height>
|
||||
<height>3194</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -390,19 +390,6 @@ outline: none;
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBoxHideAlpha">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Hide transparency controls on tile menu</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBoxShowLux">
|
||||
<property name="text">
|
||||
@ -431,7 +418,7 @@ outline: none;
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>2</number>
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSlider" name="horizontalSliderAlphaTrans">
|
||||
@ -468,7 +455,7 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="labelAlphaTransValue">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@ -476,7 +463,13 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>32</height>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
@ -487,6 +480,171 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBoxSliderDay">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Brightness Day</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_8">
|
||||
<property name="verticalSpacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="labelBrightnessDay">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSlider" name="horizontalSliderDay">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QSlider::handle:horizontal { background: white; height: 32px; width: 52px; margin: 0 0;}
|
||||
QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>50</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBoxSliderNight">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Brightness Night</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_17">
|
||||
<property name="leftMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="labelBrightnessNight">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSlider" name="horizontalSliderNight">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QSlider::handle:horizontal { background: white; height: 32px; width: 52px; margin: 0 0;}
|
||||
QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>50</number>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBoxMediaPlayer">
|
||||
<property name="sizePolicy">
|
||||
|
Loading…
x
Reference in New Issue
Block a user