latest dev

This commit is contained in:
hawkeyexp 2018-12-05 13:09:36 +01:00
parent 802393d427
commit 14662664ed
18 changed files with 1043 additions and 623 deletions

BIN
assets/aausb-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
assets/aawifi-hot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@ -5,6 +5,8 @@
<file>ico_setting.png</file>
<file>ico_info.png</file>
<file>ico_bluetooth.png</file>
<file>aausb-hot.png</file>
<file>aawifi-hot.png</file>
<file>cursor-hot.png</file>
<file>power-hot.png</file>
<file>settings-hot.png</file>

View File

@ -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);

View File

@ -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_;

View File

@ -0,0 +1,30 @@
#include <QDialog>
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_;
};
}
}
}
}

View File

@ -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);

View File

@ -19,8 +19,7 @@
#include <aasdk_proto/DrivingStatusEnum.pb.h>
#include <f1x/openauto/Common/Log.hpp>
#include <f1x/openauto/autoapp/Service/SensorService.hpp>
#include <QFile>
#include <QFileInfo>
#include <fstream>
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_);

View File

@ -18,6 +18,7 @@
#include <f1x/openauto/Common/Log.hpp>
#include <f1x/openauto/autoapp/Service/VideoService.hpp>
#include <fstream>
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";
}
}
}

View File

@ -3,6 +3,7 @@
#include "ui_connectdialog.h"
#include <QFileInfo>
#include <QTextStream>
#include <fstream>
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<size_t>(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<boost::asio::ip::tcp::socket>(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("");
}
}

View File

@ -30,6 +30,11 @@
#include <QScreen>
#include <QRect>
#include <QFileSystemWatcher>
#include <iostream>
#include <fstream>
#include <cstdio>
#include <unistd.h>
#include <f1x/openauto/Common/Log.hpp>
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(&paramFile);
@ -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("");
}
}
}

View File

@ -27,6 +27,7 @@
#include <QDateTime>
#include <QNetworkInterface>
#include <QNetworkConfigurationManager>
#include <fstream>
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(&paramFile);
@ -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("");
}
}

View File

@ -0,0 +1,30 @@
#include <f1x/openauto/autoapp/UI/Warning.hpp>
#include <ui_warning.h>
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_;
}
}
}
}
}

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>500</width>
<height>431</height>
<height>360</height>
</rect>
</property>
<property name="sizePolicy">
@ -44,8 +44,21 @@ color: rgb(255, 255, 255);</string>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLineEdit" name="lineEditIPAddress">
<property name="minimumSize">
<size>
<width>0</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>32</height>
</size>
</property>
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
@ -54,6 +67,9 @@ color: rgb(255, 255, 255);</string>
<string notr="true">background-color: rgb(85, 87, 83);
color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
@ -80,28 +96,17 @@ color: rgb(255, 255, 255);</string>
</size>
</property>
<property name="title">
<string>Recent</string>
<string>Clients</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="topMargin">
<number>9</number>
</property>
<item>
<widget class="QListView" name="listViewRecent">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>100</height>
</size>
</property>
<widget class="QListWidget" name="listWidgetClients">
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
@ -110,14 +115,206 @@ color: rgb(255, 255, 255);</string>
<string notr="true">background-color: rgb(85, 87, 83);
color: rgb(255, 255, 255);</string>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
<property name="gridSize">
<size>
<width>0</width>
<height>30</height>
</size>
</property>
<property name="batchSize">
<number>100</number>
<property name="uniformItemSizes">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="horizontalWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>130</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>130</width>
<height>16777215</height>
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="pushButtonUpdate">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</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: rgba(186, 189, 182, 0.5);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Update</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QProgressBar" name="progressBarConnect">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<kerning>true</kerning>
</font>
</property>
<property name="styleSheet">
<string notr="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);</string>
</property>
<property name="maximum">
<number>0</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="textVisible">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonConnect">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<stylestrategy>PreferDefault</stylestrategy>
</font>
</property>
<property name="styleSheet">
<string notr="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);</string>
</property>
<property name="text">
<string>Connect</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButtonCancel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</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: rgba(186, 189, 182, 0.5);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Close</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
@ -156,151 +353,6 @@ color: rgb(255, 255, 255);</string>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="horizontalWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="pushButtonUpdate">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</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: rgba(186, 189, 182, 0.5);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Update</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonCancel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</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: rgba(186, 189, 182, 0.5);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonConnect">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<stylestrategy>PreferDefault</stylestrategy>
</font>
</property>
<property name="styleSheet">
<string notr="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);</string>
</property>
<property name="text">
<string>Connect</string>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="progressBarConnect">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<kerning>true</kerning>
</font>
</property>
<property name="styleSheet">
<string notr="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);</string>
</property>
<property name="maximum">
<number>0</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="textVisible">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>

View File

