diff --git a/src/autoapp/App.cpp b/src/autoapp/App.cpp index 9529fd8..fa84b97 100644 --- a/src/autoapp/App.cpp +++ b/src/autoapp/App.cpp @@ -156,7 +156,12 @@ void App::onAndroidAutoQuit() if(!isStopped_) { - this->waitForDevice(); + try { + this->waitForDevice(); + } catch (...) { + OPENAUTO_LOG(info) << "[App] Exception in onAndroidAutoQuit."; + } + } }); } diff --git a/src/autoapp/UI/ConnectDialog.cpp b/src/autoapp/UI/ConnectDialog.cpp index 748f4c3..615c368 100644 --- a/src/autoapp/UI/ConnectDialog.cpp +++ b/src/autoapp/UI/ConnectDialog.cpp @@ -81,7 +81,7 @@ void ConnectDialog::connectHandler(const boost::system::error_code& ec, const st void ConnectDialog::onConnectionSucceed(aasdk::tcp::ITCPEndpoint::SocketPointer, const std::string& ipAddress) { ui_->progressBarConnect->hide(); - this->insertIpAddress(ipAddress); + //this->insertIpAddress(ipAddress); this->setControlsEnabledStatus(true); } @@ -134,9 +134,12 @@ void ConnectDialog::loadClientList() QTextStream data(&versionFile); while (!data.atEnd()) { - QString ip = data.readLine(); - ui_->listWidgetClients->addItem(ip); - ui_->lineEditIPAddress->setText(ip); + QString ip = data.readLine().trimmed(); + if (ip != "") { + ui_->listWidgetClients->addItem(ip); + ui_->lineEditIPAddress->setText(ip); + //ConnectDialog::insertIpAddress(ip.toStdString()); + } } versionFile.close(); diff --git a/src/autoapp/UI/MainWindow.cpp b/src/autoapp/UI/MainWindow.cpp index 2ffb024..22596a9 100644 --- a/src/autoapp/UI/MainWindow.cpp +++ b/src/autoapp/UI/MainWindow.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -442,6 +443,9 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi ui_->pushButtonBrightness2->hide(); } + // Hide recordings button + ui_->pushButtonRecordings->hide(); + player = new QMediaPlayer(this); playlist = new QMediaPlaylist(this); connect(player, &QMediaPlayer::positionChanged, this, &MainWindow::on_positionChanged); diff --git a/src/autoapp/UI/SettingsWindow.cpp b/src/autoapp/UI/SettingsWindow.cpp index 5597e56..8805ff3 100644 --- a/src/autoapp/UI/SettingsWindow.cpp +++ b/src/autoapp/UI/SettingsWindow.cpp @@ -341,6 +341,8 @@ void SettingsWindow::onSave() params.append("2"); } params.append("#"); + params.append( std::string(ui_->comboBoxCountryCode->currentText().split("|")[0].replace(" ","").toStdString()) ); + params.append("#"); system((std::string("/usr/local/bin/autoapp_helper setparams#") + std::string(params) + std::string(" &") ).c_str()); @@ -932,6 +934,7 @@ void SettingsWindow::loadSystemValues() else if (getparams[43] == "custom") { ui_->radioButtonCustom->setChecked(true); } + ui_->comboBoxCountryCode->setCurrentIndex(ui_->comboBoxCountryCode->findText(getparams[44], Qt::MatchFlag::MatchStartsWith)); } } diff --git a/src/autoapp/UI/mainwindow.ui b/src/autoapp/UI/mainwindow.ui index 70a48b3..375869e 100644 --- a/src/autoapp/UI/mainwindow.ui +++ b/src/autoapp/UI/mainwindow.ui @@ -7,7 +7,7 @@ 0 0 862 - 1351 + 1357 @@ -2626,6 +2626,44 @@ outline: none; + + + + + 0 + 0 + + + + + 12 + 75 + true + + + + background-color: rgb(186, 189, 182); +color: rgb(0, 0, 0); +border-radius: 4px; +border: 2px solid rgba(255,255,255,0.5); +outline: none; + + + Recordings + + + + :/list-hot.png + + + + + 32 + 32 + + + + @@ -3604,13 +3642,13 @@ outline: none; 0 - 4 + 0 0 - 4 + 0 @@ -3623,13 +3661,13 @@ outline: none; 150 - 20 + 34 150 - 20 + 34 @@ -3652,18 +3690,18 @@ background-color: rgba(0, 0, 0, 0); 0 - 20 + 34 16777215 - 20 + 34 - 14 + 12 75 true true @@ -3676,9 +3714,18 @@ color: rgb(255, 255, 255); + + Qt::AutoText + + + true + Qt::AlignCenter + + true + @@ -3692,13 +3739,13 @@ color: rgb(255, 255, 255); 150 - 16 + 34 150 - 16 + 34 diff --git a/src/autoapp/UI/settingswindow.ui b/src/autoapp/UI/settingswindow.ui index 6f68b71..943e2ad 100644 --- a/src/autoapp/UI/settingswindow.ui +++ b/src/autoapp/UI/settingswindow.ui @@ -7,7 +7,7 @@ 0 0 963 - 3602 + 3688 @@ -2512,7 +2512,7 @@ outline: none; 2 - + 2 @@ -2557,7 +2557,7 @@ outline: none; - + 0 @@ -2671,7 +2671,7 @@ outline: none; - + 2 @@ -2802,41 +2802,6 @@ outline: none; - - - - - 0 - 0 - - - - - 140 - 36 - - - - - 140 - 36 - - - - Enable Hotspot at system startup - - - true - - - - - - - Yes - - - @@ -2862,6 +2827,559 @@ outline: none; + + + + + 0 + 0 + + + + Wifi Setup + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + + + + 0 + 32 + + + + + 16777215 + 32 + + + + Country Code + + + + + + + + 0 + 32 + + + + + 16777215 + 32 + + + + QScrollBar { + width: 40px; + background-color: rgba(85, 87, 83, 0.7); +} + + + + AE | United Arab Emirates + + + + + AR | Argentina + + + + + AT | Austria + + + + + AU | Australia + + + + + BG | Bulgaria + + + + + BH | Bahrain + + + + + BM | Bermuda + + + + + BO | Bolivia + + + + + BR | Brazil + + + + + CA | Canada + + + + + CH | Switzerland + + + + + CL | Chile + + + + + CN | China + + + + + CO | Colombia + + + + + CR | Costa Rica + + + + + CS | Serbia and Montenegro + + + + + CY | Cyprus + + + + + CZ | Czech Republic + + + + + DE | Germany + + + + + DK | Denmark + + + + + DO | Dominican Republic + + + + + DZ | Algeria + + + + + EC | Ecuador + + + + + EE | Estonia + + + + + EG | Egypt + + + + + ES | Spain + + + + + FI | Finland + + + + + FR | France + + + + + GB | United Kingdom + + + + + GR | Greece + + + + + GT | Guatemala + + + + + HK | Hong Kong + + + + + HN | Honduras + + + + + ID | Indonesia + + + + + IE | Ireland + + + + + IL | Israel + + + + + IN | India + + + + + IS | Iceland + + + + + IT | Italy + + + + + JM | Jamaica + + + + + JO | Jordan + + + + + JP3 | Japan + + + + + KE | Kenya + + + + + KR | Republic of Korea (South Korea) + + + + + KW | Kuwait + + + + + KW | Kuwait + + + + + LB | Lebanon + + + + + LI | Liechtenstein + + + + + LK | Sri Lanka + + + + + LT | Lithuania + + + + + LU | Luxembourg + + + + + MA | Morocco + + + + + MU | Mauritius + + + + + MX | Mexico + + + + + NL | Netherlands + + + + + NO | Norway + + + + + NZ | New Zealand + + + + + OM | Oman + + + + + PA | Panama + + + + + PE | Peru + + + + + PH | Philippines + + + + + PK | Islamic Republic of Pakistan + + + + + PL | Poland + + + + + PR | Puerto Rico + + + + + PT | Portugal + + + + + QA | Qatar + + + + + RO | Romania + + + + + RU | Russia + + + + + SA | Saudi Arabia + + + + + SG | Singapore + + + + + SI | Slovenia + + + + + SK | Slovak Republic + + + + + SV | El Salvador + + + + + TH | Thailand + + + + + TN | Tunisia + + + + + TR | Turkey + + + + + TT | Trinidad and Tobago + + + + + TW | Taiwan + + + + + UA | Ukraine + + + + + US | United States + + + + + UY | Uruguay + + + + + VE | Venezuela + + + + + VN | Vietnam + + + + + ZA | South Africa + + + + + + + + + 0 + 0 + + + + + 0 + 32 + + + + + 16777215 + 32 + + + + Enable + + + + + + + + 0 + 0 + + + + + 0 + 32 + + + + + 16777215 + 32 + + + + Start system in Hotspot Mode + + + true + + + + + + + + + diff --git a/src/autoapp/autoapp.cpp b/src/autoapp/autoapp.cpp index e12759b..c10bad1 100644 --- a/src/autoapp/autoapp.cpp +++ b/src/autoapp/autoapp.cpp @@ -238,20 +238,28 @@ int main(int argc, char* argv[]) QObject::connect(&mainWindow, &autoapp::ui::MainWindow::TriggerAppStart, [&app]() { OPENAUTO_LOG(info) << "[CS] Manual start android auto entity by reset usb."; - if (std::ifstream("/tmp/android_device")) { - system("/usr/local/bin/autoapp_helper usbreset"); - app->waitForUSBDevice(); + try { + if (std::ifstream("/tmp/android_device")) { + system("/usr/local/bin/autoapp_helper usbreset"); + app->waitForUSBDevice(); + } + } catch (...) { + OPENAUTO_LOG(info) << "[CS] Exception in Manual start android auto entity by reset usb."; } }); 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->stop(); + try { + if (std::ifstream("/tmp/android_device")) { + system("/usr/local/bin/autoapp_helper usbreset"); + usleep(500000); + app->stop(); + } else { + app->onAndroidAutoQuit(); + } + } catch (...) { + OPENAUTO_LOG(info) << "[CS] Exception in Manual stop android auto entity."; } });