From 14662664edbc2d276848044146a7eb9806537aa5 Mon Sep 17 00:00:00 2001 From: hawkeyexp Date: Wed, 5 Dec 2018 13:09:36 +0100 Subject: [PATCH] latest dev --- assets/aausb-hot.png | Bin 0 -> 5743 bytes assets/aawifi-hot.png | Bin 0 -> 5723 bytes assets/resources.qrc | 2 + .../f1x/openauto/autoapp/UI/ConnectDialog.hpp | 3 +- .../f1x/openauto/autoapp/UI/MainWindow.hpp | 4 + include/f1x/openauto/autoapp/UI/Warning.hpp | 30 + src/autoapp/Service/AndroidAutoEntity.cpp | 4 +- src/autoapp/Service/SensorService.cpp | 17 +- src/autoapp/Service/VideoService.cpp | 11 +- src/autoapp/UI/ConnectDialog.cpp | 46 +- src/autoapp/UI/MainWindow.cpp | 151 ++-- src/autoapp/UI/SettingsWindow.cpp | 40 +- src/autoapp/UI/Warning.cpp | 30 + src/autoapp/UI/connectdialog.ui | 382 +++++---- src/autoapp/UI/mainwindow.ui | 732 ++++++++++-------- src/autoapp/UI/settingswindow.ui | 37 +- src/autoapp/UI/warning.ui | 141 ++++ src/autoapp/autoapp.cpp | 36 +- 18 files changed, 1043 insertions(+), 623 deletions(-) create mode 100644 assets/aausb-hot.png create mode 100644 assets/aawifi-hot.png create mode 100644 include/f1x/openauto/autoapp/UI/Warning.hpp create mode 100644 src/autoapp/UI/Warning.cpp create mode 100644 src/autoapp/UI/warning.ui diff --git a/assets/aausb-hot.png b/assets/aausb-hot.png new file mode 100644 index 0000000000000000000000000000000000000000..559d426bf26d7dbb502bc8ceeb4bdcd79ed2f788 GIT binary patch literal 5743 zcmV-#7Le(QP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8ne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=#7F zm#dzCuDV}Om)Xxc-5*iagW6f%YCT6)Kcw@^302*7uJ3=ow?IFz9~hp;nqF(OsQLPO zWuCrPBnRBnHn|sDm8IYB07SdI+G_WD+x>?wGzTn2uIg~_P-{PbzxDe-2mS!qH*4R| z_TAI(B@6g|+w~K`!Ipk>0n>j7*xTA7CuOQ-8Sg0)d~E@8du5R%cu-Y`-)kfY@G;=m zTjt(LcC~aN8D4-;S9BosdW-zF0lVA$|CxyGwpRIZTN?;_R~i7r^Dy~qz=@XbZ&|^M zZIe3N@h%tu?Gf2qt;y|gTX9+|-9PKa54PGJ?7;Z#vcJXtZ?)Y&aG^=CzZJpF7qN{j zvh7kx@MPcTM1;$g4)+6(w*sA!Hvj%?2f}-z<@VZhg?+Q!+6eH%0+zRL9x}aH54e~P hUj*PH01L|h4*;0Zcv4lruR#C+002ovPDHLkV1fx+{jUH3 literal 0 HcmV?d00001 diff --git a/assets/aawifi-hot.png b/assets/aawifi-hot.png new file mode 100644 index 0000000000000000000000000000000000000000..2505c4d437a69d6855b7c5989518303706dedb37 GIT binary patch literal 5723 zcmV-h7NqHkP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnj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 8a5dba6..74a55be 100644 --- a/assets/resources.qrc +++ b/assets/resources.qrc @@ -5,6 +5,8 @@ ico_setting.png ico_info.png ico_bluetooth.png + aausb-hot.png + aawifi-hot.png cursor-hot.png power-hot.png settings-hot.png diff --git a/include/f1x/openauto/autoapp/UI/ConnectDialog.hpp b/include/f1x/openauto/autoapp/UI/ConnectDialog.hpp index c272247..13fde30 100644 --- a/include/f1x/openauto/autoapp/UI/ConnectDialog.hpp +++ b/include/f1x/openauto/autoapp/UI/ConnectDialog.hpp @@ -26,6 +26,8 @@ class ConnectDialog : public QDialog public: explicit ConnectDialog(boost::asio::io_service& ioService, aasdk::tcp::ITCPWrapper& tcpWrapper, openauto::autoapp::configuration::IRecentAddressesList& recentAddressesList, QWidget *parent = nullptr); ~ConnectDialog() override; + void autoconnect(); + void loadClientList(); signals: void connectToDevice(const QString& ipAddress); @@ -42,7 +44,6 @@ private slots: private: void insertIpAddress(const std::string& ipAddress); void loadRecentList(); - void loadTempRecentList(); void setControlsEnabledStatus(bool status); void connectHandler(const boost::system::error_code& ec, const std::string& ipAddress, aasdk::tcp::ITCPEndpoint::SocketPointer socket); diff --git a/include/f1x/openauto/autoapp/UI/MainWindow.hpp b/include/f1x/openauto/autoapp/UI/MainWindow.hpp index 18f05c4..34a0fe2 100644 --- a/include/f1x/openauto/autoapp/UI/MainWindow.hpp +++ b/include/f1x/openauto/autoapp/UI/MainWindow.hpp @@ -86,6 +86,8 @@ signals: void showAlphaSlider(); void showRearCam(); void hideRearCam(); + void TriggerAppStart(); + void TriggerAppStop(); private slots: void on_horizontalSliderBrightness_valueChanged(int value); @@ -143,6 +145,8 @@ private slots: void scanFiles(); void tmpChanged(); void setTrigger(); + void setRetryUSBConnect(); + void resetRetryUSBMessage(); private: Ui::MainWindow* ui_; diff --git a/include/f1x/openauto/autoapp/UI/Warning.hpp b/include/f1x/openauto/autoapp/UI/Warning.hpp new file mode 100644 index 0000000..0b72d93 --- /dev/null +++ b/include/f1x/openauto/autoapp/UI/Warning.hpp @@ -0,0 +1,30 @@ +#include + +namespace Ui { +class Warning; +} + +namespace f1x +{ +namespace openauto +{ +namespace autoapp +{ +namespace ui +{ + +class Warning : public QDialog +{ + Q_OBJECT + +public: + explicit Warning(QWidget *parent = nullptr); + ~Warning() override; + + Ui::Warning* ui_; +}; + +} +} +} +} diff --git a/src/autoapp/Service/AndroidAutoEntity.cpp b/src/autoapp/Service/AndroidAutoEntity.cpp index 50aabf8..81c6702 100644 --- a/src/autoapp/Service/AndroidAutoEntity.cpp +++ b/src/autoapp/Service/AndroidAutoEntity.cpp @@ -157,13 +157,13 @@ void AndroidAutoEntity::onServiceDiscoveryRequest(const aasdk::proto::messages:: aasdk::proto::messages::ServiceDiscoveryResponse serviceDiscoveryResponse; serviceDiscoveryResponse.mutable_channels()->Reserve(256); - serviceDiscoveryResponse.set_head_unit_name("OpenAuto"); + serviceDiscoveryResponse.set_head_unit_name("Crankshaft-NG"); serviceDiscoveryResponse.set_car_model("Universal"); serviceDiscoveryResponse.set_car_year("2018"); serviceDiscoveryResponse.set_car_serial("20180301"); serviceDiscoveryResponse.set_left_hand_drive_vehicle(configuration_->getHandednessOfTrafficType() == configuration::HandednessOfTrafficType::LEFT_HAND_DRIVE); serviceDiscoveryResponse.set_headunit_manufacturer("f1x"); - serviceDiscoveryResponse.set_headunit_model("OpenAuto Autoapp"); + serviceDiscoveryResponse.set_headunit_model("Crankshaft-NG Autoapp"); serviceDiscoveryResponse.set_sw_build("1"); serviceDiscoveryResponse.set_sw_version("1.0"); serviceDiscoveryResponse.set_can_play_native_media_during_vr(false); diff --git a/src/autoapp/Service/SensorService.cpp b/src/autoapp/Service/SensorService.cpp index 2308fef..6aa1489 100644 --- a/src/autoapp/Service/SensorService.cpp +++ b/src/autoapp/Service/SensorService.cpp @@ -19,8 +19,7 @@ #include #include #include -#include -#include +#include namespace f1x { @@ -123,16 +122,12 @@ void SensorService::sendDrivingStatusUnrestricted() void SensorService::sendNightData() { aasdk::proto::messages::SensorEventIndication indication; - - QFileInfo nightSwitchFile("/tmp/night_mode_enabled"); - bool nightSwitchExists = nightSwitchFile.exists(); - - if (!nightSwitchExists) { - OPENAUTO_LOG(error) << "[CS] [SensorService] Mode day triggered"; - indication.add_night_mode()->set_is_night(false); + if (!std::ifstream("/tmp/night_mode_enabled")) { + OPENAUTO_LOG(error) << "[CS] [SensorService] Mode day triggered"; + indication.add_night_mode()->set_is_night(false); } else { - indication.add_night_mode()->set_is_night(true); - OPENAUTO_LOG(error) << "[CS] [SensorService] Mode night triggered"; + indication.add_night_mode()->set_is_night(true); + OPENAUTO_LOG(error) << "[CS] [SensorService] Mode night triggered"; } auto promise = aasdk::channel::SendPromise::defer(strand_); diff --git a/src/autoapp/Service/VideoService.cpp b/src/autoapp/Service/VideoService.cpp index 6c680f6..35a363e 100644 --- a/src/autoapp/Service/VideoService.cpp +++ b/src/autoapp/Service/VideoService.cpp @@ -18,6 +18,7 @@ #include #include +#include namespace f1x { @@ -162,8 +163,14 @@ void VideoService::onVideoFocusRequest(const aasdk::proto::messages::VideoFocusR // stop video service on go back to openauto if (request.focus_mode() == 2) { - OPENAUTO_LOG(info) << "[VideoService] Stop video service..."; - VideoService::stop(); + OPENAUTO_LOG(info) << "[VideoService] Exit entity..."; + try { + if (!std::ifstream("/tmp/entityexit")) { + std::ofstream("/tmp/entityexit"); + } + } catch (...) { + OPENAUTO_LOG(error) << "[VideoService] Error in creating entityexit"; + } } } diff --git a/src/autoapp/UI/ConnectDialog.cpp b/src/autoapp/UI/ConnectDialog.cpp index 88ea194..45e7014 100644 --- a/src/autoapp/UI/ConnectDialog.cpp +++ b/src/autoapp/UI/ConnectDialog.cpp @@ -3,6 +3,7 @@ #include "ui_connectdialog.h" #include #include +#include namespace f1x { @@ -26,14 +27,11 @@ ConnectDialog::ConnectDialog(boost::asio::io_service& ioService, aasdk::tcp::ITC ui_->setupUi(this); connect(ui_->pushButtonCancel, &QPushButton::clicked, this, &ConnectDialog::close); connect(ui_->pushButtonConnect, &QPushButton::clicked, this, &ConnectDialog::onConnectButtonClicked); - connect(ui_->listViewRecent, &QListView::clicked, this, &ConnectDialog::onRecentAddressClicked); connect(this, &ConnectDialog::connectionSucceed, this, &ConnectDialog::onConnectionSucceed); connect(this, &ConnectDialog::connectionFailed, this, &ConnectDialog::onConnectionFailed); connect(ui_->pushButtonUpdate, &QPushButton::clicked, this, &ConnectDialog::onUpdateButtonClicked); - ui_->listViewRecent->setModel(&recentAddressesModel_); this->loadRecentList(); - loadTempRecentList(); ui_->progressBarConnect->hide(); ui_->lineEditIPAddress->setFocus(); @@ -59,13 +57,12 @@ void ConnectDialog::onConnectButtonClicked() { emit connectionFailed(QString(se.what())); } - loadTempRecentList(); } void ConnectDialog::onUpdateButtonClicked() { system("/usr/local/bin/autoapp_helper updaterecent"); - loadTempRecentList(); + loadClientList(); } void ConnectDialog::connectHandler(const boost::system::error_code& ec, const std::string& ipAddress, aasdk::tcp::ITCPEndpoint::SocketPointer socket) @@ -101,11 +98,6 @@ void ConnectDialog::onConnectionFailed(const QString& message) void ConnectDialog::onRecentAddressClicked(const QModelIndex& index) { const auto& recentAddressesList = recentAddressesList_.getList(); - - if(static_cast(index.row()) <= recentAddressesList.size()) - { - ui_->lineEditIPAddress->setText(QString::fromStdString(recentAddressesList.at(index.row()))); - } } void ConnectDialog::setControlsEnabledStatus(bool status) @@ -113,7 +105,6 @@ void ConnectDialog::setControlsEnabledStatus(bool status) ui_->pushButtonConnect->setVisible(status); ui_->pushButtonCancel->setEnabled(status); ui_->lineEditIPAddress->setEnabled(status); - ui_->listViewRecent->setEnabled(status); } void ConnectDialog::loadRecentList() @@ -129,19 +120,44 @@ void ConnectDialog::loadRecentList() recentAddressesModel_.setStringList(stringList); } -void ConnectDialog::loadTempRecentList() +void ConnectDialog::loadClientList() { - QFileInfo recentFile("/tmp/temp_recent_list"); - if (recentFile.exists()) { + int cleaner = ui_->listWidgetClients->count(); + while (cleaner > -1) { + ui_->listWidgetClients->takeItem(cleaner); + cleaner--; + } + + if (std::ifstream("/tmp/temp_recent_list")) { QFile versionFile(QString("/tmp/temp_recent_list")); versionFile.open(QIODevice::ReadOnly); QTextStream data(&versionFile); while (!data.atEnd()) { QString ip = data.readLine(); - ConnectDialog::insertIpAddress(ip.toStdString()); + ui_->listWidgetClients->addItem(ip); + ui_->lineEditIPAddress->setText(ip); } versionFile.close(); + + if (ui_->listWidgetClients->count() == 1) { + this->setControlsEnabledStatus(false); + + const auto& ipAddress = ui_->lineEditIPAddress->text().toStdString(); + auto socket = std::make_shared(ioService_); + ui_->progressBarConnect->show(); + try + { + tcpWrapper_.asyncConnect(*socket, ipAddress, 5277, std::bind(&ConnectDialog::connectHandler, this, std::placeholders::_1, ipAddress, socket)); + } + catch(const boost::system::system_error& se) + { + emit connectionFailed(QString(se.what())); + } + } + + } else { + ui_->lineEditIPAddress->setText(""); } } diff --git a/src/autoapp/UI/MainWindow.cpp b/src/autoapp/UI/MainWindow.cpp index 4c86105..6519b70 100644 --- a/src/autoapp/UI/MainWindow.cpp +++ b/src/autoapp/UI/MainWindow.cpp @@ -30,6 +30,11 @@ #include #include #include +#include +#include +#include +#include +#include namespace f1x { @@ -171,13 +176,14 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi connect(ui_->pushButtonMusic2, &QPushButton::clicked, this, &MainWindow::playerShow); connect(ui_->pushButtonBack, &QPushButton::clicked, this, &MainWindow::playerHide); connect(ui_->pushButtonPlayerBack, &QPushButton::clicked, this, &MainWindow::playerHide); + connect(ui_->pushButtonAndroidAuto, &QPushButton::clicked, this, &MainWindow::TriggerAppStart); + connect(ui_->pushButtonAndroidAuto, &QPushButton::clicked, this, &MainWindow::setRetryUSBConnect); + connect(ui_->pushButtonAndroidAuto2, &QPushButton::clicked, this, &MainWindow::TriggerAppStart); + connect(ui_->pushButtonAndroidAuto2, &QPushButton::clicked, this, &MainWindow::setRetryUSBConnect); // by default hide bluetooth button on init ui_->pushButtonBluetooth->hide(); - // by default hide bluetooth button on init - ui_->pushButtonAndroidAuto->hide(); - // by default hide media player ui_->mediaWidget->hide(); ui_->pushButtonUSB->hide(); @@ -185,6 +191,10 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi ui_->SysinfoTopLeft->hide(); ui_->pushButtonWifiSetup->hide(); + //ui_->pushButtonNoDevice->hide(); + ui_->pushButtonAndroidAuto->hide(); + ui_->pushButtonAndroidAuto2->hide(); + QTimer *timer=new QTimer(this); connect(timer, SIGNAL(timeout()),this,SLOT(showTime())); timer->start(1000); @@ -236,16 +246,16 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi ui_->exitWidget->hide(); ui_->horizontalWidgetPower->hide(); - // as default hide phone connected label - ui_->phoneConnected->hide(); - // as default hide muted button ui_->pushButtonUnMute->hide(); // hide wifi if not forced if (!this->wifiButtonForce) { - ui_->pushButtonWifi->hide(); + //ui_->pushButtonWifi->hide(); ui_->pushButtonWifi2->hide(); + ui_->AAWIFIWidget->hide(); + } else { + ui_->AAUSBWidget->hide(); } // set custom buttons if file enabled by trigger file @@ -406,8 +416,7 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi } // read param file - QFileInfo audioparamFile("/boot/crankshaft/volume"); - if (audioparamFile.exists()) { + if (std::ifstream("/boot/crankshaft/volume")) { QFile audioparamFile(QString("/boot/crankshaft/volume")); audioparamFile.open(QIODevice::ReadOnly); QTextStream data_param(&audioparamFile); @@ -503,9 +512,9 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi } // hide alpha controls if enabled in settings - if (!configuration->hideAlpha()) { - ui_->pushButtonAlpha->show(); - } + //if (!configuration->hideAlpha()) { + // ui_->pushButtonAlpha->show(); + //} // init alpha values ui_->horizontalSliderAlpha->setValue(int(configuration->getAlphaTrans())); @@ -776,6 +785,9 @@ void f1x::openauto::autoapp::ui::MainWindow::on_horizontalSliderAlpha_valueChang 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() @@ -1185,6 +1197,20 @@ void f1x::openauto::autoapp::ui::MainWindow::setTrigger() QTimer::singleShot(10000, this, SLOT(scanFolders())); } +void f1x::openauto::autoapp::ui::MainWindow::setRetryUSBConnect() +{ + ui_->SysinfoTopLeft->setText("Trying USB reconnect ..."); + ui_->SysinfoTopLeft->show(); + + QTimer::singleShot(10000, this, SLOT(resetRetryUSBMessage())); +} + +void f1x::openauto::autoapp::ui::MainWindow::resetRetryUSBMessage() +{ + ui_->SysinfoTopLeft->setText(""); + ui_->SysinfoTopLeft->hide(); +} + void f1x::openauto::autoapp::ui::MainWindow::scanFolders() { try { @@ -1317,17 +1343,26 @@ void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonBackToPlayer_clicked() void f1x::openauto::autoapp::ui::MainWindow::on_StateChanged(QMediaPlayer::State state) { if (state == QMediaPlayer::StoppedState || state == QMediaPlayer::PausedState) { - system("rm -f /tmp/media_playing"); + std::remove("/tmp/media_playing"); } else { - system("touch /tmp/media_playing"); + std::ofstream("/tmp/media_playing"); } } void f1x::openauto::autoapp::ui::MainWindow::tmpChanged() { + try { + if (std::ifstream("/tmp/entityexit")) { + MainWindow::TriggerAppStop(); + usleep(1000000); + std::remove("/tmp/entityexit"); + } + } catch (...) { + OPENAUTO_LOG(error) << "[OpenAuto] Error in entityexit"; + } + // check if system is in display off mode (tap2wake) - QFileInfo blankFile("/tmp/blankscreen"); - if (blankFile.exists()) { + if (std::ifstream("/tmp/blankscreen")) { if (ui_->centralWidget->isVisible() == true) { ui_->centralWidget->hide(); } @@ -1338,8 +1373,7 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged() } // check if custom command needs black background - QFileInfo blackFile("/tmp/blackscreen"); - if (blackFile.exists()) { + if (std::ifstream("/tmp/blackscreen")) { if (ui_->centralWidget->isVisible() == true) { ui_->centralWidget->hide(); this->setStyleSheet("QMainWindow {background-color: rgb(0,0,0);}"); @@ -1353,15 +1387,18 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged() } // check if phone is conencted to usb - QFileInfo phoneConnectedFile("/tmp/android_device"); - if (phoneConnectedFile.exists()) { - if (ui_->phoneConnected->isVisible() == false) { - ui_->phoneConnected->setText("USB connected"); - ui_->phoneConnected->show(); + + if (std::ifstream("/tmp/android_device")) { + if (ui_->pushButtonAndroidAuto->isVisible() == false) { + ui_->pushButtonAndroidAuto->show(); + ui_->pushButtonAndroidAuto2->show(); + ui_->pushButtonNoDevice->hide(); } } else { - if (ui_->phoneConnected->isVisible() == true) { - ui_->phoneConnected->hide(); + if (ui_->pushButtonAndroidAuto->isVisible() == true) { + ui_->pushButtonAndroidAuto->hide(); + ui_->pushButtonAndroidAuto2->hide(); + ui_->pushButtonNoDevice->show(); } } @@ -1380,8 +1417,7 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged() } // check if a device is connected via bluetooth - QFileInfo phoneBTConnectedFile("/tmp/btdevice"); - if (phoneBTConnectedFile.exists()) { + if (std::ifstream("/tmp/btdevice")) { if (ui_->btDevice->isVisible() == false) { QFile phoneBTData(QString("/tmp/btdevice")); phoneBTData.open(QIODevice::ReadOnly); @@ -1402,9 +1438,9 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged() QFileInfo debugInProgressFile("/tmp/debug_in_progress"); QFileInfo enablePairingFile("/tmp/enable_pairing"); - if (configInProgressFile.exists() || debugInProgressFile.exists() || enablePairingFile.exists()) { + if (std::ifstream("/tmp/config_in_progress") || std::ifstream("/tmp/debug_in_progress") || std::ifstream("/tmp/enable_pairing")) { if (ui_->systemConfigInProgress->isVisible() == false) { - if (configInProgressFile.exists()) { + if (std::ifstream("/tmp/config_in_progress")) { ui_->systemConfigInProgress->setText("System config in progress - please wait ..."); ui_->pushButtonSettings->hide(); ui_->pushButtonSettings2->hide(); @@ -1412,7 +1448,7 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged() ui_->pushButtonLock2->show(); ui_->systemConfigInProgress->show(); } - if (debugInProgressFile.exists()) { + if (std::ifstream("/tmp/debug_in_progress")) { ui_->systemConfigInProgress->setText("Creating debug.zip on /boot - please wait ..."); ui_->pushButtonSettings->hide(); ui_->pushButtonSettings2->hide(); @@ -1422,7 +1458,7 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged() ui_->pushButtonLock2->show(); ui_->systemConfigInProgress->show(); } - if (enablePairingFile.exists()) { + if (std::ifstream("/tmp/enable_pairing")) { ui_->systemConfigInProgress->setText("Auto Bluetooth Pairing enabled for 120 seconds!"); ui_->pushButtonDebug->hide(); ui_->pushButtonDebug2->hide(); @@ -1499,8 +1535,7 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged() } // check if sutdown is external triggered and init clean app exit - QFileInfo externalExitFile("/tmp/external_exit"); - if (externalExitFile.exists()) { + if (std::ifstream("/tmp/external_exit")) { f1x::openauto::autoapp::ui::MainWindow::MainWindow::exit(); } @@ -1509,14 +1544,30 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged() // hide wifi if not forced if (!this->hotspotActive) { - if ((ui_->pushButtonWifi->isVisible() == true) || (ui_->pushButtonWifi2->isVisible() == true)){ - ui_->pushButtonWifi->hide(); + if ((ui_->AAWIFIWidget->isVisible() == true) || (ui_->pushButtonWifi2->isVisible() == true)){ + //ui_->pushButtonWifi->hide(); + ui_->AAWIFIWidget->hide(); ui_->pushButtonWifi2->hide(); + ui_->AAUSBWidget->show(); } } else { - if ((ui_->pushButtonWifi->isVisible() == false) || (ui_->pushButtonWifi2->isVisible() == false)) { - ui_->pushButtonWifi->show(); + if ((ui_->AAWIFIWidget->isVisible() == false) || (ui_->pushButtonWifi2->isVisible() == false)) { + //ui_->pushButtonWifi->show(); + ui_->AAWIFIWidget->show(); ui_->pushButtonWifi2->show(); + ui_->AAUSBWidget->hide(); + } + } + + if (std::ifstream("/tmp/temp_recent_list")) { + if (ui_->pushButtonWifi->isVisible() == false) { + ui_->pushButtonWifi->show(); + ui_->pushButtonNoWiFiDevice->hide(); + } + } else { + if (ui_->pushButtonWifi->isVisible() == true) { + ui_->pushButtonNoWiFiDevice->show(); + ui_->pushButtonWifi->hide(); } } @@ -1525,30 +1576,14 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged() if (ui_->pushButtonCameraShow2->isVisible() == true) { button_count = button_count + 1; } - if (ui_->pushButtonToggleGUI2->isVisible() == true) { - button_count = button_count + 1; - } if (ui_->pushButtonWifi2->isVisible() == true) { button_count = button_count + 1; } if (ui_->pushButtonDebug2->isVisible() == true) { button_count = button_count + 1; } - if (button_count >= 3) { - ui_->pushButtonDummyClassic1->hide(); - ui_->pushButtonDummyClassic2->hide(); - } - if (button_count == 2) { - ui_->pushButtonDummyClassic1->hide(); - ui_->pushButtonDummyClassic2->hide(); - } - if (button_count == 1) { - ui_->pushButtonDummyClassic1->show(); - ui_->pushButtonDummyClassic2->hide(); - } - if (button_count == 0) { - ui_->pushButtonDummyClassic1->show(); - ui_->pushButtonDummyClassic2->show(); + if (ui_->pushButtonVolume2->isVisible() == true) { + button_count = button_count + 1; } // Hide auto day/night if needed @@ -1609,8 +1644,7 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged() } // read value from tsl2561 - QFileInfo lightsensorFile("/tmp/tsl2561"); - if (lightsensorFile.exists() && this->configuration_->showLux()) { + if (std::ifstream("/tmp/tsl2561") && this->configuration_->showLux()) { QFile paramFile("/tmp/tsl2561"); paramFile.open(QIODevice::ReadOnly); QTextStream data(¶mFile); @@ -1618,12 +1652,15 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged() paramFile.close(); if (ui_->label_left->isVisible() == false) { ui_->label_left->show(); + ui_->label_right->show(); } ui_->label_left->setText("Lux: " + value[0]); } else { if (ui_->label_left->isVisible() == true) { ui_->label_left->hide(); + ui_->label_right->hide(); ui_->label_left->setText(""); + ui_->label_right->setText(""); } } } diff --git a/src/autoapp/UI/SettingsWindow.cpp b/src/autoapp/UI/SettingsWindow.cpp index f05e8a9..c9c9b68 100644 --- a/src/autoapp/UI/SettingsWindow.cpp +++ b/src/autoapp/UI/SettingsWindow.cpp @@ -27,6 +27,7 @@ #include #include #include +#include namespace f1x { @@ -78,6 +79,7 @@ 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); @@ -96,17 +98,22 @@ SettingsWindow::SettingsWindow(configuration::IConfiguration::Pointer configurat ui_->spinBoxMinute->setValue((time_text_minute).toInt()); ui_->label_modeswitchprogress->hide(); - QFileInfo hotspotFile("/tmp/hotspot_active"); - if (hotspotFile.exists()) { + if (std::ifstream("/tmp/hotspot_active")) { ui_->pushButtonHotspotStop->show(); ui_->pushButtonHotspotStart->hide(); ui_->lineEdit_wifimode->setText("Hotspot"); ui_->lineEditWifiSSID->setText(this->hotspotssid); + ui_->lineEditPassword->show(); + ui_->label_password->show(); + ui_->lineEditPassword->setText("1234567890"); } else { ui_->pushButtonHotspotStart->show(); ui_->pushButtonHotspotStop->hide(); ui_->lineEdit_wifimode->setText("Client"); ui_->lineEditWifiSSID->setText(this->wifissid); + ui_->lineEditPassword->hide(); + ui_->label_password->hide(); + ui_->lineEditPassword->setText(""); } } @@ -463,9 +470,7 @@ void SettingsWindow::loadSystemValues() system("/usr/local/bin/autoapp_helper getinputs"); system("/usr/local/bin/autoapp_helper getparams"); - QFileInfo paramFile("/tmp/return_value"); - if (paramFile.exists()) { - + if (std::ifstream("/tmp/return_value")) { QFile paramFile(QString("/tmp/return_value")); paramFile.open(QIODevice::ReadOnly); QTextStream data_param(¶mFile); @@ -521,8 +526,7 @@ void SettingsWindow::loadSystemValues() // set cpu temp ui_->valueSystemCPUTemp->setText(getparams[20]); - QFileInfo inputsFile("/tmp/get_inputs"); - if (inputsFile.exists()) { + if (std::ifstream("/tmp/get_inputs")) { QFile inputsFile(QString("/tmp/get_inputs")); inputsFile.open(QIODevice::ReadOnly); QTextStream data_return(&inputsFile); @@ -541,8 +545,7 @@ void SettingsWindow::loadSystemValues() } } - QFileInfo outputsFile("/tmp/get_outputs"); - if (outputsFile.exists()) { + if (std::ifstream("/tmp/get_outputs")) { QFile outputsFile(QString("/tmp/get_outputs")); outputsFile.open(QIODevice::ReadOnly); QTextStream data_return(&outputsFile); @@ -561,8 +564,7 @@ void SettingsWindow::loadSystemValues() } } - QFileInfo defaultoutputFile("/tmp/get_default_output"); - if (defaultoutputFile.exists()) { + if (std::ifstream("/tmp/get_default_output")) { QFile defaultoutputFile(QString("/tmp/get_default_output")); defaultoutputFile.open(QIODevice::ReadOnly); QTextStream data_return(&defaultoutputFile); @@ -571,8 +573,7 @@ void SettingsWindow::loadSystemValues() ui_->comboBoxPulseOutput->setCurrentText(defoutput[0]); } - QFileInfo defaultinputFile("/tmp/get_default_input"); - if (defaultinputFile.exists()) { + if (std::ifstream("/tmp/get_default_input")) { QFile defaultinputFile(QString("/tmp/get_default_input")); defaultinputFile.open(QIODevice::ReadOnly); QTextStream data_return(&defaultinputFile); @@ -581,8 +582,7 @@ void SettingsWindow::loadSystemValues() ui_->comboBoxPulseInput->setCurrentText(definput[0]); } - QFileInfo zoneFile("/tmp/timezone_listing"); - if (zoneFile.exists()) { + if (std::ifstream("/tmp/timezone_listing")) { QFile zoneFile(QString("/tmp/timezone_listing")); zoneFile.open(QIODevice::ReadOnly); QTextStream data_return(&zoneFile); @@ -778,6 +778,7 @@ void SettingsWindow::onStopHotspot() ui_->lineEdit_wifimode->setText(""); ui_->lineEdit_wlan0->setText(""); ui_->lineEditWifiSSID->setText(""); + ui_->lineEditPassword->setText(""); system("sudo systemctl stop hotspot &"); QTimer::singleShot(15000, this, SLOT(updateNetworkInfo())); } @@ -921,18 +922,23 @@ void f1x::openauto::autoapp::ui::SettingsWindow::updateNetworkInfo() ui_->lineEdit_wlan0->setText("interface down"); } - QFileInfo hotspotFile("/tmp/hotspot_active"); - if (hotspotFile.exists()) { + if (std::ifstream("/tmp/hotspot_active")) { ui_->pushButtonHotspotStop->show(); ui_->pushButtonHotspotStart->hide(); ui_->label_modeswitchprogress->hide(); ui_->lineEdit_wifimode->setText("Hotspot"); ui_->lineEditWifiSSID->setText(this->hotspotssid); + ui_->lineEditPassword->show(); + ui_->label_password->show(); + ui_->lineEditPassword->setText("1234567890"); } else { ui_->pushButtonHotspotStart->show(); ui_->pushButtonHotspotStop->hide(); ui_->label_modeswitchprogress->hide(); ui_->lineEdit_wifimode->setText("Client"); ui_->lineEditWifiSSID->setText(this->wifissid); + ui_->lineEditPassword->hide(); + ui_->label_password->hide(); + ui_->lineEditPassword->setText(""); } } diff --git a/src/autoapp/UI/Warning.cpp b/src/autoapp/UI/Warning.cpp new file mode 100644 index 0000000..1b6cada --- /dev/null +++ b/src/autoapp/UI/Warning.cpp @@ -0,0 +1,30 @@ +#include +#include + +namespace f1x +{ +namespace openauto +{ +namespace autoapp +{ +namespace ui +{ + +Warning::Warning(QWidget *parent) + : QDialog(parent) + , ui_(new Ui::Warning) +{ + ui_->setupUi(this); + + connect(ui_->pushButtonClose, &QPushButton::clicked, this, &Warning::close); +} + +Warning::~Warning() +{ + delete ui_; +} + +} +} +} +} diff --git a/src/autoapp/UI/connectdialog.ui b/src/autoapp/UI/connectdialog.ui index 106f67e..ae12aa9 100644 --- a/src/autoapp/UI/connectdialog.ui +++ b/src/autoapp/UI/connectdialog.ui @@ -7,7 +7,7 @@ 0 0 500 - 431 + 360 @@ -44,8 +44,21 @@ color: rgb(255, 255, 255); + + + 0 + 32 + + + + + 16777215 + 32 + + + 14 75 true @@ -54,6 +67,9 @@ color: rgb(255, 255, 255); background-color: rgb(85, 87, 83); color: rgb(255, 255, 255); + + + Qt::AlignCenter @@ -80,28 +96,17 @@ color: rgb(255, 255, 255); - Recent + Clients - + 9 - - - - 0 - 0 - - - - - 0 - 100 - - + + 14 75 true @@ -110,14 +115,206 @@ color: rgb(255, 255, 255); background-color: rgb(85, 87, 83); color: rgb(255, 255, 255); - - QAbstractItemView::NoEditTriggers + + + 0 + 30 + - - 100 + + false + + + + + 0 + 0 + + + + + 130 + 0 + + + + + 130 + 16777215 + + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 120 + 30 + + + + + 75 + true + + + + background-color: rgba(186, 189, 182, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); +color: rgb(255, 255, 255); + + + Update + + + + + + + Qt::Vertical + + + + 20 + 10 + + + + + + + + + 0 + 0 + + + + + 120 + 30 + + + + + true + + + + background-color: rgba(186, 189, 182, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); +color: rgb(255, 255, 255); + + + 0 + + + 0 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + true + + + + + + + + 0 + 0 + + + + + 120 + 30 + + + + + 75 + true + PreferDefault + + + + background-color: rgba(186, 189, 182, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); +color: rgb(255, 255, 255); + + + Connect + + + + + + + Qt::Vertical + + + + 20 + 10 + + + + + + + + + 0 + 0 + + + + + 120 + 30 + + + + + 75 + true + + + + background-color: rgba(186, 189, 182, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); +color: rgb(255, 255, 255); + + + Close + + + + + + @@ -156,151 +353,6 @@ color: rgb(255, 255, 255); - - - - - 0 - 0 - - - - - - - - 0 - 0 - - - - - 120 - 30 - - - - - 75 - true - - - - background-color: rgba(186, 189, 182, 0.5); -border-radius: 4px; -border: 2px solid rgba(255,255,255,0.5); -color: rgb(255, 255, 255); - - - Update - - - - - - - - 0 - 0 - - - - - 120 - 30 - - - - - 75 - true - - - - background-color: rgba(186, 189, 182, 0.5); -border-radius: 4px; -border: 2px solid rgba(255,255,255,0.5); -color: rgb(255, 255, 255); - - - Cancel - - - - - - - - 0 - 0 - - - - - 120 - 30 - - - - - 75 - true - PreferDefault - - - - background-color: rgba(186, 189, 182, 0.5); -border-radius: 4px; -border: 2px solid rgba(255,255,255,0.5); -color: rgb(255, 255, 255); - - - Connect - - - - - - - - 0 - 0 - - - - - 120 - 30 - - - - - true - - - - background-color: rgba(186, 189, 182, 0.5); -border-radius: 4px; -border: 2px solid rgba(255,255,255,0.5); -color: rgb(255, 255, 255); - - - 0 - - - 0 - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - true - - - - - - diff --git a/src/autoapp/UI/mainwindow.ui b/src/autoapp/UI/mainwindow.ui index c1769b2..7f2ab11 100644 --- a/src/autoapp/UI/mainwindow.ui +++ b/src/autoapp/UI/mainwindow.ui @@ -398,32 +398,6 @@ color: rgb(78, 244, 37); 0 - - - - - 0 - 0 - - - - - 75 - true - - - - background-color: rgba(255, 255, 255, 0); -color: rgb(255, 255, 255); - - - USB Connected - - - Qt::AlignCenter - - - @@ -614,30 +588,192 @@ color: rgb(255, 255, 255); - + 0 0 - - - 75 - true - - - - background-color: rgba(14, 8, 137, 0.5); + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 75 + true + + + + background-color: rgba(48, 140, 198, 0.5); color: rgb(255, 255, 255); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); outline: none; + + + + + + + :/aausb-hot.png + + + + + 50 + 50 + + + + + + + + + 0 + 0 + + + + + 75 + true + + + + background-color: rgba(48, 140, 198, 0.5); +color: rgb(255, 255, 255); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); +outline: none; + + + No +USB Device + + + + + + + + + + + 0 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + background-color: rgba(252, 175, 62, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); +color: rgb(255, 255, 255); +outline: none; + + + + + + + :/aawifi-hot.png + + + + + 50 + 50 + + + + + + + + + 0 + 0 + + + + + 75 + true + + + + background-color: rgba(252, 175, 62, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); +color: rgb(255, 255, 255); +outline: none; + + + No +WiFi Clients + + + + + + + + + + + 0 + 0 + + + + background-color: rgba(100, 62, 4, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); +outline: none; - Android -Auto + Setup @@ -753,7 +889,7 @@ outline: none; - + 0 @@ -761,7 +897,7 @@ outline: none; - background-color: rgba(245, 121, 0, 0.5); + background-color: rgba(100, 62, 4, 0.5); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); outline: none; @@ -771,7 +907,7 @@ outline: none; - :/brightness-hot.png + :/camera-hot.png @@ -813,7 +949,7 @@ outline: none; - + 0 @@ -821,7 +957,7 @@ outline: none; - background-color: rgba(237, 164, 255, 0.5); + background-color: rgba(85, 87, 83, 0.5); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); outline: none; @@ -831,7 +967,7 @@ outline: none; - :/eye-hot.png + :/bug-hot.png @@ -842,71 +978,6 @@ outline: none; - - - - - 0 - 0 - - - - background-color: rgba(15, 54, 5, 0.5); -color: rgb(255, 255, 255); -border-radius: 4px; -border: 2px solid rgba(255,255,255,0.5); -outline: none; - - - - - - - - :/lock-hot.png - - - - - 64 - 64 - - - - - - - - - 0 - 0 - - - - background-color: rgba(138, 226, 52, 0.5); -border-radius: 4px; -border: 2px solid rgba(255,255,255,0.5); -outline: none; - - - - - - - :/settings-hot.png - - - - - 64 - 64 - - - - true - - - @@ -1180,7 +1251,7 @@ outline: none; 0 - + 0 @@ -1188,48 +1259,19 @@ outline: none; - background-color: rgba(100, 62, 4, 0.5); -border-radius: 4px; -border: 2px solid rgba(255,255,255,0.5); -outline: none; - - - - - - - :/camera-hot.png - - - - - 64 - 64 - - - - - - - - - 0 - 0 - - - - background-color: rgba(252, 175, 62, 0.5); -border-radius: 4px; -border: 2px solid rgba(255,255,255,0.5); + background-color: rgba(15, 54, 5, 0.5); color: rgb(255, 255, 255); -outline: none; +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); +outline: none; + - :/wifi-hot.png + :/lock-hot.png @@ -1241,7 +1283,7 @@ outline: none; - + 0 @@ -1249,26 +1291,7 @@ outline: none; - background-color: rgba(100, 62, 4, 0.5); -border-radius: 4px; -border: 2px solid rgba(255,255,255,0.5); -outline: none; - - - Setup - - - - - - - - 0 - 0 - - - - background-color: rgba(85, 87, 83, 0.5); + background-color: rgba(138, 226, 52, 0.5); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); outline: none; @@ -1278,7 +1301,7 @@ outline: none; - :/bug-hot.png + :/settings-hot.png @@ -1287,6 +1310,9 @@ outline: none; 64 + + true + @@ -1326,6 +1352,66 @@ outline: none; + + + + + 0 + 0 + + + + background-color: rgba(245, 121, 0, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); +outline: none; + + + + + + + :/brightness-hot.png + + + + + 64 + 64 + + + + + + + + + 0 + 0 + + + + background-color: rgba(237, 164, 255, 0.5); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); +outline: none; + + + + + + + :/eye-hot.png + + + + + 64 + 64 + + + + @@ -1584,7 +1670,7 @@ outline: none; - + 0 @@ -1600,63 +1686,7 @@ outline: none; - :/eye-hot.png - - - - - 50 - 50 - - - - - - - - - 0 - 0 - - - - background-color: rgba(136, 138, 133, 0.5); -outline: none; - - - - - - - :/day-hot.png - - - - - 50 - 50 - - - - - - - - - 0 - 0 - - - - background-color: rgba(136, 138, 133, 0.5); -outline: none; - - - - - - - :/night-hot.png + :/mp3-hot.png @@ -1695,6 +1725,34 @@ outline: none; + + + + + 0 + 0 + + + + background-color: rgba(136, 138, 133, 0.5); +outline: none; + + + + + + + :/eye-hot.png + + + + + 50 + 50 + + + + @@ -1889,6 +1947,118 @@ outline: none; 10 + + + + + 0 + 0 + + + + background-color: rgba(136, 138, 133, 0.5); +outline: none; + + + + + + + :/aausb-hot.png + + + + + 50 + 50 + + + + + + + + + 0 + 0 + + + + background-color: rgba(136, 138, 133, 0.5); +outline: none; + + + + + + + :/aawifi-hot.png + + + + + 50 + 50 + + + + + + + + + 0 + 0 + + + + background-color: rgba(136, 138, 133, 0.5); +outline: none; + + + + + + + :/day-hot.png + + + + + 50 + 50 + + + + + + + + + 0 + 0 + + + + background-color: rgba(136, 138, 133, 0.5); +outline: none; + + + + + + + :/night-hot.png + + + + + 50 + 50 + + + + @@ -1945,34 +2115,6 @@ outline: none; - - - - - 0 - 0 - - - - background-color: rgba(136, 138, 133, 0.5); -outline: none; - - - - - - - :/wifi-hot.png - - - - - 50 - 50 - - - - @@ -2001,92 +2143,6 @@ outline: none; - - - - - 0 - 0 - - - - background-color: rgba(136, 138, 133, 0.5); -outline: none; - - - - - - - :/mp3-hot.png - - - - - 50 - 50 - - - - - - - - - 0 - 0 - - - - - 62 - 0 - - - - background-color: rgba(136, 138, 133, 0.5); -outline: none; - - - - - - - 50 - 50 - - - - - - - - - 0 - 0 - - - - - 62 - 0 - - - - background-color: rgba(136, 138, 133, 0.5); -outline: none; - - - - - - - 50 - 50 - - - - diff --git a/src/autoapp/UI/settingswindow.ui b/src/autoapp/UI/settingswindow.ui index bdd4b62..31a8c79 100644 --- a/src/autoapp/UI/settingswindow.ui +++ b/src/autoapp/UI/settingswindow.ui @@ -7,7 +7,7 @@ 0 0 963 - 3033 + 3062 @@ -2499,7 +2499,7 @@ outline: none; - Used SSID: + SSID: @@ -2531,7 +2531,7 @@ outline: none; - + @@ -2550,7 +2550,7 @@ outline: none; - + @@ -2566,8 +2566,8 @@ outline: none; - - + + 0 @@ -2594,13 +2594,36 @@ outline: none; - + Yes + + + + + 200 + 0 + + + + + 200 + 16777215 + + + + + + + + Password (default) + + + diff --git a/src/autoapp/UI/warning.ui b/src/autoapp/UI/warning.ui new file mode 100644 index 0000000..43d9cf6 --- /dev/null +++ b/src/autoapp/UI/warning.ui @@ -0,0 +1,141 @@ + + + Warning + + + + 0 + 0 + 500 + 300 + + + + + 0 + 0 + + + + Warning + + + background-color: rgb(186, 189, 182); +border-color: rgb(0, 0, 0); + + + + + 4 + + + 4 + + + 4 + + + 4 + + + 4 + + + + + + 14 + 75 + true + + + + background-color: rgb(136, 138, 133); +color: rgb(255, 255, 255); +border-color: rgb(186, 189, 182); + + + + Safety Information + + + Qt::AlignHCenter|Qt::AlignTop + + + + 2 + + + 2 + + + 2 + + + 2 + + + 2 + + + + + + 0 + 0 + + + + background-color: rgb(136, 138, 133); + + + 1 + + + <html><head/><body><p><span style=" font-weight:600; color:#271191;">WARNING!</span></p><p><span style=" font-weight:600; color:#271191;">Distraction may cause accidents. Do not attempt to operate while driving. Always concentrate on driving and obey Traffic Regulations. You assume total responsibility and risk for using this software.</span></p><p><span style=" font-weight:600; color:#271191;">This software is not certified by Google Inc. It is created for R&amp;D purposes and may not work as expected by the original authors. Do not use while driving.</span></p><p><span style=" font-weight:600; color:#271191;">You use this software at your own risk.</span></p></body></html> + + + Qt::AlignHCenter|Qt::AlignTop + + + true + + + + + + + + + + + 0 + 40 + + + + + 16777215 + 40 + + + + + 75 + true + + + + background-color: rgb(186, 189, 182); + + + OK + + + + + + + + + diff --git a/src/autoapp/autoapp.cpp b/src/autoapp/autoapp.cpp index f12ccf5..fac6f18 100644 --- a/src/autoapp/autoapp.cpp +++ b/src/autoapp/autoapp.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include namespace aasdk = f1x::aasdk; @@ -98,7 +99,7 @@ int main(int argc, char* argv[]) autoapp::ui::SettingsWindow settingsWindow(configuration); settingsWindow.setWindowFlags(Qt::WindowStaysOnTopHint); - //settingsWindow.showFullScreen(); + settingsWindow.setFixedSize(width, height); settingsWindow.adjustSize(); @@ -114,7 +115,12 @@ int main(int argc, char* argv[]) autoapp::ui::ConnectDialog connectDialog(ioService, tcpWrapper, recentAddressesList); connectDialog.setWindowFlags(Qt::WindowStaysOnTopHint); // center dialog - connectDialog.move((width - 500)/2,(height-440)/2); + connectDialog.move((width - 500)/2,(height-360)/2); + + autoapp::ui::Warning warning; + warning.setWindowFlags(Qt::WindowStaysOnTopHint); + // center dialog + warning.move((width - 500)/2,(height-300)/2); QObject::connect(&mainWindow, &autoapp::ui::MainWindow::exit, []() { system("touch /tmp/shutdown"); std::exit(0); }); QObject::connect(&mainWindow, &autoapp::ui::MainWindow::reboot, []() { system("touch /tmp/reboot"); std::exit(0); }); @@ -229,13 +235,27 @@ int main(int argc, char* argv[]) app->start(std::move(socket)); }); - //QObject::connect(&mainWindow, &autoapp::ui::MainWindow::TriggerAAStart, [&qApplication]() { - // OPENAUTO_LOG(info) << "[CS] Manual start android auto entity."; - //}); + 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 &"); + app->waitForUSBDevice(); + } + }); - //QObject::connect(&mainWindow, &autoapp::ui::MainWindow::TriggerAAStop, [&qApplication]() { - // OPENAUTO_LOG(info) << "[CS] Manual stop android auto entity."; - //}); + QObject::connect(&mainWindow, &autoapp::ui::MainWindow::TriggerAppStop, [&app]() { + OPENAUTO_LOG(info) << "[CS] Manual stop android auto entity."; + if (std::ifstream("/tmp/android_device")) { + system("/usr/local/bin/autoapp_helper usbreset"); + usleep(500000); + app->stop(); + } else { + //app->onAndroidAutoQuit(); + app->stop(); + } + }); + + warning.show(); app->waitForUSBDevice();