@ -398,32 +398,6 @@ color: rgb(78, 244, 37);</string>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="phoneConnected">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(255, 255, 255, 0);
color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>USB Connected</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_11">
<property name="orientation">
@ -614,30 +588,192 @@ color: rgb(255, 255, 255);</string>
<item row="0" column="0" colspan="2">
<layout class="QHBoxLayout" name="Layout_Sliderselect">
<item>
<widget class="QPushButton" name="pushButtonAndroidAuto">
<widget class="QWidget" name="AAUSBWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(14, 8, 137, 0.5);
<layout class="QHBoxLayout" name="Layout">
<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="QPushButton" name="pushButtonAndroidAuto">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="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;
</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normalon>:/aausb-hot.png</normalon>
</iconset>
</property>
<property name="iconSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonNoDevice">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="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;</string>
</property>
<property name="text">
<string>No
USB Device</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="AAWIFIWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="Layout2">
<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="QPushButton" name="pushButtonWifi">
<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(252, 175, 62, 0.5);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
color: rgb(255, 255, 255);
outline: none;</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normalon>:/aawifi-hot.png</normalon>
</iconset>
</property>
<property name="iconSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonNoWiFiDevice">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="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;</string>
</property>
<property name="text">
<string>No
WiFi Clients</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonWifiSetup">
<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(100, 62, 4, 0.5);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
outline: none;</string>
</property>
<property name="text">
<string>Android
Auto</string>
<string>Setup</string>
</property>
</widget>
</item>
@ -753,7 +889,7 @@ outline: none;</string>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonBrightness">
<widget class="QPushButton" name="pushButtonCameraShow">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
@ -761,7 +897,7 @@ outline: none;</string>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(245, 121, 0, 0.5);
<string notr="true">background-color: rgba(100, 62, 4, 0.5);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
outline: none;</string>
@ -771,7 +907,7 @@ outline: none;</string>
</property>
<property name="icon">
<iconset>
<normalon>:/brightness-hot.png</normalon>
<normalon>:/camera-hot.png</normalon>
</iconset>
</property>
<property name="iconSize">
@ -813,7 +949,7 @@ outline: none;</string>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonToggleGUI">
<widget class="QPushButton" name="pushButtonDebug">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
@ -821,7 +957,7 @@ outline: none;</string>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(237, 164, 255, 0.5);
<string notr="true">background-color: rgba(85, 87, 83, 0.5);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
outline: none;</string>
@ -831,7 +967,7 @@ outline: none;</string>
</property>
<property name="icon">
<iconset>
<normalon>:/eye-hot.png</normalon>
<normalon>:/bug-hot.png</normalon>
</iconset>
</property>
<property name="iconSize">
@ -842,71 +978,6 @@ outline: none;</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonLock">
<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(15, 54, 5, 0.5);
color: rgb(255, 255, 255);
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>:/lock-hot.png</normalon>
</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonSettings">
<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(138, 226, 52, 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>:/settings-hot.png</normalon>
</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0" colspan="2">
@ -1180,7 +1251,7 @@ outline: none;</string>
<number>0</number>
</property>
<item>
<widget class="QPushButton" name="pushButtonCameraShow">
<widget class="QPushButton" name="pushButtonLock">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
@ -1188,48 +1259,19 @@ outline: none;</string>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(100, 62, 4, 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>:/camera-hot.png</normalon>
</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonWifi">
<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(252, 175, 62, 0.5);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
<string notr="true">background-color: rgba(15, 54, 5, 0.5);
color: rgb(255, 255, 255);
outline: none;</string>
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>:/wifi-hot.png</normalon>
<normalon>:/lock-hot.png</normalon>
</iconset>
</property>
<property name="iconSize">
@ -1241,7 +1283,7 @@ outline: none;</string>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonWifiSetup">
<widget class="QPushButton" name="pushButtonSettings">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
@ -1249,26 +1291,7 @@ outline: none;</string>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(100, 62, 4, 0.5);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
outline: none;</string>
</property>
<property name="text">
<string>Setup</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonDebug">
<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(85, 87, 83, 0.5);
<string notr="true">background-color: rgba(138, 226, 52, 0.5);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
outline: none;</string>
@ -1278,7 +1301,7 @@ outline: none;</string>
</property>
<property name="icon">
<iconset>
<normalon>:/bug-hot.png</normalon>
<normalon>:/settings-hot.png</normalon>
</iconset>
</property>
<property name="iconSize">
@ -1287,6 +1310,9 @@ outline: none;</string>
<height>64</height>
</size>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
<item>
@ -1326,6 +1352,66 @@ outline: none;</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonBrightness">
<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(245, 121, 0, 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>:/brightness-hot.png</normalon>
</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonToggleGUI">
<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(237, 164, 255, 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>:/eye-hot.png</normalon>
</iconset>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonExit">
<property name="sizePolicy">
@ -1584,7 +1670,7 @@ outline: none;</string>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonToggleGUI2">
<widget class="QPushButton" name="pushButtonMusic2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
@ -1600,63 +1686,7 @@ outline: none;</string>
</property>
<property name="icon">
<iconset>
<normalon>:/eye-hot.png</normalon>
</iconset>
</property>
<property name="iconSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonDay2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normalon>:/day-hot.png</normalon>
</iconset>
</property>
<property name="iconSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonNight2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normalon>:/night-hot.png</normalon>
<normalon>:/mp3-hot.png</normalon>
</iconset>
</property>
<property name="iconSize">
@ -1695,6 +1725,34 @@ outline: none;</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonToggleGUI2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normalon>:/eye-hot.png</normalon>
</iconset>
</property>
<property name="iconSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonExit2">
<property name="sizePolicy">
@ -1889,6 +1947,118 @@ outline: none;</string>
<property name="bottomMargin">
<number>10</number>
</property>
<item>
<widget class="QPushButton" name="pushButtonAndroidAuto2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normalon>:/aausb-hot.png</normalon>
</iconset>
</property>
<property name="iconSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonWifi2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normalon>:/aawifi-hot.png</normalon>
</iconset>
</property>
<property name="iconSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonDay2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normalon>:/day-hot.png</normalon>
</iconset>
</property>
<property name="iconSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonNight2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normalon>:/night-hot.png</normalon>
</iconset>
</property>
<property name="iconSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonCameraShow2">
<property name="sizePolicy">
@ -1945,34 +2115,6 @@ outline: none;</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonWifi2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normalon>:/wifi-hot.png</normalon>
</iconset>
</property>
<property name="iconSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonDebug2">
<property name="sizePolicy">
@ -2001,92 +2143,6 @@ outline: none;</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonMusic2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normalon>:/mp3-hot.png</normalon>
</iconset>
</property>
<property name="iconSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonDummyClassic1">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>62</width>
<height>0</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
</property>
<property name="text">
<string/>
</property>
<property name="iconSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonDummyClassic2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>62</width>
<height>0</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);
outline: none;</string>
</property>
<property name="text">
<string/>
</property>
<property name="iconSize">
<size>
<width>50</width>
<height>50</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>963</width>
<height>3033</height>
<height>3062</height>
</rect>
</property>
<property name="sizePolicy">
@ -2499,7 +2499,7 @@ outline: none;</string>
</size>
</property>
<property name="text">
<string>Used SSID:</string>
<string>SSID:</string>
</property>
</widget>
</item>
@ -2531,7 +2531,7 @@ outline: none;</string>
</property>
</widget>
</item>
<item row="2" column="0">
<item row="3" column="0">
<widget class="QLabel" name="label_wifimode">
<property name="minimumSize">
<size>
@ -2550,7 +2550,7 @@ outline: none;</string>
</property>
</widget>
</item>
<item row="2" column="1">
<item row="3" column="1">
<widget class="QLineEdit" name="lineEdit_wifimode">
<property name="minimumSize">
<size>
@ -2566,8 +2566,8 @@ outline: none;</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_23">
<item row="4" column="0">
<widget class="QLabel" name="label_hotspot">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -2594,13 +2594,36 @@ outline: none;</string>
</property>
</widget>
</item>
<item row="3" column="1">
<item row="4" column="1">
<widget class="QCheckBox" name="checkBoxHotspot">
<property name="text">
<string>Yes</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEditPassword">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_password">
<property name="text">
<string>Password (default)</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>

141
src/autoapp/UI/warning.ui Normal file
View File

@ -0,0 +1,141 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Warning</class>
<widget class="QDialog" name="Warning">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>300</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Warning</string>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(186, 189, 182);
border-color: rgb(0, 0, 0);
</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>4</number>
</property>
<property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(136, 138, 133);
color: rgb(255, 255, 255);
border-color: rgb(186, 189, 182);
</string>
</property>
<property name="title">
<string>Safety Information</string>
</property>
<property name="alignment">
<set>Qt::AlignHCenter|Qt::AlignTop</set>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>2</number>
</property>
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(136, 138, 133);</string>
</property>
<property name="lineWidth">
<number>1</number>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600; color:#271191;&quot;&gt;WARNING!&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600; color:#271191;&quot;&gt;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.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600; color:#271191;&quot;&gt;This software is not certified by Google Inc. It is created for R&amp;amp;D purposes and may not work as expected by the original authors. Do not use while driving.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600; color:#271191;&quot;&gt;You use this software at your own risk.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignHCenter|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonClose">
<property name="minimumSize">
<size>
<width>0</width>
<height>40</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>40</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(186, 189, 182);</string>
</property>
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
</ui>

View File

@ -35,6 +35,7 @@
#include <f1x/openauto/autoapp/UI/SettingsWindow.hpp>
#include <f1x/openauto/autoapp/UI/ConnectDialog.hpp>
#include <f1x/openauto/autoapp/UI/WifiDialog.hpp>
#include <f1x/openauto/autoapp/UI/Warning.hpp>
#include <f1x/openauto/Common/Log.hpp>
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();