Latest changes

This commit is contained in:
hawkeyexp 2019-01-05 00:56:58 +01:00
parent 2ed095eed5
commit 0307adafe8
26 changed files with 3319 additions and 1202 deletions

View File

@ -45,6 +45,7 @@ public:
void start(aasdk::tcp::ITCPEndpoint::SocketPointer socket); void start(aasdk::tcp::ITCPEndpoint::SocketPointer socket);
void stop(); void stop();
void onAndroidAutoQuit() override; void onAndroidAutoQuit() override;
bool disableAutostartEntity = false;
private: private:
using std::enable_shared_from_this<App>::shared_from_this; using std::enable_shared_from_this<App>::shared_from_this;

View File

@ -62,6 +62,8 @@ public:
bool showCursor() const override; bool showCursor() const override;
void hideBrightnessControl(bool value) override; void hideBrightnessControl(bool value) override;
bool hideBrightnessControl() const override; bool hideBrightnessControl() const override;
void showNetworkinfo(bool value) override;
bool showNetworkinfo() const override;
std::string getMp3MasterPath() const override; std::string getMp3MasterPath() const override;
void setMp3MasterPath(const std::string& value) override; void setMp3MasterPath(const std::string& value) override;
@ -118,6 +120,7 @@ private:
bool showLux_; bool showLux_;
bool showCursor_; bool showCursor_;
bool hideBrightnessControl_; bool hideBrightnessControl_;
bool showNetworkinfo_;
std::string mp3MasterPath_; std::string mp3MasterPath_;
std::string mp3SubFolder_; std::string mp3SubFolder_;
int32_t mp3Track_; int32_t mp3Track_;
@ -149,6 +152,7 @@ private:
static const std::string cGeneralShowLuxKey; static const std::string cGeneralShowLuxKey;
static const std::string cGeneralShowCursorKey; static const std::string cGeneralShowCursorKey;
static const std::string cGeneralHideBrightnessControlKey; static const std::string cGeneralHideBrightnessControlKey;
static const std::string cGeneralShowNetworkinfoKey;
static const std::string cGeneralHandednessOfTrafficTypeKey; static const std::string cGeneralHandednessOfTrafficTypeKey;

View File

@ -70,6 +70,8 @@ public:
virtual bool showCursor() const = 0; virtual bool showCursor() const = 0;
virtual void hideBrightnessControl(bool value) = 0; virtual void hideBrightnessControl(bool value) = 0;
virtual bool hideBrightnessControl() const = 0; virtual bool hideBrightnessControl() const = 0;
virtual void showNetworkinfo(bool value) = 0;
virtual bool showNetworkinfo() const = 0;
virtual std::string getMp3MasterPath() const = 0; virtual std::string getMp3MasterPath() const = 0;
virtual void setMp3MasterPath(const std::string& value) = 0; virtual void setMp3MasterPath(const std::string& value) = 0;

View File

@ -45,6 +45,7 @@ public:
virtual bool init() = 0; virtual bool init() = 0;
virtual void write(uint64_t timestamp, const aasdk::common::DataConstBuffer& buffer) = 0; virtual void write(uint64_t timestamp, const aasdk::common::DataConstBuffer& buffer) = 0;
virtual void stop() = 0; virtual void stop() = 0;
virtual aasdk::proto::enums::VideoFPS::Enum getVideoFPS() const = 0; virtual aasdk::proto::enums::VideoFPS::Enum getVideoFPS() const = 0;
virtual aasdk::proto::enums::VideoResolution::Enum getVideoResolution() const = 0; virtual aasdk::proto::enums::VideoResolution::Enum getVideoResolution() const = 0;
virtual size_t getScreenDPI() const = 0; virtual size_t getScreenDPI() const = 0;

View File

@ -81,6 +81,7 @@ signals:
void cameraRecord(); void cameraRecord();
void openConnectDialog(); void openConnectDialog();
void openWifiDialog(); void openWifiDialog();
void openUpdateDialog();
void showBrightnessSlider(); void showBrightnessSlider();
void showVolumeSlider(); void showVolumeSlider();
void showAlphaSlider(); void showAlphaSlider();
@ -145,6 +146,7 @@ private slots:
void setTrigger(); void setTrigger();
void setRetryUSBConnect(); void setRetryUSBConnect();
void resetRetryUSBMessage(); void resetRetryUSBMessage();
void updateNetworkInfo();
bool check_file_exist(const char *filename); bool check_file_exist(const char *filename);
private: private:
@ -247,6 +249,7 @@ private:
bool csmtupdate = false; bool csmtupdate = false;
bool udevupdate = false; bool udevupdate = false;
bool openautoupdate = false; bool openautoupdate = false;
bool systemupdate = false;
}; };
} }

View File

@ -75,6 +75,8 @@ private slots:
void onUpdateBrightness3(int value); void onUpdateBrightness3(int value);
void onUpdateBrightness4(int value); void onUpdateBrightness4(int value);
void onUpdateBrightness5(int value); void onUpdateBrightness5(int value);
void on_pushButtonNetwork0_clicked();
void on_pushButtonNetwork1_clicked();
private slots: private slots:
void show_tab1(); void show_tab1();

View File

@ -0,0 +1,51 @@
#pragma once
#include <QDialog>
#include <QFileSystemWatcher>
#include <QDir>
#include <QStringList>
#include <QTimer>
#include <QFileInfo>
namespace Ui {
class UpdateDialog;
}
namespace f1x
{
namespace openauto
{
namespace autoapp
{
namespace ui
{
class UpdateDialog : public QDialog
{
Q_OBJECT
public:
explicit UpdateDialog(QWidget *parent = nullptr);
~UpdateDialog() override;
void updateCheck();
void downloadCheck();
void updateProgress();
private slots:
void on_pushButtonUpdateCsmt_clicked();
void on_pushButtonUpdateUdev_clicked();
void on_pushButtonUpdateOpenauto_clicked();
void on_pushButtonUpdateSystem_clicked();
void on_pushButtonUpdateCheck_clicked();
private:
Ui::UpdateDialog *ui_;
QFileSystemWatcher* watcher_tmp;
QFileSystemWatcher* watcher_download;
};
}
}
}
}

View File

