diff --git a/include/f1x/openauto/autoapp/UI/SettingsWindow.hpp b/include/f1x/openauto/autoapp/UI/SettingsWindow.hpp index 2c63a4a..0a136a6 100644 --- a/include/f1x/openauto/autoapp/UI/SettingsWindow.hpp +++ b/include/f1x/openauto/autoapp/UI/SettingsWindow.hpp @@ -55,6 +55,7 @@ private slots: void onShowBindings(); void onUpdateSystemVolume(int value); void onUpdateSystemCapture(int value); + void setTime(); private slots: void show_tab1(); diff --git a/src/autoapp/UI/MainWindow.cpp b/src/autoapp/UI/MainWindow.cpp index 1712473..3b1374c 100644 --- a/src/autoapp/UI/MainWindow.cpp +++ b/src/autoapp/UI/MainWindow.cpp @@ -569,6 +569,9 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi // init alpha values ui_->horizontalSliderAlpha->setValue(int(configuration->getAlphaTrans())); MainWindow::on_horizontalSliderAlpha_valueChanged(int(configuration->getAlphaTrans())); + + // bt media controls + ui_->btControlWidget->hide(); } MainWindow::~MainWindow() @@ -1059,7 +1062,7 @@ void f1x::openauto::autoapp::ui::MainWindow::showTime() ui_->systemConfigInProgress->show(); } if (enablePairingFile.exists()) { - ui_->systemConfigInProgress->setText("Bluetooth Pairing enabled!"); + ui_->systemConfigInProgress->setText("Auto Bluetooth Pairing enabled for 120 seconds!"); ui_->pushButtonDebug->hide(); ui_->pushButtonDebug2->hide(); ui_->systemConfigInProgress->show(); diff --git a/src/autoapp/UI/SettingsWindow.cpp b/src/autoapp/UI/SettingsWindow.cpp index 4514791..876750f 100644 --- a/src/autoapp/UI/SettingsWindow.cpp +++ b/src/autoapp/UI/SettingsWindow.cpp @@ -1,4 +1,4 @@ -/* +/* * This file is part of openauto project. * Copyright (C) 2018 f1x.studio (Michal Szwaj) * @@ -23,6 +23,7 @@ #include #include #include +#include namespace f1x { @@ -42,6 +43,7 @@ SettingsWindow::SettingsWindow(configuration::IConfiguration::Pointer configurat connect(ui_->pushButtonCancel, &QPushButton::clicked, this, &SettingsWindow::close); connect(ui_->pushButtonSave, &QPushButton::clicked, this, &SettingsWindow::onSave); connect(ui_->pushButtonUnpair , &QPushButton::clicked, this, &SettingsWindow::unpairAll); + 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_->radioButtonUseExternalBluetoothAdapter, &QRadioButton::clicked, [&](bool checked) { ui_->lineEditExternalBluetoothAdapterAddress->setEnabled(checked); }); @@ -53,6 +55,7 @@ SettingsWindow::SettingsWindow(configuration::IConfiguration::Pointer configurat connect(ui_->pushButtonShowBindings, &QPushButton::clicked, this, &SettingsWindow::onShowBindings); connect(ui_->horizontalSliderSystemVolume, &QSlider::valueChanged, this, &SettingsWindow::onUpdateSystemVolume); connect(ui_->horizontalSliderSystemCapture, &QSlider::valueChanged, this, &SettingsWindow::onUpdateSystemCapture); + connect(ui_->pushButtonSetTime, &QPushButton::clicked, this, &SettingsWindow::setTime); // menu ui_->tab1->show(); ui_->tab2->hide(); @@ -71,6 +74,12 @@ SettingsWindow::SettingsWindow(configuration::IConfiguration::Pointer configurat connect(ui_->pushButtonTab6, &QPushButton::clicked, this, &SettingsWindow::show_tab6); connect(ui_->pushButtonTab7, &QPushButton::clicked, this, &SettingsWindow::show_tab7); connect(ui_->pushButtonTab8, &QPushButton::clicked, this, &SettingsWindow::show_tab8); + + QTime time=QTime::currentTime(); + QString time_text_hour=time.toString("hh"); + QString time_text_minute=time.toString("mm"); + ui_->spinBoxHour->setValue((time_text_hour).toInt()); + ui_->spinBoxMinute->setValue((time_text_minute).toInt()); } SettingsWindow::~SettingsWindow() @@ -394,6 +403,17 @@ void SettingsWindow::unpairAll() system("/usr/local/bin/crankshaft bluetooth unpair &"); } +void SettingsWindow::setTime() +{ + // generate param string for autoapp_helper + std::string params; + params.append( std::to_string(ui_->spinBoxHour->value()) ); + params.append("#"); + params.append( std::to_string(ui_->spinBoxMinute->value()) ); + params.append("#"); + system((std::string("/usr/local/bin/autoapp_helper settime#") + std::string(params) + std::string(" &") ).c_str()); +} + void SettingsWindow::loadSystemValues() { // Generate param file diff --git a/src/autoapp/UI/mainwindow.ui b/src/autoapp/UI/mainwindow.ui index 9f05a84..4367e40 100644 --- a/src/autoapp/UI/mainwindow.ui +++ b/src/autoapp/UI/mainwindow.ui @@ -6,8 +6,8 @@ 0 0 - 800 - 837 + 823 + 840 @@ -62,18 +62,24 @@ 0 + + + 0 + 0 + + background-color: rgb(0, 0, 0); - 6 + 2 0 - 0 + 1 0 @@ -159,139 +165,191 @@ color: rgb(255, 255, 255); - - - 6 + + + + 0 + 0 + - - - - - 75 - true - - - - background-color: rgba(255, 255, 255, 0); + + + 0 + 28 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 8 + 75 + true + + + + background-color: rgba(255, 255, 255, 0); color: rgb(255, 255, 255); - - - BuildID - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - 75 - true - - - - background-color: rgba(255, 255, 255, 0); + + + BuildID + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + 75 + true + + + + background-color: rgba(255, 255, 255, 0); color: rgb(255, 255, 255); - - - USB Connected - - - Qt::AlignCenter - - - - - - - - 75 - true - - - - background-color: rgba(255, 255, 255, 0); + + + USB Connected + + + Qt::AlignCenter + + + + + + + + 75 + true + + + + background-color: rgba(255, 255, 255, 0); color: rgb(0, 102, 255); - - - BT-Device - - - Qt::AlignCenter - - - - - - - 6 - - - - - - 80 - 0 - - - - - 80 - 16777215 - - - - - 0 - 0 - - - - background-color: rgb(32, 74, 135); + + + BT-Device + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 80 + 24 + + + + + 80 + 16777215 + + + + + 0 + 0 + + + + background-color: rgb(32, 74, 135); color: rgb(239, 239, 239); - - - BT-Pairing - - - - - - - - 100 - 0 - - - - - 100 - 16777215 - - - - - 75 - true - - - - background-color: rgba(255, 255, 255, 0); + + + BT-Pairing + + + + + + + + + + 0 + 0 + + + + + 100 + 16777215 + + + + + 75 + true + + + + background-color: rgba(255, 255, 255, 0); color: rgb(255, 255, 255); - - - 12:00:00 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - + + + 12:00:00 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + 0 + 0 + + + + + 0 + 1 + + + + background-color: rgba(255,255,255,0.3); + + + Qt::Horizontal + + @@ -1001,7 +1059,7 @@ color: rgb(255, 255, 255); - + @@ -1075,6 +1133,133 @@ color: rgb(255, 255, 255); + + + + + 0 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 75 + true + + + + background-color: rgba(114, 159, 207, 0.01); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); +color: rgb(255, 255, 255); + + + Play + + + + + + + + 0 + 0 + + + + + 75 + true + + + + background-color: rgba(114, 159, 207, 0.01); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); +color: rgb(255, 255, 255); + + + Pause + + + + + + + + 0 + 0 + + + + + 75 + true + + + + background-color: rgba(114, 159, 207, 0.01); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); +color: rgb(255, 255, 255); + + + Prev + + + + + + + + 0 + 0 + + + + + 75 + true + + + + background-color: rgba(114, 159, 207, 0.01); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); +color: rgb(255, 255, 255); + + + Next + + + + + + diff --git a/src/autoapp/UI/settingswindow.ui b/src/autoapp/UI/settingswindow.ui index df628af..ee42d00 100644 --- a/src/autoapp/UI/settingswindow.ui +++ b/src/autoapp/UI/settingswindow.ui @@ -7,7 +7,7 @@ 0 0 800 - 2770 + 2925 @@ -703,6 +703,84 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;} + + + + + 0 + 0 + + + + + 4 + + + 4 + + + + + + 0 + 0 + + + + + 0 + 32 + + + + + false + true + + + + QFrame::NoFrame + + + QFrame::Plain + + + Layer index + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 100 + 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; +} + + + + + + @@ -726,11 +804,17 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;} 0 + + + 0 + 32 + + Margin height - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter @@ -766,78 +850,6 @@ subcontrol-position: center left; - - - - - 0 - 0 - - - - - 4 - - - 4 - - - - - - 0 - 0 - - - - - false - true - - - - QFrame::NoFrame - - - QFrame::Plain - - - Layer index - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - - - - - - 0 - 0 - - - - - 100 - 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; -} - - - - - - @@ -861,6 +873,12 @@ subcontrol-position: center left; 0 + + + 0 + 32 + + Margin width @@ -1444,6 +1462,59 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;} + + + + 9 + + + 2 + + + 9 + + + 2 + + + + + + 0 + 0 + + + + + 30 + 30 + + + + <html><head/><body><p><img src=":/ico_warning.png"/></p></body></html> + + + + + + + + 0 + 0 + + + + + true + + + + If audio device is changed pulseaudio daemon will restart - reconnect bluetooth is needed to work again! + + + + + @@ -1784,18 +1855,43 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;} - Set pairable for 120 secs after startup + Set pairable for 120 seconds after startup - - + + + Qt::Horizontal + + - 0 + 40 20 + + + + + + + 0 + 0 + + + + + 200 + 20 + + + + + 75 + true + + background-color: rgb(164, 0, 0); @@ -1981,7 +2077,7 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;} 2 - + @@ -2000,7 +2096,7 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;} - + @@ -2024,16 +2120,35 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;} - - - - 8 - true - - - - The Hotspot is only available in dev mode and overrides client mode! SSID is fixed. + + + + 0 + 0 + + + + + + <html><head/><body><p><img src=":/ico_info.png"/></p></body></html> + + + + + + + + 10 + true + + + + The Hotspot is only available in dev mode and overrides client mode! SSID is fixed. + + + + @@ -4468,6 +4583,182 @@ subcontrol-position: center left; 2 + + + + + 0 + 0 + + + + System time + + + + 2 + + + 2 + + + + + + 0 + 0 + + + + + 2 + + + 2 + + + + + + 0 + 0 + + + + + 60 + 0 + + + + Hour + + + + + + + + 0 + 0 + + + + + 100 + 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 + + + + + + + + 0 + 0 + + + + + 60 + 0 + + + + Minute + + + + + + + + 0 + 0 + + + + + 100 + 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; +} + + + 59 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 200 + 20 + + + + + 75 + true + + + + background-color: rgb(78, 154, 6); + + + Set current time now! + + + + + + + + +