@ -1,7 +1,7 @@
#include <QDialog> #include <QDialog>
namespace Ui { namespace Ui {
class Warning; class WarningDialog;
} }
namespace f1x namespace f1x
@ -13,15 +13,15 @@ namespace autoapp
namespace ui namespace ui
{ {
class Warning : public QDialog class WarningDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit Warning(QWidget *parent = nullptr); explicit WarningDialog(QWidget *parent = nullptr);
~Warning() override; ~WarningDialog() override;
Ui::Warning* ui_; Ui::WarningDialog* ui_;
private slots: private slots:
void Autoclose(); void Autoclose();

View File

@ -1,59 +0,0 @@
#include <QDialog>
#include <QTimer>
#include <QList>
#include <QInputDialog>
#include <QStandardItem>
#include <QStandardItemModel>
#include <QNetworkConfiguration>
#include <QNetworkConfigurationManager>
#include <QNetworkSession>
namespace Ui {
class WifiDialog;
}
namespace f1x
{
namespace openauto
{
namespace autoapp
{
namespace ui
{
class WifiDialog : public QDialog
{
Q_OBJECT
public:
explicit WifiDialog(QWidget *parent = nullptr);
~WifiDialog() override;
bool connected;
int foundCount;
QNetworkConfiguration netcfg;
QStringList WiFisList;
QList<QNetworkConfiguration> netcfgList;
Ui::WifiDialog* ui_;
public slots:
void findActiveWirelesses();
void connectionStatusOpened();
void connectionStatusClosed();
void statusBarMessage(QString msg, QString color);
void configurationStateChanged();
private slots:
void on_btnConnect_clicked();
private:
QTimer *findTimer;
QStandardItemModel* listModel;
QNetworkSession *session;
};
}
}
}
}

View File

@ -108,11 +108,17 @@ void App::aoapDeviceHandler(aasdk::usb::DeviceHandle deviceHandle)
try try
{ {
// ignore autostart if exit to csng was used
if (!disableAutostartEntity) {
OPENAUTO_LOG(info) << "[App] Autostart Entity allowed - let's go.";
connectedAccessoriesEnumerator_->cancel(); connectedAccessoriesEnumerator_->cancel();
auto aoapDevice(aasdk::usb::AOAPDevice::create(usbWrapper_, ioService_, deviceHandle)); auto aoapDevice(aasdk::usb::AOAPDevice::create(usbWrapper_, ioService_, deviceHandle));
androidAutoEntity_ = androidAutoEntityFactory_.create(std::move(aoapDevice)); androidAutoEntity_ = androidAutoEntityFactory_.create(std::move(aoapDevice));
androidAutoEntity_->start(*this); androidAutoEntity_->start(*this);
} else {
OPENAUTO_LOG(info) << "[App] Autostart Entity not allowed - skip.";
}
} }
catch(const aasdk::error::Error& error) catch(const aasdk::error::Error& error)
{ {
@ -149,17 +155,21 @@ void App::waitForDevice()
void App::onAndroidAutoQuit() void App::onAndroidAutoQuit()
{ {
strand_.dispatch([this, self = this->shared_from_this()]() { strand_.dispatch([this, self = this->shared_from_this()]() {
OPENAUTO_LOG(info) << "[App] quit."; OPENAUTO_LOG(info) << "[App] onAndroidAutoQuit.";
try {
androidAutoEntity_->stop(); androidAutoEntity_->stop();
androidAutoEntity_.reset(); androidAutoEntity_.reset();
} catch (...) {
OPENAUTO_LOG(info) << "[App] Exception in onAndroidAutoQuit.";
}
if(!isStopped_) if(!isStopped_)
{ {
try { try {
this->waitForDevice(); this->waitForDevice();
} catch (...) { } catch (...) {
OPENAUTO_LOG(info) << "[App] Exception in onAndroidAutoQuit."; OPENAUTO_LOG(info) << "[App] Exception in onAndroidAutoQuit - waitfordevice.";
} }
} }

View File

@ -41,6 +41,7 @@ const std::string Configuration::cGeneralHideAlphaKey = "General.HideAlpha";
const std::string Configuration::cGeneralShowLuxKey = "General.ShowLux"; const std::string Configuration::cGeneralShowLuxKey = "General.ShowLux";
const std::string Configuration::cGeneralShowCursorKey = "General.ShowCursor"; const std::string Configuration::cGeneralShowCursorKey = "General.ShowCursor";
const std::string Configuration::cGeneralHideBrightnessControlKey = "General.HideBrightnessControl"; const std::string Configuration::cGeneralHideBrightnessControlKey = "General.HideBrightnessControl";
const std::string Configuration::cGeneralShowNetworkinfoKey = "General.ShowNetworkinfo";
const std::string Configuration::cGeneralHandednessOfTrafficTypeKey = "General.HandednessOfTrafficType"; const std::string Configuration::cGeneralHandednessOfTrafficTypeKey = "General.HandednessOfTrafficType";
@ -106,6 +107,7 @@ void Configuration::load()
showLux_ = iniConfig.get<bool>(cGeneralShowLuxKey, false); showLux_ = iniConfig.get<bool>(cGeneralShowLuxKey, false);
showCursor_ = iniConfig.get<bool>(cGeneralShowCursorKey, false); showCursor_ = iniConfig.get<bool>(cGeneralShowCursorKey, false);
hideBrightnessControl_ = iniConfig.get<bool>(cGeneralHideBrightnessControlKey, false); hideBrightnessControl_ = iniConfig.get<bool>(cGeneralHideBrightnessControlKey, false);
showNetworkinfo_ = iniConfig.get<bool>(cGeneralShowNetworkinfoKey, false);
mp3MasterPath_ = iniConfig.get<std::string>(cGeneralMp3MasterPathKey, "/media/MYMEDIA"); mp3MasterPath_ = iniConfig.get<std::string>(cGeneralMp3MasterPathKey, "/media/MYMEDIA");
mp3SubFolder_ = iniConfig.get<std::string>(cGeneralMp3SubFolderKey, "/"); mp3SubFolder_ = iniConfig.get<std::string>(cGeneralMp3SubFolderKey, "/");
mp3Track_ = iniConfig.get<size_t>(cGeneralMp3TrackKey, 0); mp3Track_ = iniConfig.get<size_t>(cGeneralMp3TrackKey, 0);
@ -154,6 +156,7 @@ void Configuration::reset()
showLux_ = false; showLux_ = false;
showCursor_ = false; showCursor_ = false;
hideBrightnessControl_ = false; hideBrightnessControl_ = false;
showNetworkinfo_ = false;
mp3MasterPath_ = "/media/MYMEDIA"; mp3MasterPath_ = "/media/MYMEDIA";
mp3SubFolder_ = "/"; mp3SubFolder_ = "/";
mp3Track_ = 0; mp3Track_ = 0;
@ -187,6 +190,7 @@ void Configuration::save()
iniConfig.put<bool>(cGeneralShowLuxKey, showLux_); iniConfig.put<bool>(cGeneralShowLuxKey, showLux_);
iniConfig.put<bool>(cGeneralShowCursorKey, showCursor_); iniConfig.put<bool>(cGeneralShowCursorKey, showCursor_);
iniConfig.put<bool>(cGeneralHideBrightnessControlKey, hideBrightnessControl_); iniConfig.put<bool>(cGeneralHideBrightnessControlKey, hideBrightnessControl_);
iniConfig.put<bool>(cGeneralShowNetworkinfoKey, showNetworkinfo_);
iniConfig.put<std::string>(cGeneralMp3MasterPathKey, mp3MasterPath_); iniConfig.put<std::string>(cGeneralMp3MasterPathKey, mp3MasterPath_);
iniConfig.put<std::string>(cGeneralMp3SubFolderKey, mp3SubFolder_); iniConfig.put<std::string>(cGeneralMp3SubFolderKey, mp3SubFolder_);
iniConfig.put<int32_t>(cGeneralMp3TrackKey, mp3Track_); iniConfig.put<int32_t>(cGeneralMp3TrackKey, mp3Track_);
@ -331,6 +335,16 @@ bool Configuration::hideBrightnessControl() const
return hideBrightnessControl_; return hideBrightnessControl_;
} }
void Configuration::showNetworkinfo(bool value)
{
showNetworkinfo_ = value;
}
bool Configuration::showNetworkinfo() const
{
return showNetworkinfo_;
}
std::string Configuration::getMp3MasterPath() const std::string Configuration::getMp3MasterPath() const
{ {
return mp3MasterPath_; return mp3MasterPath_;

View File

@ -35,7 +35,6 @@ QtVideoOutput::QtVideoOutput(configuration::IConfiguration::Pointer configuratio
this->moveToThread(QApplication::instance()->thread()); this->moveToThread(QApplication::instance()->thread());
connect(this, &QtVideoOutput::startPlayback, this, &QtVideoOutput::onStartPlayback, Qt::QueuedConnection); connect(this, &QtVideoOutput::startPlayback, this, &QtVideoOutput::onStartPlayback, Qt::QueuedConnection);
connect(this, &QtVideoOutput::stopPlayback, this, &QtVideoOutput::onStopPlayback, Qt::QueuedConnection); connect(this, &QtVideoOutput::stopPlayback, this, &QtVideoOutput::onStopPlayback, Qt::QueuedConnection);
QMetaObject::invokeMethod(this, "createVideoOutput", Qt::BlockingQueuedConnection); QMetaObject::invokeMethod(this, "createVideoOutput", Qt::BlockingQueuedConnection);
} }

View File

@ -158,12 +158,9 @@ void VideoService::onVideoFocusRequest(const aasdk::proto::messages::VideoFocusR
<< ", focus mode: " << request.focus_mode() << ", focus mode: " << request.focus_mode()
<< ", focus reason: " << request.focus_reason(); << ", focus reason: " << request.focus_reason();
this->sendVideoFocusIndication();
channel_->receive(this->shared_from_this());
// stop video service on go back to openauto // stop video service on go back to openauto
if (request.focus_mode() == 2) { if (request.focus_mode() == 2) {
OPENAUTO_LOG(info) << "[VideoService] Exit entity..."; OPENAUTO_LOG(info) << "[VideoService] Back to CSNG...";
try { try {
if (!std::ifstream("/tmp/entityexit")) { if (!std::ifstream("/tmp/entityexit")) {
std::ofstream("/tmp/entityexit"); std::ofstream("/tmp/entityexit");
@ -172,6 +169,9 @@ void VideoService::onVideoFocusRequest(const aasdk::proto::messages::VideoFocusR
OPENAUTO_LOG(error) << "[VideoService] Error in creating entityexit"; OPENAUTO_LOG(error) << "[VideoService] Error in creating entityexit";
} }
} }
this->sendVideoFocusIndication();
channel_->receive(this->shared_from_this());
} }
void VideoService::sendVideoFocusIndication() void VideoService::sendVideoFocusIndication()

View File

@ -4,6 +4,7 @@
#include <QFileInfo> #include <QFileInfo>
#include <QTextStream> #include <QTextStream>
#include <fstream> #include <fstream>
#include <QNetworkInterface>
namespace f1x namespace f1x
{ {
@ -128,6 +129,9 @@ void ConnectDialog::loadClientList()
cleaner--; cleaner--;
} }
if (std::ifstream("/tmp/hotspot_active")) {
ui_->listWidgetClients->show();
ui_->pushButtonUpdate->show();
if (std::ifstream("/tmp/temp_recent_list")) { if (std::ifstream("/tmp/temp_recent_list")) {
QFile versionFile(QString("/tmp/temp_recent_list")); QFile versionFile(QString("/tmp/temp_recent_list"));
versionFile.open(QIODevice::ReadOnly); versionFile.open(QIODevice::ReadOnly);
@ -142,26 +146,40 @@ void ConnectDialog::loadClientList()
} }
} }
versionFile.close(); 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 { } else {
ui_->lineEditIPAddress->setText(""); ui_->lineEditIPAddress->setText("");
} }
} else {
ui_->listWidgetClients->hide();
if (std::ifstream("/tmp/gateway_wlan0")) {
ui_->pushButtonUpdate->hide();
QFile gatewayData(QString("/tmp/gateway_wlan0"));
gatewayData.open(QIODevice::ReadOnly);
QTextStream gateway_date(&gatewayData);
QString linedate = gateway_date.readAll();
gatewayData.close();
if (linedate != "") {
ui_->lineEditIPAddress->setText(linedate.simplified());
ui_->listWidgetClients->addItem(linedate.simplified());
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("");
}
}
} }
void ConnectDialog::insertIpAddress(const std::string& ipAddress) void ConnectDialog::insertIpAddress(const std::string& ipAddress)

View File

@ -31,6 +31,7 @@
#include <QRect> #include <QRect>
#include <QFileSystemWatcher> #include <QFileSystemWatcher>
#include <QVideoWidget> #include <QVideoWidget>
#include <QNetworkInterface>
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <cstdio> #include <cstdio>
@ -86,7 +87,7 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
ui_->setupUi(this); ui_->setupUi(this);
connect(ui_->pushButtonSettings, &QPushButton::clicked, this, &MainWindow::openSettings); connect(ui_->pushButtonSettings, &QPushButton::clicked, this, &MainWindow::openSettings);
connect(ui_->pushButtonSettings2, &QPushButton::clicked, this, &MainWindow::openSettings); connect(ui_->pushButtonSettings2, &QPushButton::clicked, this, &MainWindow::openSettings);
connect(ui_->pushButtonWifiSetup, &QPushButton::clicked, this, &MainWindow::openWifiDialog); connect(ui_->pushButtonUpdate, &QPushButton::clicked, this, &MainWindow::openUpdateDialog);
connect(ui_->pushButtonExit, &QPushButton::clicked, this, &MainWindow::toggleExit); connect(ui_->pushButtonExit, &QPushButton::clicked, this, &MainWindow::toggleExit);
connect(ui_->pushButtonExit2, &QPushButton::clicked, this, &MainWindow::toggleExit); connect(ui_->pushButtonExit2, &QPushButton::clicked, this, &MainWindow::toggleExit);
connect(ui_->pushButtonShutdown, &QPushButton::clicked, this, &MainWindow::exit); connect(ui_->pushButtonShutdown, &QPushButton::clicked, this, &MainWindow::exit);
@ -127,6 +128,8 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
connect(ui_->pushButtonAndroidAuto2, &QPushButton::clicked, this, &MainWindow::TriggerAppStart); connect(ui_->pushButtonAndroidAuto2, &QPushButton::clicked, this, &MainWindow::TriggerAppStart);
connect(ui_->pushButtonAndroidAuto2, &QPushButton::clicked, this, &MainWindow::setRetryUSBConnect); connect(ui_->pushButtonAndroidAuto2, &QPushButton::clicked, this, &MainWindow::setRetryUSBConnect);
ui_->clockOnlyWidget->hide();
// by default hide bluetooth button on init // by default hide bluetooth button on init
ui_->pushButtonBluetooth->hide(); ui_->pushButtonBluetooth->hide();
@ -135,13 +138,36 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
ui_->pushButtonUSB->hide(); ui_->pushButtonUSB->hide();
ui_->SysinfoTopLeft->hide(); ui_->SysinfoTopLeft->hide();
ui_->pushButtonWifiSetup->hide();
ui_->pushButtonAndroidAuto->hide(); ui_->pushButtonAndroidAuto->hide();
ui_->pushButtonAndroidAuto2->hide(); ui_->pushButtonAndroidAuto2->hide();
ui_->SysinfoTopLeft2->hide(); ui_->SysinfoTopLeft2->hide();
ui_->pushButtonUpdate->hide();
ui_->label_dummy_right->hide();
ui_->dcRecording->hide();
if (!configuration->showNetworkinfo()) {
ui_->networkInfo->hide();
}
if (check_file_exist("/etc/crankshaft.branch")) {
QFile branchFile(QString("/etc/crankshaft.branch"));
branchFile.open(QIODevice::ReadOnly);
QTextStream data_branch(&branchFile);
QString branch = data_branch.readAll().split("\n")[0];
branchFile.close();
if (branch != "crankshaft-ng") {
if (branch == "csng-dev") {
ui_->Header_Label->setText("<html><head/><body><p><span style=' font-style:normal; color:#ffffff;'>crank</span><span style=' font-style:normal; color:#5ce739;'>shaft </span><span style=' font-style:normal; color:#40bfbf;'>NG </span><span style=' font-style:normal; color:#888a85;'>- </span><span style=' font-style:normal; color:#cc0000;'>Dev-Build</span></p></body></html>");
} else {
ui_->Header_Label->setText("<html><head/><body><p><span style=' font-style:normal; color:#ffffff;'>crank</span><span style=' font-style:normal; color:#5ce739;'>shaft </span><span style=' font-style:normal; color:#40bfbf;'>NG </span><span style=' font-style:normal; color:#888a85;'>- </span><span style=' font-style:normal; color:#ce5c00;'>Custom-Build</span></p></body></html>");
}
}
}
QTimer *timer=new QTimer(this); QTimer *timer=new QTimer(this);
connect(timer, SIGNAL(timeout()),this,SLOT(showTime())); connect(timer, SIGNAL(timeout()),this,SLOT(showTime()));
timer->start(1000); timer->start(1000);
@ -193,7 +219,7 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
ui_->pushButtonUnMute->hide(); ui_->pushButtonUnMute->hide();
// hide wifi if not forced // hide wifi if not forced
if (!this->wifiButtonForce) { if (!this->wifiButtonForce && !std::ifstream("/tmp/mobile_hotspot_detected")) {
ui_->AAWIFIWidget->hide(); ui_->AAWIFIWidget->hide();
ui_->AAWIFIWidget2->hide(); ui_->AAWIFIWidget2->hide();
} else { } else {
@ -201,6 +227,18 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
ui_->AAUSBWidget2->hide(); ui_->AAUSBWidget2->hide();
} }
if (std::ifstream("/tmp/temp_recent_list") || std::ifstream("/tmp/mobile_hotspot_detected")) {
ui_->pushButtonWifi->show();
ui_->pushButtonNoWiFiDevice->hide();
ui_->pushButtonWifi2->show();
ui_->pushButtonNoWiFiDevice2->hide();
} else {
ui_->pushButtonWifi->hide();
ui_->pushButtonNoWiFiDevice->show();
ui_->pushButtonWifi2->hide();
ui_->pushButtonNoWiFiDevice2->show();
}
// set custom buttons if file enabled by trigger file // set custom buttons if file enabled by trigger file
if (!this->c1ButtonForce) { if (!this->c1ButtonForce) {
ui_->pushButton_c1->hide(); ui_->pushButton_c1->hide();
@ -352,7 +390,7 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
ui_->horizontalSliderBrightness->setTickInterval(brigthnessvalues[2].toInt()); ui_->horizontalSliderBrightness->setTickInterval(brigthnessvalues[2].toInt());
// run monitor for custom brightness command if enabled in crankshaft_env.sh // run monitor for custom brightness command if enabled in crankshaft_env.sh
if (brigthnessvalues[3] == "1") { if (std::ifstream("/tmp/custombrightness")) {
if (!configuration->hideBrightnessControl()) { if (!configuration->hideBrightnessControl()) {
ui_->pushButtonBrightness->show(); ui_->pushButtonBrightness->show();
ui_->pushButtonBrightness2->show(); ui_->pushButtonBrightness2->show();
@ -432,6 +470,13 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
ui_->pushButtonToggleGUI2->hide(); ui_->pushButtonToggleGUI2->hide();
} }
// hide brightness button if eanbled in settings
if (configuration->hideBrightnessControl()) {
ui_->pushButtonBrightness->hide();
ui_->pushButtonBrightness2->hide();
ui_->BrightnessSliderControl->hide();
}
// init alpha values // init alpha values
MainWindow::updateAlpha(); MainWindow::updateAlpha();
@ -486,16 +531,6 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
} }
} }
// update notify
this->csmtupdate = check_file_exist("/tmp/csmt_update_available");
this->udevupdate = check_file_exist("/tmp/udev_update_available");
this->openautoupdate = check_file_exist("/tmp/openauto_update_available");
if (this->csmtupdate || this->udevupdate || this->openautoupdate) {
ui_->SysinfoTopLeft->setText("Update available!");
ui_->SysinfoTopLeft->show();
}
watcher = new QFileSystemWatcher(this); watcher = new QFileSystemWatcher(this);
watcher->addPath("/media/USBDRIVES"); watcher->addPath("/media/USBDRIVES");
connect(watcher, &QFileSystemWatcher::directoryChanged, this, &MainWindow::setTrigger); connect(watcher, &QFileSystemWatcher::directoryChanged, this, &MainWindow::setTrigger);
@ -504,20 +539,7 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
watcher_tmp->addPath("/tmp"); watcher_tmp->addPath("/tmp");
connect(watcher_tmp, &QFileSystemWatcher::directoryChanged, this, &MainWindow::tmpChanged); connect(watcher_tmp, &QFileSystemWatcher::directoryChanged, this, &MainWindow::tmpChanged);
// Experimental test code updateNetworkInfo();
//QBluetoothLocalDevice localDevice;
//QString localDeviceName;
//QString localDeviceAddress;
//if (localDevice.isValid()) {
// localDeviceName = localDevice.name();
// localDeviceAddress = localDevice.address().toString();
// QList<QBluetoothAddress> btdevices;
// btdevices = localDevice.connectedDevices();
// QString btdevice = btdevices.first().toString();
// QMessageBox btMessage(QMessageBox::Critical, "BT Device", btdevice, QMessageBox::Ok);
// btMessage.setWindowFlags(Qt::WindowStaysOnTopHint);
// btMessage.exec();
//}
} }
MainWindow::~MainWindow() MainWindow::~MainWindow()
@ -530,6 +552,46 @@ MainWindow::~MainWindow()
} }
} }
void f1x::openauto::autoapp::ui::MainWindow::updateNetworkInfo()
{
QNetworkInterface wlan0if = QNetworkInterface::interfaceFromName("wlan0");
if (wlan0if.flags().testFlag(QNetworkInterface::IsUp)) {
QList<QNetworkAddressEntry> entrieswlan0 = wlan0if.addressEntries();
if (!entrieswlan0.isEmpty()) {
QNetworkAddressEntry wlan0 = entrieswlan0.first();
//qDebug() << "wlan0: " << wlan0.ip();
ui_->value_ip->setText(wlan0.ip().toString().simplified());
ui_->value_mask->setText(wlan0.netmask().toString().simplified());
if (std::ifstream("/tmp/wifi_ssid")) {
QFile wifiData(QString("/tmp/wifi_ssid"));
wifiData.open(QIODevice::ReadOnly);
QTextStream gateway_date(&wifiData);
QString linedate = gateway_date.readAll();
wifiData.close();
ui_->value_ssid->setText(linedate.simplified());
} else {
ui_->value_ssid->setText("");
}
if (std::ifstream("/tmp/gateway_wlan0")) {
QFile gatewayData(QString("/tmp/gateway_wlan0"));
gatewayData.open(QIODevice::ReadOnly);
QTextStream gateway_date(&gatewayData);
QString linedate = gateway_date.readAll();
gatewayData.close();
ui_->value_gw->setText(linedate.simplified());
} else {
ui_->value_gw->setText("");
}
}
} else {
//qDebug() << "wlan0: down";
ui_->value_ip->setText("");
ui_->value_mask->setText("");
ui_->value_gw->setText("");
ui_->value_ssid->setText("wlan0: down");
}
}
void f1x::openauto::autoapp::ui::MainWindow::customButtonPressed1() void f1x::openauto::autoapp::ui::MainWindow::customButtonPressed1()
{ {
system(qPrintable(this->custom_button_command_c1 + " &")); system(qPrintable(this->custom_button_command_c1 + " &"));
@ -723,22 +785,28 @@ void f1x::openauto::autoapp::ui::MainWindow::updateAlpha()
void f1x::openauto::autoapp::ui::MainWindow::switchGuiToNight() void f1x::openauto::autoapp::ui::MainWindow::switchGuiToNight()
{ {
MainWindow::on_pushButtonVolume_clicked(); //MainWindow::on_pushButtonVolume_clicked();
f1x::openauto::autoapp::ui::MainWindow::updateBG(); f1x::openauto::autoapp::ui::MainWindow::updateBG();
ui_->pushButtonDay->show(); ui_->pushButtonDay->show();
ui_->pushButtonDay2->show(); ui_->pushButtonDay2->show();
ui_->pushButtonNight->hide(); ui_->pushButtonNight->hide();
ui_->pushButtonNight2->hide(); ui_->pushButtonNight2->hide();
if (ui_->mediaWidget->isVisible() == true) {
ui_->VolumeSliderControl->hide();
}
} }
void f1x::openauto::autoapp::ui::MainWindow::switchGuiToDay() void f1x::openauto::autoapp::ui::MainWindow::switchGuiToDay()
{ {
MainWindow::on_pushButtonVolume_clicked(); //MainWindow::on_pushButtonVolume_clicked();
f1x::openauto::autoapp::ui::MainWindow::updateBG(); f1x::openauto::autoapp::ui::MainWindow::updateBG();
ui_->pushButtonNight->show(); ui_->pushButtonNight->show();
ui_->pushButtonNight2->show(); ui_->pushButtonNight2->show();
ui_->pushButtonDay->hide(); ui_->pushButtonDay->hide();
ui_->pushButtonDay2->hide(); ui_->pushButtonDay2->hide();
if (ui_->mediaWidget->isVisible() == true) {
ui_->VolumeSliderControl->hide();
}
} }
void f1x::openauto::autoapp::ui::MainWindow::cameraControlHide() void f1x::openauto::autoapp::ui::MainWindow::cameraControlHide()
@ -867,7 +935,7 @@ void f1x::openauto::autoapp::ui::MainWindow::updateBG()
this->setStyleSheet("QMainWindow { background: url(:/firework.png); background-repeat: no-repeat; background-position: center; }"); this->setStyleSheet("QMainWindow { background: url(:/firework.png); background-repeat: no-repeat; background-position: center; }");
this->holidaybg = true; this->holidaybg = true;
} }
else { else if (ui_->mediaWidget->isVisible() == false) {
if (!this->nightModeEnabled) { if (!this->nightModeEnabled) {
if (this->oldGUIStyle) { if (this->oldGUIStyle) {
if (this->wallpaperClassicDayFileExists) { if (this->wallpaperClassicDayFileExists) {
@ -938,6 +1006,7 @@ void f1x::openauto::autoapp::ui::MainWindow::showTime()
ui_->Digital_clock->setText(time_text); ui_->Digital_clock->setText(time_text);
ui_->bigClock->setText(time_text); ui_->bigClock->setText(time_text);
ui_->bigClock2->setText(time_text);
if (!this->holidaybg) { if (!this->holidaybg) {
if (this->date_text == "12/24") { if (this->date_text == "12/24") {
@ -1326,6 +1395,52 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
} }
} }
// check if system is in display off mode (tap2wake/screensaver)
if (std::ifstream("/tmp/screensaver")) {
if (ui_->menuWidget->isVisible() == true) {
ui_->menuWidget->hide();
}
if (ui_->oldmenuWidget->isVisible() == true) {
ui_->oldmenuWidget->hide();
}
if (ui_->headerWidget->isVisible() == true) {
ui_->headerWidget->hide();
}
if (ui_->mediaWidget->isVisible() == true) {
ui_->mediaWidget->hide();
}
if (ui_->cameraWidget->isVisible() == true) {
ui_->cameraWidget->hide();
}
if (ui_->VolumeSliderControlPlayer->isVisible() == true) {
ui_->VolumeSliderControlPlayer->hide();
}
if (ui_->VolumeSliderControl->isVisible() == true) {
ui_->VolumeSliderControl->hide();
}
if (ui_->BrightnessSliderControl->isVisible() == true) {
ui_->BrightnessSliderControl->hide();
}
cameraHide();
if (ui_->clockOnlyWidget->isVisible() == false) {
ui_->clockOnlyWidget->show();
}
} else {
if (ui_->headerWidget->isVisible() == false) {
ui_->headerWidget->show();
}
if (ui_->VolumeSliderControl->isVisible() == false) {
if (ui_->mediaWidget->isVisible() == false) {
ui_->VolumeSliderControl->show();
}
}
if (ui_->clockOnlyWidget->isVisible() == true) {
ui_->clockOnlyWidget->hide();
toggleGUI();
toggleGUI();
}
}
// check if custom command needs black background // check if custom command needs black background
if (std::ifstream("/tmp/blackscreen")) { if (std::ifstream("/tmp/blackscreen")) {
if (ui_->centralWidget->isVisible() == true) { if (ui_->centralWidget->isVisible() == true) {
@ -1453,6 +1568,17 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
// check if dashcam is recording // check if dashcam is recording
this->dashCamRecording = check_file_exist("/tmp/dashcam_is_recording"); this->dashCamRecording = check_file_exist("/tmp/dashcam_is_recording");
if (this->dashCamRecording) {
if (ui_->dcRecording->isVisible() == false) {
ui_->dcRecording->show();
}
} else {
if (ui_->dcRecording->isVisible() == true) {
ui_->dcRecording->hide();
}
}
// show recording state if dashcam is visible // show recording state if dashcam is visible
if (ui_->cameraWidget->isVisible() == true) { if (ui_->cameraWidget->isVisible() == true) {
if (this->dashCamRecording) { if (this->dashCamRecording) {
@ -1490,8 +1616,8 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
this->hotspotActive = check_file_exist("/tmp/hotspot_active"); this->hotspotActive = check_file_exist("/tmp/hotspot_active");
// hide wifi if hotspot disabled // hide wifi if hotspot disabled and force wifi unselected
if (!this->hotspotActive) { if (!this->hotspotActive && !std::ifstream("/tmp/mobile_hotspot_detected")) {
if ((ui_->AAWIFIWidget->isVisible() == true) || (ui_->AAWIFIWidget2->isVisible() == true)){ if ((ui_->AAWIFIWidget->isVisible() == true) || (ui_->AAWIFIWidget2->isVisible() == true)){
ui_->AAWIFIWidget->hide(); ui_->AAWIFIWidget->hide();
ui_->AAWIFIWidget2->hide(); ui_->AAWIFIWidget2->hide();
@ -1507,7 +1633,7 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
} }
} }
if (std::ifstream("/tmp/temp_recent_list")) { if (std::ifstream("/tmp/temp_recent_list") || std::ifstream("/tmp/mobile_hotspot_detected")) {
if (ui_->pushButtonWifi->isVisible() == false) { if (ui_->pushButtonWifi->isVisible() == false) {
ui_->pushButtonWifi->show(); ui_->pushButtonWifi->show();
} }
@ -1588,6 +1714,16 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
} }
} }
if (!this->configuration_->showNetworkinfo()) {
if (ui_->networkInfo->isVisible() == true) {
ui_->networkInfo->hide();
}
} else {
if (ui_->networkInfo->isVisible() == false) {
ui_->networkInfo->show();
}
}
// hide gui toggle if enabled in settings // hide gui toggle if enabled in settings
if (this->configuration_->hideMenuToggle()) { if (this->configuration_->hideMenuToggle()) {
ui_->pushButtonToggleGUI->hide(); ui_->pushButtonToggleGUI->hide();
@ -1603,8 +1739,10 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
ui_->pushButtonBrightness->hide(); ui_->pushButtonBrightness->hide();
ui_->pushButtonBrightness2->hide(); ui_->pushButtonBrightness2->hide();
ui_->BrightnessSliderControl->hide(); ui_->BrightnessSliderControl->hide();
if (ui_->mediaWidget->isVisible() == false) {
ui_->VolumeSliderControl->show(); ui_->VolumeSliderControl->show();
} }
}
} else { } else {
if (!this->lightsensor) { if (!this->lightsensor) {
if ((ui_->pushButtonBrightness->isVisible() == false) || (ui_->pushButtonBrightness->isVisible() == false)) { if ((ui_->pushButtonBrightness->isVisible() == false) || (ui_->pushButtonBrightness->isVisible() == false)) {
@ -1635,4 +1773,34 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
} }
} }
MainWindow::updateAlpha(); MainWindow::updateAlpha();
// update notify
this->csmtupdate = check_file_exist("/tmp/csmt_update_available");
this->udevupdate = check_file_exist("/tmp/udev_update_available");
this->openautoupdate = check_file_exist("/tmp/openauto_update_available");
this->systemupdate = check_file_exist("/tmp/system_update_available");
if (this->csmtupdate || this->udevupdate || this->openautoupdate || this->systemupdate) {
if (ui_->pushButtonUpdate->isVisible() == false) {
ui_->pushButtonUpdate->show();
ui_->label_left->show();
ui_->label_right->show();
if (this->devModeEnabled) {
ui_->devlabel_right->hide();
} else {
ui_->label_dummy_right->show();
}
}
} else {
if (ui_->pushButtonUpdate->isVisible() == true) {
ui_->pushButtonUpdate->hide();
ui_->label_left->hide();
ui_->label_right->hide();
ui_->label_dummy_right->hide();
if (this->devModeEnabled) {
ui_->devlabel_right->show();
}
}
}
updateNetworkInfo();
} }

View File

@ -26,7 +26,6 @@
#include <QTimer> #include <QTimer>
#include <QDateTime> #include <QDateTime>
#include <QNetworkInterface> #include <QNetworkInterface>
#include <QNetworkConfigurationManager>
#include <fstream> #include <fstream>
#include <QStorageInfo> #include <QStorageInfo>
@ -72,11 +71,17 @@ SettingsWindow::SettingsWindow(configuration::IConfiguration::Pointer configurat
connect(ui_->pushButtonShowBindings, &QPushButton::clicked, this, &SettingsWindow::onShowBindings); connect(ui_->pushButtonShowBindings, &QPushButton::clicked, this, &SettingsWindow::onShowBindings);
connect(ui_->horizontalSliderSystemVolume, &QSlider::valueChanged, this, &SettingsWindow::onUpdateSystemVolume); connect(ui_->horizontalSliderSystemVolume, &QSlider::valueChanged, this, &SettingsWindow::onUpdateSystemVolume);
connect(ui_->horizontalSliderSystemCapture, &QSlider::valueChanged, this, &SettingsWindow::onUpdateSystemCapture); connect(ui_->horizontalSliderSystemCapture, &QSlider::valueChanged, this, &SettingsWindow::onUpdateSystemCapture);
connect(ui_->pushButtonHotspotStart, &QPushButton::clicked, this, &SettingsWindow::onStartHotspot); connect(ui_->radioButtonHotspot, &QPushButton::clicked, this, &SettingsWindow::onStartHotspot);
connect(ui_->pushButtonHotspotStop, &QPushButton::clicked, this, &SettingsWindow::onStopHotspot); connect(ui_->radioButtonClient, &QPushButton::clicked, this, &SettingsWindow::onStopHotspot);
connect(ui_->pushButtonSetTime, &QPushButton::clicked, this, &SettingsWindow::setTime); connect(ui_->pushButtonSetTime, &QPushButton::clicked, this, &SettingsWindow::setTime);
connect(ui_->pushButtonSetTime, &QPushButton::clicked, this, &SettingsWindow::close); connect(ui_->pushButtonSetTime, &QPushButton::clicked, this, &SettingsWindow::close);
connect(ui_->pushButtonNTP, &QPushButton::clicked, this, &SettingsWindow::close); connect(ui_->pushButtonNTP, &QPushButton::clicked, this, &SettingsWindow::close);
connect(ui_->pushButtonCheckNow, &QPushButton::clicked, [&]() { system("/usr/local/bin/crankshaft update check &"); });
connect(ui_->pushButtonDebuglog, &QPushButton::clicked, this, &SettingsWindow::close);
connect(ui_->pushButtonDebuglog, &QPushButton::clicked, [&]() { system("/usr/local/bin/crankshaft debuglog &");});
connect(ui_->pushButtonNetworkAuto, &QPushButton::clicked, [&]() { system("/usr/local/bin/crankshaft network auto &");});
connect(ui_->pushButtonNetwork0, &QPushButton::clicked, this, &SettingsWindow::on_pushButtonNetwork0_clicked);
connect(ui_->pushButtonNetwork1, &QPushButton::clicked, this, &SettingsWindow::on_pushButtonNetwork1_clicked);
// menu // menu
ui_->tab1->show(); ui_->tab1->show();
@ -110,20 +115,18 @@ SettingsWindow::SettingsWindow(configuration::IConfiguration::Pointer configurat
QString time_text_minute=time.toString("mm"); QString time_text_minute=time.toString("mm");
ui_->spinBoxHour->setValue((time_text_hour).toInt()); ui_->spinBoxHour->setValue((time_text_hour).toInt());
ui_->spinBoxMinute->setValue((time_text_minute).toInt()); ui_->spinBoxMinute->setValue((time_text_minute).toInt());
ui_->label_modeswitchprogress->hide(); ui_->label_modeswitchprogress->setText("Ok");
if (std::ifstream("/tmp/hotspot_active")) { if (std::ifstream("/tmp/hotspot_active")) {
ui_->pushButtonHotspotStop->show(); ui_->radioButtonClient->setChecked(0);
ui_->pushButtonHotspotStart->hide(); ui_->radioButtonHotspot->setChecked(1);
ui_->lineEdit_wifimode->setText("Hotspot");
ui_->lineEditWifiSSID->setText(this->hotspotssid); ui_->lineEditWifiSSID->setText(this->hotspotssid);
ui_->lineEditPassword->show(); ui_->lineEditPassword->show();
ui_->label_password->show(); ui_->label_password->show();
ui_->lineEditPassword->setText("1234567890"); ui_->lineEditPassword->setText("1234567890");
} else { } else {
ui_->pushButtonHotspotStart->show(); ui_->radioButtonClient->setChecked(1);
ui_->pushButtonHotspotStop->hide(); ui_->radioButtonHotspot->setChecked(0);
ui_->lineEdit_wifimode->setText("Client");
ui_->lineEditWifiSSID->setText(this->wifissid); ui_->lineEditWifiSSID->setText(this->wifissid);
ui_->lineEditPassword->hide(); ui_->lineEditPassword->hide();
ui_->label_password->hide(); ui_->label_password->hide();
@ -148,6 +151,7 @@ void SettingsWindow::onSave()
configuration_->showLux(ui_->checkBoxShowLux->isChecked()); configuration_->showLux(ui_->checkBoxShowLux->isChecked());
configuration_->showCursor(ui_->checkBoxShowCursor->isChecked()); configuration_->showCursor(ui_->checkBoxShowCursor->isChecked());
configuration_->hideBrightnessControl(ui_->checkBoxHideBrightnessControl->isChecked()); configuration_->hideBrightnessControl(ui_->checkBoxHideBrightnessControl->isChecked());
configuration_->showNetworkinfo(ui_->checkBoxNetworkinfo->isChecked());
configuration_->mp3AutoPlay(ui_->checkBoxAutoPlay->isChecked()); configuration_->mp3AutoPlay(ui_->checkBoxAutoPlay->isChecked());
configuration_->showAutoPlay(ui_->checkBoxShowPlayer->isChecked()); configuration_->showAutoPlay(ui_->checkBoxShowPlayer->isChecked());
@ -347,7 +351,12 @@ void SettingsWindow::onSave()
params.append("#"); params.append("#");
params.append( std::string(ui_->comboBoxCountryCode->currentText().split("|")[0].replace(" ","").toStdString()) ); params.append( std::string(ui_->comboBoxCountryCode->currentText().split("|")[0].replace(" ","").toStdString()) );
params.append("#"); params.append("#");
if (ui_->checkBoxBlankOnly ->isChecked()) {
params.append("1");
} else {
params.append("0");
}
params.append("#");
system((std::string("/usr/local/bin/autoapp_helper setparams#") + std::string(params) + std::string(" &") ).c_str()); system((std::string("/usr/local/bin/autoapp_helper setparams#") + std::string(params) + std::string(" &") ).c_str());
this->close(); this->close();
@ -383,6 +392,7 @@ void SettingsWindow::load()
ui_->checkBoxShowLux->setChecked(configuration_->showLux()); ui_->checkBoxShowLux->setChecked(configuration_->showLux());
ui_->checkBoxShowCursor->setChecked(configuration_->showCursor()); ui_->checkBoxShowCursor->setChecked(configuration_->showCursor());
ui_->checkBoxHideBrightnessControl->setChecked(configuration_->hideBrightnessControl()); ui_->checkBoxHideBrightnessControl->setChecked(configuration_->hideBrightnessControl());
ui_->checkBoxNetworkinfo->setChecked(configuration_->showNetworkinfo());
ui_->checkBoxAutoPlay->setChecked(configuration_->mp3AutoPlay()); ui_->checkBoxAutoPlay->setChecked(configuration_->mp3AutoPlay());
ui_->checkBoxShowPlayer->setChecked(configuration_->showAutoPlay()); ui_->checkBoxShowPlayer->setChecked(configuration_->showAutoPlay());
@ -953,7 +963,15 @@ void SettingsWindow::loadSystemValues()
ui_->radioButtonCustom->setChecked(true); ui_->radioButtonCustom->setChecked(true);
} }
ui_->comboBoxCountryCode->setCurrentIndex(ui_->comboBoxCountryCode->findText(getparams[44], Qt::MatchFlag::MatchStartsWith)); ui_->comboBoxCountryCode->setCurrentIndex(ui_->comboBoxCountryCode->findText(getparams[44], Qt::MatchFlag::MatchStartsWith));
// set screen blank instead off
if (getparams[45] == "1") {
ui_->checkBoxBlankOnly->setChecked(true);
} else {
ui_->checkBoxBlankOnly->setChecked(false);
} }
}
// update network info
updateNetworkInfo();
} }
void SettingsWindow::onShowBindings() void SettingsWindow::onShowBindings()
@ -983,26 +1001,28 @@ void SettingsWindow::onShowBindings()
void SettingsWindow::onStartHotspot() void SettingsWindow::onStartHotspot()
{ {
ui_->label_modeswitchprogress->show(); ui_->label_modeswitchprogress->setText("Wait ...");
ui_->pushButtonHotspotStart->hide(); ui_->radioButtonClient->setEnabled(0);
ui_->pushButtonHotspotStop->hide(); ui_->radioButtonHotspot->setEnabled(0);
ui_->lineEdit_wifimode->setText("");
ui_->lineEdit_wlan0->setText(""); ui_->lineEdit_wlan0->setText("");
ui_->lineEditWifiSSID->setText(""); ui_->lineEditWifiSSID->setText("");
system("touch /tmp/manual_hotspot_control && sudo systemctl start hotspot &"); qApp->processEvents();
std::remove("/tmp/manual_hotspot_control");
std::ofstream("/tmp/manual_hotspot_control");
system("/opt/crankshaft/service_hotspot.sh start &");
QTimer::singleShot(15000, this, SLOT(updateNetworkInfo())); QTimer::singleShot(15000, this, SLOT(updateNetworkInfo()));
} }
void SettingsWindow::onStopHotspot() void SettingsWindow::onStopHotspot()
{ {
ui_->label_modeswitchprogress->show(); ui_->label_modeswitchprogress->setText("Wait ...");
ui_->pushButtonHotspotStart->hide(); ui_->radioButtonClient->setEnabled(0);
ui_->pushButtonHotspotStop->hide(); ui_->radioButtonHotspot->setEnabled(0);
ui_->lineEdit_wifimode->setText("");
ui_->lineEdit_wlan0->setText(""); ui_->lineEdit_wlan0->setText("");
ui_->lineEditWifiSSID->setText(""); ui_->lineEditWifiSSID->setText("");
ui_->lineEditPassword->setText(""); ui_->lineEditPassword->setText("");
system("sudo systemctl stop hotspot &"); qApp->processEvents();
system("/opt/crankshaft/service_hotspot.sh stop &");
QTimer::singleShot(15000, this, SLOT(updateNetworkInfo())); QTimer::singleShot(15000, this, SLOT(updateNetworkInfo()));
} }
@ -1161,28 +1181,60 @@ void f1x::openauto::autoapp::ui::SettingsWindow::updateNetworkInfo()
//qDebug() << "wlan0: " << wlan0.ip(); //qDebug() << "wlan0: " << wlan0.ip();
ui_->lineEdit_wlan0->setText(wlan0.ip().toString()); ui_->lineEdit_wlan0->setText(wlan0.ip().toString());
} }
if (std::ifstream("/tmp/wifi_ssid")) {
QFile wifiData(QString("/tmp/wifi_ssid"));
wifiData.open(QIODevice::ReadOnly);
QTextStream gateway_date(&wifiData);
QString linedate = gateway_date.readAll();
wifiData.close();
ui_->lineEditWifiSSID->setText(linedate.simplified());
} else {
ui_->lineEditWifiSSID->setText("");
}
} else { } else {
//qDebug() << "wlan0: down"; //qDebug() << "wlan0: down";
ui_->lineEdit_wlan0->setText("interface down"); ui_->lineEdit_wlan0->setText("interface down");
} }
if (std::ifstream("/tmp/hotspot_active")) { if (std::ifstream("/tmp/hotspot_active")) {
ui_->pushButtonHotspotStop->show(); ui_->radioButtonClient->setEnabled(1);
ui_->pushButtonHotspotStart->hide(); ui_->radioButtonHotspot->setEnabled(1);
ui_->label_modeswitchprogress->hide(); ui_->radioButtonHotspot->setChecked(1);
ui_->lineEdit_wifimode->setText("Hotspot"); ui_->radioButtonClient->setChecked(0);
ui_->label_modeswitchprogress->setText("Ok");
ui_->lineEditWifiSSID->setText(this->hotspotssid); ui_->lineEditWifiSSID->setText(this->hotspotssid);
ui_->lineEditPassword->show(); ui_->lineEditPassword->show();
ui_->label_password->show(); ui_->label_password->show();
ui_->lineEditPassword->setText("1234567890"); ui_->lineEditPassword->setText("1234567890");
} else { } else {
ui_->pushButtonHotspotStart->show(); ui_->radioButtonClient->setEnabled(1);
ui_->pushButtonHotspotStop->hide(); ui_->radioButtonHotspot->setEnabled(1);
ui_->label_modeswitchprogress->hide(); ui_->radioButtonHotspot->setChecked(0);
ui_->lineEdit_wifimode->setText("Client"); ui_->radioButtonClient->setChecked(1);
ui_->label_modeswitchprogress->setText("Ok");
ui_->lineEditWifiSSID->setText(this->wifissid); ui_->lineEditWifiSSID->setText(this->wifissid);
ui_->lineEditPassword->hide(); ui_->lineEditPassword->hide();
ui_->label_password->hide(); ui_->label_password->hide();
ui_->lineEditPassword->setText(""); ui_->lineEditPassword->setText("");
} }
} }
void f1x::openauto::autoapp::ui::SettingsWindow::on_pushButtonNetwork0_clicked()
{
ui_->lineEdit_wlan0->setText("");
ui_->lineEditWifiSSID->setText("");
ui_->lineEditPassword->setText("");
qApp->processEvents();
system("/usr/local/bin/crankshaft network 0 &");
}
void f1x::openauto::autoapp::ui::SettingsWindow::on_pushButtonNetwork1_clicked()
{
ui_->lineEdit_wlan0->setText("");
ui_->lineEditWifiSSID->setText("");
ui_->lineEditPassword->setText("");
qApp->processEvents();
system("/usr/local/bin/crankshaft network 1 &");
QTimer::singleShot(15000, this, SLOT(updateNetworkInfo()));
}

View File

@ -0,0 +1,176 @@
#include <f1x/openauto/autoapp/UI/UpdateDialog.hpp>
#include "ui_updatedialog.h"
#include <QFileInfo>
#include <QTextStream>
#include <fstream>
#include <cstdio>
namespace f1x
{
namespace openauto
{
namespace autoapp
{
namespace ui
{
UpdateDialog::UpdateDialog(QWidget *parent)
: QDialog(parent)
, ui_(new Ui::UpdateDialog)
{
ui_->setupUi(this);
connect(ui_->pushButtonUpdateCsmt, &QPushButton::clicked, this, &UpdateDialog::on_pushButtonUpdateCsmt_clicked);
connect(ui_->pushButtonUpdateUdev, &QPushButton::clicked, this, &UpdateDialog::on_pushButtonUpdateUdev_clicked);
connect(ui_->pushButtonUpdateOpenauto, &QPushButton::clicked, this, &UpdateDialog::on_pushButtonUpdateOpenauto_clicked);
connect(ui_->pushButtonUpdateSystem, &QPushButton::clicked, this, &UpdateDialog::on_pushButtonUpdateSystem_clicked);
connect(ui_->pushButtonUpdateCheck, &QPushButton::clicked, this, &UpdateDialog::on_pushButtonUpdateCheck_clicked);
connect(ui_->pushButtonClose, &QPushButton::clicked, this, &UpdateDialog::close);
ui_->progressBarCsmt->hide();
ui_->progressBarUdev->hide();
ui_->progressBarOpenauto->hide();
ui_->progressBarSystem->hide();
ui_->labelSystemReadyInstall->hide();
ui_->labelUpdateChecking->hide();
updateCheck();
watcher_tmp = new QFileSystemWatcher(this);
watcher_tmp->addPath("/tmp");
connect(watcher_tmp, &QFileSystemWatcher::directoryChanged, this, &UpdateDialog::updateCheck);
watcher_download = new QFileSystemWatcher(this);
watcher_download->addPath("/media/CSSTORAGE");
connect(watcher_download, &QFileSystemWatcher::directoryChanged, this, &UpdateDialog::downloadCheck);
}
UpdateDialog::~UpdateDialog()
{
delete ui_;
}
void f1x::openauto::autoapp::ui::UpdateDialog::on_pushButtonUpdateCsmt_clicked()
{
ui_->pushButtonUpdateCsmt->hide();
ui_->progressBarCsmt->show();
qApp->processEvents();
system("crankshaft update csmt &");
}
void f1x::openauto::autoapp::ui::UpdateDialog::on_pushButtonUpdateUdev_clicked()
{
ui_->pushButtonUpdateUdev->hide();
ui_->progressBarUdev->show();
qApp->processEvents();
system("crankshaft update udev &");
}
void f1x::openauto::autoapp::ui::UpdateDialog::on_pushButtonUpdateOpenauto_clicked()
{
ui_->pushButtonUpdateOpenauto->hide();
ui_->progressBarOpenauto->show();
qApp->processEvents();
system("crankshaft update openauto &");
}
void f1x::openauto::autoapp::ui::UpdateDialog::on_pushButtonUpdateSystem_clicked()
{
ui_->pushButtonUpdateSystem->hide();
ui_->progressBarSystem->show();
ui_->progressBarSystem->setValue(0);
qApp->processEvents();
system("crankshaft update system &");
}
void f1x::openauto::autoapp::ui::UpdateDialog::on_pushButtonUpdateCheck_clicked()
{
ui_->pushButtonUpdateCheck->hide();
ui_->labelUpdateChecking->show();
qApp->processEvents();
system("/usr/local/bin/crankshaft update check");
updateCheck();
ui_->labelUpdateChecking->hide();
ui_->pushButtonUpdateCheck->show();
}
void f1x::openauto::autoapp::ui::UpdateDialog::downloadCheck()
{
QDir directory("/media/CSSTORAGE");
QStringList files = directory.entryList(QStringList() << "*.zip", QDir::AllEntries, QDir::Name);
foreach(QString filename, files) {
if (filename != "") {
ui_->labelDownload->setText(filename);
}
}
}
void f1x::openauto::autoapp::ui::UpdateDialog::updateCheck()
{
if (!std::ifstream("/tmp/csmt_updating")) {
if (std::ifstream("/tmp/csmt_update_available")) {
ui_->labelCsmtOK->hide();
ui_->pushButtonUpdateCsmt->show();
} else {
ui_->pushButtonUpdateCsmt->hide();
ui_->progressBarCsmt->hide();
ui_->labelCsmtOK->show();
}
}
if (!std::ifstream("/tmp/udev_updating")) {
if (std::ifstream("/tmp/udev_update_available")) {
ui_->labelUdevOK->hide();
ui_->pushButtonUpdateUdev->show();
} else {
ui_->pushButtonUpdateUdev->hide();
ui_->progressBarUdev->hide();
ui_->labelUdevOK->show();
}
}
if (!std::ifstream("/tmp/openauto_updating")) {
if (std::ifstream("/tmp/openauto_update_available")) {
ui_->labelOpenautoOK->hide();
ui_->pushButtonUpdateOpenauto->show();
} else {
ui_->pushButtonUpdateOpenauto->hide();
ui_->progressBarOpenauto->hide();
ui_->labelOpenautoOK->show();
}
}
if (std::ifstream("/tmp/system_update_ready")) {
ui_->labelSystemOK->hide();
ui_->pushButtonUpdateSystem->hide();
ui_->progressBarSystem->hide();
ui_->labelSystemReadyInstall->show();
} else {
ui_->labelSystemReadyInstall->hide();
if (std::ifstream("/tmp/system_update_available")) {
ui_->labelSystemOK->hide();
ui_->progressBarSystem->hide();
ui_->pushButtonUpdateSystem->show();
}
if (std::ifstream("/tmp/system_update_downloading")) {
ui_->labelSystemOK->hide();
ui_->pushButtonUpdateSystem->hide();
ui_->progressBarSystem->show();
QFileInfo downloadfile = "/media/CSSTORAGE/" + ui_->labelDownload->text();
if (downloadfile.exists()) {
qint64 size = downloadfile.size();
size = size/1024/1024;
ui_->progressBarSystem->setValue(size);
}
}
if (!std::ifstream("/tmp/system_update_available") && !std::ifstream("/tmp/system_update_downloading")) {
ui_->progressBarSystem->hide();
ui_->labelSystemOK->show();
ui_->pushButtonUpdateSystem->hide();
}
}
}
}
}
}
}

View File

@ -1,5 +1,5 @@
#include <f1x/openauto/autoapp/UI/Warning.hpp> #include <f1x/openauto/autoapp/UI/WarningDialog.hpp>
#include <ui_warning.h> #include <ui_warningdialog.h>
#include <QTimer> #include <QTimer>
namespace f1x namespace f1x
@ -11,24 +11,24 @@ namespace autoapp
namespace ui namespace ui
{ {
Warning::Warning(QWidget *parent) WarningDialog::WarningDialog(QWidget *parent)
: QDialog(parent) : QDialog(parent)
, ui_(new Ui::Warning) , ui_(new Ui::WarningDialog)
{ {
ui_->setupUi(this); ui_->setupUi(this);
connect(ui_->pushButtonClose, &QPushButton::clicked, this, &Warning::close); connect(ui_->pushButtonClose, &QPushButton::clicked, this, &WarningDialog::close);
QTimer::singleShot(5000, this, SLOT(Autoclose())); QTimer::singleShot(5000, this, SLOT(Autoclose()));
} }
Warning::~Warning() WarningDialog::~WarningDialog()
{ {
delete ui_; delete ui_;
} }
void Warning::Autoclose() void WarningDialog::Autoclose()
{ {
Warning::close(); WarningDialog::close();
} }
} }

View File

@ -1,149 +0,0 @@
#include <f1x/openauto/autoapp/UI/WifiDialog.hpp>
#include <ui_wifidialog.h>
namespace f1x
{
namespace openauto
{
namespace autoapp
{
namespace ui
{
WifiDialog::WifiDialog(QWidget *parent)
: QDialog(parent)
, ui_(new Ui::WifiDialog)
{
ui_->setupUi(this);
findTimer = new QTimer();
findTimer->setInterval(1000);
connect(findTimer,&QTimer::timeout,this,&WifiDialog::findActiveWirelesses);
connect(ui_->pushButtonClose, &QPushButton::clicked, this, &WifiDialog::close);
findTimer->start();
connected = false;
foundCount = 0;
ui_->treeWidgetWiFis->setColumnWidth(0,50);
ui_->treeWidgetWiFis->setColumnWidth(1,200);
findActiveWirelesses();
}
WifiDialog::~WifiDialog()
{
delete ui_;
}
}
}
}
}
void f1x::openauto::autoapp::ui::WifiDialog::findActiveWirelesses()
{
QNetworkConfigurationManager *ncm = new QNetworkConfigurationManager();
connect(ncm, &QNetworkConfigurationManager::onlineStateChanged, this, &WifiDialog::configurationStateChanged);
netcfgList = ncm->allConfigurations();
WiFisList.clear();
for (auto &x : netcfgList)
{
if (x.bearerType() == QNetworkConfiguration::BearerWLAN)
{
if(x.name() == "")
WiFisList << "Unknown(Other Network)";
else
WiFisList << x.name();
qDebug() << x.type();
}
}
for(int i=0; i<WiFisList.size(); i++)
{
bool exist = false;
QTreeWidgetItem * item = new QTreeWidgetItem();
for(int j=0; j<ui_->treeWidgetWiFis->topLevelItemCount(); j++)
{
QTreeWidgetItem *index = ui_->treeWidgetWiFis->topLevelItem(j);
QString str = index->text(1);
if(str == WiFisList[i])
{
exist = true;
break;
}
}
if(!exist)
{
item->setTextAlignment(0,Qt::AlignVCenter);
item->setTextAlignment(1,Qt::AlignHCenter);
item->setText(0,QString::number(++foundCount));
item->setText(1,WiFisList[i]);
ui_->treeWidgetWiFis->addTopLevelItem(item);
}
}
}
void f1x::openauto::autoapp::ui::WifiDialog::connectionStatusOpened()
{
connected = true;
ui_->btnConnect->setText("Disconnect");
statusBarMessage("Successfully Connected.","green");
}
void f1x::openauto::autoapp::ui::WifiDialog::connectionStatusClosed()
{
connected = false;
ui_->btnConnect->setText("Connect");
statusBarMessage("Successfully Disonnected.","red");
}
void f1x::openauto::autoapp::ui::WifiDialog::on_btnConnect_clicked()
{
if(!connected)
{
QString pass = QInputDialog::getText(this, "Password", "Enter Password:",QLineEdit::Password);
if(pass.isEmpty()) return;
QModelIndex index = ui_->treeWidgetWiFis->currentIndex();
QString str = index.data(Qt::DisplayRole).toString();
for (auto &x : netcfgList)
{
if (x.bearerType() == QNetworkConfiguration::BearerWLAN)
{
if (x.name() == str)
{
netcfg = x;
session = new QNetworkSession(netcfg, this);
connect(session,&QNetworkSession::opened,this,&WifiDialog::connectionStatusOpened);
connect(session,&QNetworkSession::closed,this,&WifiDialog::connectionStatusClosed);
session->open();
if(session->isOpen())
{
connected = true;
ui_->btnConnect->setText("Disconnect");
}
}
}
}
}
else
{
session->close();
if(!session->isOpen())
{
connected = false;
ui_->btnConnect->setText("Connect");
}
}
}
void f1x::openauto::autoapp::ui::WifiDialog::statusBarMessage(QString msg, QString color)
{
ui_->statusBar->clearMessage();
ui_->statusBar->setStyleSheet("color:"+color+";");
ui_->statusBar->showMessage(msg, 5000);
}
void f1x::openauto::autoapp::ui::WifiDialog::configurationStateChanged()
{
qDebug()<< "emited";
}

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>500</width> <width>500</width>
<height>360</height> <height>300</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -19,7 +19,13 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>500</width> <width>500</width>
<height>360</height> <height>300</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>300</height>
</size> </size>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -30,6 +36,12 @@
color: rgb(255, 255, 255);</string> color: rgb(255, 255, 255);</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="topMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item> <item>
<widget class="QGroupBox" name="groupBoxIPAddress"> <widget class="QGroupBox" name="groupBoxIPAddress">
<property name="sizePolicy"> <property name="sizePolicy">
@ -42,6 +54,12 @@ color: rgb(255, 255, 255);</string>
<string>IP Address</string> <string>IP Address</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="topMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item> <item>
<widget class="QLineEdit" name="lineEditIPAddress"> <widget class="QLineEdit" name="lineEditIPAddress">
<property name="minimumSize"> <property name="minimumSize">
@ -100,7 +118,10 @@ color: rgb(255, 255, 255);</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="topMargin"> <property name="topMargin">
<number>9</number> <number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property> </property>
<item> <item>
<widget class="QListWidget" name="listWidgetClients"> <widget class="QListWidget" name="listWidgetClients">
@ -327,6 +348,12 @@ color: rgb(255, 255, 255);</string>
</sizepolicy> </sizepolicy>
</property> </property>
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
<property name="topMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>6</number>
</property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="labelCopyrightsInfoIcon"> <widget class="QLabel" name="labelCopyrightsInfoIcon">
<property name="text"> <property name="text">

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>862</width> <width>929</width>
<height>1357</height> <height>1529</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -62,6 +62,42 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item>
<widget class="QWidget" name="clockOnlyWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout_13">
<item>
<widget class="QLabel" name="bigClock2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>80</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>12:00:00</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item> <item>
<widget class="QWidget" name="headerWidget" native="true"> <widget class="QWidget" name="headerWidget" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
@ -100,8 +136,23 @@
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<property name="topMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QLabel" name="devlabel_right"> <widget class="QLabel" name="devlabel_right">
<property name="minimumSize">
<size>
<width>150</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>24</height>
</size>
</property>
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>
@ -111,7 +162,8 @@
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">background-color: rgb(164, 0, 0); <string notr="true">background-color: rgb(164, 0, 0);
color: rgb(255, 255, 255);</string> color: rgb(255, 255, 255);
border-radius: 4px;</string>
</property> </property>
<property name="text"> <property name="text">
<string>Dev Mode Enabled</string> <string>Dev Mode Enabled</string>
@ -122,27 +174,54 @@ color: rgb(255, 255, 255);</string>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_left"> <widget class="QPushButton" name="pushButtonUpdate">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>150</width>
<height>0</height> <height>24</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>100</width> <width>150</width>
<height>16777215</height> <height>24</height>
</size> </size>
</property> </property>
<property name="font"> <property name="font">
<font> <font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(115, 210, 22);
color: rgb(0, 0, 0);
outline: none;
border-radius: 4px;
</string>
</property>
<property name="text">
<string>Update available!</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_left">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>8</pointsize>
<weight>75</weight> <weight>75</weight>
<bold>true</bold> <bold>true</bold>
</font> </font>
@ -154,6 +233,9 @@ color: rgb(211, 215, 207);</string>
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
<property name="margin">
<number>4</number>
</property>
</widget> </widget>
</item> </item>
<item> <item>
@ -188,25 +270,14 @@ color: rgb(211, 215, 207);</string>
<item> <item>
<widget class="QLabel" name="label_right"> <widget class="QLabel" name="label_right">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
<property name="font"> <property name="font">
<font> <font>
<pointsize>8</pointsize>
<weight>75</weight> <weight>75</weight>
<bold>true</bold> <bold>true</bold>
</font> </font>
@ -221,10 +292,60 @@ color: rgb(211, 215, 207);</string>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
<property name="margin">
<number>4</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_dummy_right">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>24</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0, 0, 0, 0);
color: rgb(211, 215, 207);</string>
</property>
<property name="text">
<string/>
</property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="devlabel_left"> <widget class="QLabel" name="devlabel_left">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>150</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>24</height>
</size>
</property>
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>
@ -233,7 +354,8 @@ color: rgb(211, 215, 207);</string>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">background-color: rgb(164, 0, 0); <string notr="true">background-color: rgb(164, 0, 0);
color: rgb(255, 255, 255);</string> color: rgb(255, 255, 255);
border-radius: 4px;</string>
</property> </property>
<property name="text"> <property name="text">
<string>Dev Mode Enabled</string> <string>Dev Mode Enabled</string>
@ -331,13 +453,13 @@ color: rgb(255, 255, 255);</string>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>22</height> <height>24</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>16777215</width> <width>16777215</width>
<height>22</height> <height>24</height>
</size> </size>
</property> </property>
<property name="font"> <property name="font">
@ -370,13 +492,13 @@ color: rgb(78, 244, 37);</string>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>22</height> <height>24</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>16777215</width> <width>16777215</width>
<height>22</height> <height>24</height>
</size> </size>
</property> </property>
<property name="font"> <property name="font">
@ -454,6 +576,18 @@ color: rgb(78, 244, 37);</string>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize">
<size>
<width>0</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>24</height>
</size>
</property>
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>
@ -488,6 +622,63 @@ color: rgb(0, 102, 255);</string>
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QLabel" name="dcRecording">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>80</width>
<height>24</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(164, 0, 0);
color: rgb(239, 239, 239);
outline: none;
border-radius: 4px;
</string>
</property>
<property name="text">
<string>Recording</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<widget class="QPushButton" name="pushButtonBluetooth"> <widget class="QPushButton" name="pushButtonBluetooth">
<property name="sizePolicy"> <property name="sizePolicy">
@ -499,13 +690,13 @@ color: rgb(0, 102, 255);</string>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>80</width> <width>80</width>
<height>22</height> <height>24</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>80</width> <width>80</width>
<height>22</height> <height>24</height>
</size> </size>
</property> </property>
<property name="baseSize"> <property name="baseSize">
@ -517,7 +708,9 @@ color: rgb(0, 102, 255);</string>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">background-color: rgb(32, 74, 135); <string notr="true">background-color: rgb(32, 74, 135);
color: rgb(239, 239, 239); color: rgb(239, 239, 239);
outline: none;</string> outline: none;
border-radius: 4px;
</string>
</property> </property>
<property name="text"> <property name="text">
<string>BT-Pairing</string> <string>BT-Pairing</string>
@ -535,13 +728,13 @@ outline: none;</string>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>100</width>
<height>22</height> <height>24</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>100</width> <width>100</width>
<height>22</height> <height>24</height>
</size> </size>
</property> </property>
<property name="font"> <property name="font">
@ -568,6 +761,510 @@ color: rgb(255, 255, 255);</string>
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<widget class="QWidget" name="networkInfo" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>24</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0, 0, 0, 0);</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_15">
<property name="spacing">
<number>0</number>
</property>
<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>
<spacer name="horizontalSpacer_14">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QWidget" name="ssidInfo" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>24</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_16">
<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="QLabel" name="label_ssid">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>24</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0, 0, 0, 0);
color: rgb(196, 160, 0);</string>
</property>
<property name="text">
<string>SSID: </string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="value_ssid">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>130</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>130</width>
<height>24</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0, 0, 0, 0);
color: rgb(196, 160, 0);</string>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="ipInfo" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>24</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_17">
<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="QLabel" name="label_ip">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>24</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0, 0, 0, 0);
color: rgb(196, 160, 0);</string>
</property>
<property name="text">
<string>IP: </string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="value_ip">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>130</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>130</width>
<height>24</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0, 0, 0, 0);
color: rgb(196, 160, 0);</string>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="maskInfo" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>24</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_20">
<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="QLabel" name="label_mask">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>24</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0, 0, 0, 0);
color: rgb(196, 160, 0);</string>
</property>
<property name="text">
<string>Mask: </string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="value_mask">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>130</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>130</width>
<height>24</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0, 0, 0, 0);
color: rgb(196, 160, 0);</string>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="gwInfo" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>24</height>
</size>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_22">
<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="QLabel" name="label_gw">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>24</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0, 0, 0, 0);
color: rgb(196, 160, 0);</string>
</property>
<property name="text">
<string>GW: </string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="value_gw">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>130</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>130</width>
<height>24</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0, 0, 0, 0);
color: rgb(196, 160, 0);</string>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_15">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item> <item>
<widget class="Line" name="line"> <widget class="Line" name="line">
<property name="sizePolicy"> <property name="sizePolicy">
@ -793,25 +1490,6 @@ WiFi Clients</string>
</layout> </layout>
</widget> </widget>
</item> </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>Setup</string>
</property>
</widget>
</item>
<item> <item>
<widget class="QPushButton" name="pushButtonDay"> <widget class="QPushButton" name="pushButtonDay">
<property name="sizePolicy"> <property name="sizePolicy">
@ -2013,6 +2691,8 @@ outline: none;</string>
<property name="font"> <property name="font">
<font> <font>
<pointsize>80</pointsize> <pointsize>80</pointsize>
<weight>50</weight>
<bold>false</bold>
</font> </font>
</property> </property>
<property name="styleSheet"> <property name="styleSheet">

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,877 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>UpdateDialog</class>
<widget class="QDialog" name="UpdateDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>731</width>
<height>260</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>500</width>
<height>260</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>731</width>
<height>260</height>
</size>
</property>
<property name="windowTitle">
<string>Connect to device</string>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(46, 52, 54);
color: rgb(255, 255, 255);</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBoxRecent">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>100</height>
</size>
</property>
<property name="title">
<string>Crankshaft NG Update Menu</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<layout class="QFormLayout" name="formLayout_2">
<property name="horizontalSpacing">
<number>30</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item row="7" column="0" colspan="2">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>4</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1">
<widget class="QLabel" name="labelCsmt">
<property name="text">
<string>Update Crankshaft Management Tool</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QWidget" name="csmt" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<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="QLabel" name="labelCsmtOK">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(78, 154, 6);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);</string>
</property>
<property name="text">
<string>OK</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonUpdateCsmt">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(164, 0, 0);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Update CSMT</string>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="progressBarCsmt">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</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>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="labelUdev">
<property name="text">
<string>Update System UDEV Rules</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QWidget" name="udev" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<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="QLabel" name="labelUdevOK">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(78, 154, 6);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);</string>
</property>
<property name="text">
<string>OK</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonUpdateUdev">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(164, 0, 0);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Update UDEV</string>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="progressBarUdev">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</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>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="labelOpenauto">
<property name="text">
<string>Update OpenAuto Binaries</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QWidget" name="openauto" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="spacing">
<number>0</number>
</property>
<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="QLabel" name="labelOpenautoOK">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(78, 154, 6);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);</string>
</property>
<property name="text">
<string>OK</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonUpdateOpenauto">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(164, 0, 0);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Update OpenAuto</string>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="progressBarOpenauto">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</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>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<widget class="QWidget" name="system" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="spacing">
<number>0</number>
</property>
<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="QLabel" name="labelSystemOK">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(78, 154, 6);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);</string>
</property>
<property name="text">
<string>OK</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelSystemReadyInstall">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(206, 92, 0);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);</string>
</property>
<property name="text">
<string>Reboot To Install</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonUpdateSystem">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(164, 0, 0);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Update System</string>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="progressBarSystem">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</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>420</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="labelSystem">
<property name="text">
<string>Update System (Download Flash zip)
This can take some minutes!</string>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QLabel" name="labelDownload">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="verticalWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<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="pushButtonUpdateCheck">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</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>Rescan Updates</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelUpdateChecking">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</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>Scanning...</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonClose">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</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>
<resources/>
<connections/>
</ui>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>Warning</class> <class>WarningDialog</class>
<widget class="QDialog" name="Warning"> <widget class="QDialog" name="WarningDialog">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>

View File

@ -1,164 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>WifiDialog</class>
<widget class="QDialog" name="WifiDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>540</width>
<height>376</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(85, 87, 83);</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QWidget" name="centralWidget" native="true">
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>9</x>
<y>9</y>
<width>411</width>
<height>16</height>
</rect>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>WiFi Networks Avaliable:</string>
</property>
</widget>
<widget class="QPushButton" name="btnConnect">
<property name="geometry">
<rect>
<x>440</x>
<y>141</y>
<width>80</width>
<height>23</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(211, 215, 207);
background-color: rgb(186, 189, 182);</string>
</property>
<property name="text">
<string>Connect</string>
</property>
</widget>
<widget class="QTreeWidget" name="treeWidgetWiFis">
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>411</width>
<height>241</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(186, 189, 182);</string>
</property>
<column>
<property name="text">
<string>Num</string>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
<stylestrategy>PreferDefault</stylestrategy>
</font>
</property>
<property name="textAlignment">
<set>AlignCenter</set>
</property>
</column>
<column>
<property name="text">
<string>SSID</string>
</property>
<property name="textAlignment">
<set>AlignCenter</set>
</property>
</column>
<column>
<property name="text">
<string>Secturity</string>
</property>
<property name="textAlignment">
<set>AlignCenter</set>
</property>
</column>
</widget>
<widget class="QPushButton" name="pushButtonClose">
<property name="geometry">
<rect>
<x>440</x>
<y>170</y>
<width>80</width>
<height>23</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(186, 189, 182);</string>
</property>
<property name="text">
<string>Close</string>
</property>
</widget>
</widget>
</item>
<item row="0" column="0">
<widget class="QStatusBar" name="statusBar">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>540</width>
<height>20</height>
</rect>
</property>
</widget>
<widget class="QToolBar" name="mainToolBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>540</width>
<height>20</height>
</rect>
</property>
</widget>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
</ui>

View File

@ -34,8 +34,8 @@
#include <f1x/openauto/autoapp/UI/MainWindow.hpp> #include <f1x/openauto/autoapp/UI/MainWindow.hpp>
#include <f1x/openauto/autoapp/UI/SettingsWindow.hpp> #include <f1x/openauto/autoapp/UI/SettingsWindow.hpp>
#include <f1x/openauto/autoapp/UI/ConnectDialog.hpp> #include <f1x/openauto/autoapp/UI/ConnectDialog.hpp>
#include <f1x/openauto/autoapp/UI/WifiDialog.hpp> #include <f1x/openauto/autoapp/UI/WarningDialog.hpp>
#include <f1x/openauto/autoapp/UI/Warning.hpp> #include <f1x/openauto/autoapp/UI/UpdateDialog.hpp>
#include <f1x/openauto/Common/Log.hpp> #include <f1x/openauto/Common/Log.hpp>
namespace aasdk = f1x::aasdk; namespace aasdk = f1x::aasdk;
@ -88,8 +88,8 @@ int main(int argc, char* argv[])
QApplication qApplication(argc, argv); QApplication qApplication(argc, argv);
const int width = QApplication::desktop()->width(); const int width = QApplication::desktop()->width();
OPENAUTO_LOG(info) << "[OpenAuto] Display width: " << width;
const int height = QApplication::desktop()->height(); const int height = QApplication::desktop()->height();
OPENAUTO_LOG(info) << "[OpenAuto] Display width: " << width;
OPENAUTO_LOG(info) << "[OpenAuto] Display height: " << height; OPENAUTO_LOG(info) << "[OpenAuto] Display height: " << height;
auto configuration = std::make_shared<autoapp::configuration::Configuration>(); auto configuration = std::make_shared<autoapp::configuration::Configuration>();
@ -106,29 +106,28 @@ int main(int argc, char* argv[])
autoapp::configuration::RecentAddressesList recentAddressesList(7); autoapp::configuration::RecentAddressesList recentAddressesList(7);
recentAddressesList.read(); recentAddressesList.read();
autoapp::ui::WifiDialog wifiDialog;
wifiDialog.setWindowFlags(Qt::WindowStaysOnTopHint);
// center dialog
wifiDialog.move((width - 540)/2,(height-340)/2);
aasdk::tcp::TCPWrapper tcpWrapper; aasdk::tcp::TCPWrapper tcpWrapper;
autoapp::ui::ConnectDialog connectDialog(ioService, tcpWrapper, recentAddressesList); autoapp::ui::ConnectDialog connectdialog(ioService, tcpWrapper, recentAddressesList);
connectDialog.setWindowFlags(Qt::WindowStaysOnTopHint); connectdialog.setWindowFlags(Qt::WindowStaysOnTopHint);
// center dialog connectdialog.move((width - 500)/2,(height-300)/2);
connectDialog.move((width - 500)/2,(height-360)/2);
autoapp::ui::Warning warning; autoapp::ui::WarningDialog warningdialog;
warning.setWindowFlags(Qt::WindowStaysOnTopHint); warningdialog.setWindowFlags(Qt::WindowStaysOnTopHint);
// center dialog warningdialog.move((width - 500)/2,(height-300)/2);
warning.move((width - 500)/2,(height-300)/2);
autoapp::ui::UpdateDialog updatedialog;
updatedialog.setWindowFlags(Qt::WindowStaysOnTopHint);
updatedialog.setFixedSize(500, 260);
updatedialog.move((width - 500)/2,(height-260)/2);
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::exit, []() { system("touch /tmp/shutdown"); std::exit(0); }); 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); }); QObject::connect(&mainWindow, &autoapp::ui::MainWindow::reboot, []() { system("touch /tmp/reboot"); std::exit(0); });
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::openSettings, &settingsWindow, &autoapp::ui::SettingsWindow::loadSystemValues); QObject::connect(&mainWindow, &autoapp::ui::MainWindow::openSettings, &settingsWindow, &autoapp::ui::SettingsWindow::loadSystemValues);
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::openSettings, &settingsWindow, &autoapp::ui::SettingsWindow::showFullScreen); QObject::connect(&mainWindow, &autoapp::ui::MainWindow::openSettings, &settingsWindow, &autoapp::ui::SettingsWindow::showFullScreen);
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::openConnectDialog, &connectDialog, &autoapp::ui::ConnectDialog::loadClientList); QObject::connect(&mainWindow, &autoapp::ui::MainWindow::openConnectDialog, &connectdialog, &autoapp::ui::ConnectDialog::loadClientList);
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::openConnectDialog, &connectDialog, &autoapp::ui::ConnectDialog::exec); QObject::connect(&mainWindow, &autoapp::ui::MainWindow::openConnectDialog, &connectdialog, &autoapp::ui::ConnectDialog::exec);
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::openWifiDialog, &wifiDialog, &autoapp::ui::WifiDialog::exec); QObject::connect(&mainWindow, &autoapp::ui::MainWindow::openUpdateDialog, &updatedialog, &autoapp::ui::UpdateDialog::updateCheck);
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::openUpdateDialog, &updatedialog, &autoapp::ui::UpdateDialog::exec);
if (configuration->showCursor() == false) { if (configuration->showCursor() == false) {
qApplication.setOverrideCursor(Qt::BlankCursor); qApplication.setOverrideCursor(Qt::BlankCursor);
@ -232,38 +231,41 @@ int main(int argc, char* argv[])
auto connectedAccessoriesEnumerator(std::make_shared<aasdk::usb::ConnectedAccessoriesEnumerator>(usbWrapper, ioService, queryChainFactory)); auto connectedAccessoriesEnumerator(std::make_shared<aasdk::usb::ConnectedAccessoriesEnumerator>(usbWrapper, ioService, queryChainFactory));
auto app = std::make_shared<autoapp::App>(ioService, usbWrapper, tcpWrapper, androidAutoEntityFactory, std::move(usbHub), std::move(connectedAccessoriesEnumerator)); auto app = std::make_shared<autoapp::App>(ioService, usbWrapper, tcpWrapper, androidAutoEntityFactory, std::move(usbHub), std::move(connectedAccessoriesEnumerator));
QObject::connect(&connectDialog, &autoapp::ui::ConnectDialog::connectionSucceed, [&app](auto socket) { QObject::connect(&connectdialog, &autoapp::ui::ConnectDialog::connectionSucceed, [&app](auto socket) {
app->start(std::move(socket)); app->start(std::move(socket));
}); });
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::TriggerAppStart, [&app]() { QObject::connect(&mainWindow, &autoapp::ui::MainWindow::TriggerAppStart, [&app]() {
OPENAUTO_LOG(info) << "[CS] Manual start android auto entity by reset usb."; OPENAUTO_LOG(info) << "[Autoapp] Manual start android auto entity by reset usb.";
try { try {
if (std::ifstream("/tmp/android_device")) { if (std::ifstream("/tmp/android_device")) {
system("/usr/local/bin/autoapp_helper usbreset"); //system("/usr/local/bin/autoapp_helper usbreset");
app->disableAutostartEntity = false;
app->waitForUSBDevice(); app->waitForUSBDevice();
} }
} catch (...) { } catch (...) {
OPENAUTO_LOG(info) << "[CS] Exception in Manual start android auto entity by reset usb."; OPENAUTO_LOG(info) << "[Autoapp] Exception in Manual start android auto entity by reset usb.";
} }
}); });
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::TriggerAppStop, [&app]() { QObject::connect(&mainWindow, &autoapp::ui::MainWindow::TriggerAppStop, [&app]() {
OPENAUTO_LOG(info) << "[CS] Manual stop android auto entity."; OPENAUTO_LOG(info) << "[Autoapp] Manual stop android auto entity.";
try { try {
if (std::ifstream("/tmp/android_device")) { if (std::ifstream("/tmp/android_device")) {
app->disableAutostartEntity = true;
system("/usr/local/bin/autoapp_helper usbreset"); system("/usr/local/bin/autoapp_helper usbreset");
usleep(500000); usleep(500000);
app->stop(); app->stop();
} else { } else {
app->onAndroidAutoQuit(); app->stop();
//app->onAndroidAutoQuit();
} }
} catch (...) { } catch (...) {
OPENAUTO_LOG(info) << "[CS] Exception in Manual stop android auto entity."; OPENAUTO_LOG(info) << "[Autoapp] Exception in Manual stop android auto entity.";
} }
}); });
warning.show(); warningdialog.show();
app->waitForUSBDevice(); app->waitForUSBDevice();