latest dev

This commit is contained in:
hawkeyexp 2018-09-13 14:57:07 +02:00
parent 0703904ca1
commit 3a7e7593ff
10 changed files with 513 additions and 296 deletions

View File

@ -37,10 +37,12 @@ private slots:
void onConnectionFailed(const QString& message); void onConnectionFailed(const QString& message);
void onConnectionSucceed(aasdk::tcp::ITCPEndpoint::SocketPointer socket, const std::string& ipAddress); void onConnectionSucceed(aasdk::tcp::ITCPEndpoint::SocketPointer socket, const std::string& ipAddress);
void onRecentAddressClicked(const QModelIndex& index); void onRecentAddressClicked(const QModelIndex& index);
void onUpdateButtonClicked();
private: private:
void insertIpAddress(const std::string& ipAddress); void insertIpAddress(const std::string& ipAddress);
void loadRecentList(); void loadRecentList();
void loadTempRecentList();
void setControlsEnabledStatus(bool status); void setControlsEnabledStatus(bool status);
void connectHandler(const boost::system::error_code& ec, const std::string& ipAddress, aasdk::tcp::ITCPEndpoint::SocketPointer socket); void connectHandler(const boost::system::error_code& ec, const std::string& ipAddress, aasdk::tcp::ITCPEndpoint::SocketPointer socket);

View File

@ -174,8 +174,7 @@ private:
bool c7ButtonForce = false; bool c7ButtonForce = false;
bool c8ButtonForce = false; bool c8ButtonForce = false;
//int screen_width = 800; bool hotspotActive = false;
//int screen_height = 480;
}; };
} }

View File

@ -56,6 +56,8 @@ private slots:
void onUpdateSystemVolume(int value); void onUpdateSystemVolume(int value);
void onUpdateSystemCapture(int value); void onUpdateSystemCapture(int value);
void setTime(); void setTime();
void onStartHotspot();
void onStopHotspot();
private slots: private slots:
void show_tab1(); void show_tab1();

View File

@ -1,6 +1,8 @@
#include <QMessageBox> #include <QMessageBox>
#include <f1x/openauto/autoapp/UI/ConnectDialog.hpp> #include <f1x/openauto/autoapp/UI/ConnectDialog.hpp>
#include "ui_connectdialog.h" #include "ui_connectdialog.h"
#include <QFileInfo>
#include <QTextStream>
namespace f1x namespace f1x
{ {
@ -27,9 +29,14 @@ ConnectDialog::ConnectDialog(boost::asio::io_service& ioService, aasdk::tcp::ITC
connect(ui_->listViewRecent, &QListView::clicked, this, &ConnectDialog::onRecentAddressClicked); connect(ui_->listViewRecent, &QListView::clicked, this, &ConnectDialog::onRecentAddressClicked);
connect(this, &ConnectDialog::connectionSucceed, this, &ConnectDialog::onConnectionSucceed); connect(this, &ConnectDialog::connectionSucceed, this, &ConnectDialog::onConnectionSucceed);
connect(this, &ConnectDialog::connectionFailed, this, &ConnectDialog::onConnectionFailed); connect(this, &ConnectDialog::connectionFailed, this, &ConnectDialog::onConnectionFailed);
connect(ui_->pushButtonUpdate, &QPushButton::clicked, this, &ConnectDialog::onUpdateButtonClicked);
ui_->listViewRecent->setModel(&recentAddressesModel_); ui_->listViewRecent->setModel(&recentAddressesModel_);
this->loadRecentList(); this->loadRecentList();
loadTempRecentList();
ui_->progressBarConnect->hide();
ui_->lineEditIPAddress->setFocus();
} }
ConnectDialog::~ConnectDialog() ConnectDialog::~ConnectDialog()
@ -43,7 +50,7 @@ void ConnectDialog::onConnectButtonClicked()
const auto& ipAddress = ui_->lineEditIPAddress->text().toStdString(); const auto& ipAddress = ui_->lineEditIPAddress->text().toStdString();
auto socket = std::make_shared<boost::asio::ip::tcp::socket>(ioService_); auto socket = std::make_shared<boost::asio::ip::tcp::socket>(ioService_);
ui_->progressBarConnect->show();
try try
{ {
tcpWrapper_.asyncConnect(*socket, ipAddress, 5277, std::bind(&ConnectDialog::connectHandler, this, std::placeholders::_1, ipAddress, socket)); tcpWrapper_.asyncConnect(*socket, ipAddress, 5277, std::bind(&ConnectDialog::connectHandler, this, std::placeholders::_1, ipAddress, socket));
@ -52,6 +59,13 @@ void ConnectDialog::onConnectButtonClicked()
{ {
emit connectionFailed(QString(se.what())); emit connectionFailed(QString(se.what()));
} }
loadTempRecentList();
}
void ConnectDialog::onUpdateButtonClicked()
{
system("/usr/local/bin/autoapp_helper updaterecent");
loadTempRecentList();
} }
void ConnectDialog::connectHandler(const boost::system::error_code& ec, const std::string& ipAddress, aasdk::tcp::ITCPEndpoint::SocketPointer socket) void ConnectDialog::connectHandler(const boost::system::error_code& ec, const std::string& ipAddress, aasdk::tcp::ITCPEndpoint::SocketPointer socket)
@ -69,6 +83,7 @@ void ConnectDialog::connectHandler(const boost::system::error_code& ec, const st
void ConnectDialog::onConnectionSucceed(aasdk::tcp::ITCPEndpoint::SocketPointer, const std::string& ipAddress) void ConnectDialog::onConnectionSucceed(aasdk::tcp::ITCPEndpoint::SocketPointer, const std::string& ipAddress)
{ {
ui_->progressBarConnect->hide();
this->insertIpAddress(ipAddress); this->insertIpAddress(ipAddress);
this->setControlsEnabledStatus(true); this->setControlsEnabledStatus(true);
} }
@ -77,6 +92,7 @@ void ConnectDialog::onConnectionFailed(const QString& message)
{ {
this->setControlsEnabledStatus(true); this->setControlsEnabledStatus(true);
ui_->progressBarConnect->hide();
QMessageBox errorMessage(QMessageBox::Critical, "Connect error", message, QMessageBox::Ok); QMessageBox errorMessage(QMessageBox::Critical, "Connect error", message, QMessageBox::Ok);
errorMessage.setWindowFlags(Qt::WindowStaysOnTopHint); errorMessage.setWindowFlags(Qt::WindowStaysOnTopHint);
errorMessage.exec(); errorMessage.exec();
@ -113,6 +129,22 @@ void ConnectDialog::loadRecentList()
recentAddressesModel_.setStringList(stringList); recentAddressesModel_.setStringList(stringList);
} }
void ConnectDialog::loadTempRecentList()
{
QFileInfo recentFile("/tmp/temp_recent_list");
if (recentFile.exists()) {
QFile versionFile(QString("/tmp/temp_recent_list"));
versionFile.open(QIODevice::ReadOnly);
QTextStream data(&versionFile);
while (!data.atEnd())
{
QString ip = data.readLine();
ConnectDialog::insertIpAddress(ip.toStdString());
}
versionFile.close();
}
}
void ConnectDialog::insertIpAddress(const std::string& ipAddress) void ConnectDialog::insertIpAddress(const std::string& ipAddress)
{ {
recentAddressesList_.insertAddress(ipAddress); recentAddressesList_.insertAddress(ipAddress);

View File

@ -167,6 +167,9 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
connect(ui_->pushButtonWifi, &QPushButton::clicked, this, &MainWindow::openConnectDialog); connect(ui_->pushButtonWifi, &QPushButton::clicked, this, &MainWindow::openConnectDialog);
connect(ui_->pushButtonWifi2, &QPushButton::clicked, this, &MainWindow::openConnectDialog); connect(ui_->pushButtonWifi2, &QPushButton::clicked, this, &MainWindow::openConnectDialog);
// by default hide bluetooth button on init
ui_->pushButtonBluetooth->hide();
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(); timer->start();
@ -213,24 +216,15 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
connect(ui_->pushButtonRecord, &QPushButton::clicked, this, &MainWindow::cameraRecord); connect(ui_->pushButtonRecord, &QPushButton::clicked, this, &MainWindow::cameraRecord);
connect(ui_->pushButtonSave, &QPushButton::clicked, this, &MainWindow::cameraSave); connect(ui_->pushButtonSave, &QPushButton::clicked, this, &MainWindow::cameraSave);
ui_->pushButtonDummyCamWifi->hide(); ui_->pushButtonDummyCamWifi->hide();
ui_->pushButtonDummyCamWifi2->hide();
} else { } else {
ui_->pushButtonCameraShow->hide(); ui_->pushButtonCameraShow->hide();
ui_->pushButtonCameraShow2->hide(); ui_->pushButtonCameraShow2->hide();
if (this->wifiButtonForce) {
ui_->pushButtonDummyCamWifi2->hide();
}
} }
// show debug button if enabled // show debug button if enabled
if (!this->systemDebugmode) { if (!this->systemDebugmode) {
ui_->pushButtonDebug->hide(); ui_->pushButtonDebug->hide();
ui_->pushButtonDebug2->hide(); ui_->pushButtonDebug2->hide();
if (this->cameraButtonForce && this->wifiButtonForce) {
ui_->pushButtonDummyDebug->hide();
}
} else {
ui_->pushButtonDummyDebug->hide();
} }
ui_->systemConfigInProgress->hide(); ui_->systemConfigInProgress->hide();
@ -569,9 +563,6 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
// init alpha values // init alpha values
ui_->horizontalSliderAlpha->setValue(int(configuration->getAlphaTrans())); ui_->horizontalSliderAlpha->setValue(int(configuration->getAlphaTrans()));
MainWindow::on_horizontalSliderAlpha_valueChanged(int(configuration->getAlphaTrans())); MainWindow::on_horizontalSliderAlpha_valueChanged(int(configuration->getAlphaTrans()));
// bt media controls
ui_->btControlWidget->hide();
} }
MainWindow::~MainWindow() MainWindow::~MainWindow()
@ -1058,7 +1049,6 @@ void f1x::openauto::autoapp::ui::MainWindow::showTime()
ui_->pushButtonDebug2->hide(); ui_->pushButtonDebug2->hide();
ui_->pushButtonLock->show(); ui_->pushButtonLock->show();
ui_->pushButtonLock2->show(); ui_->pushButtonLock2->show();
ui_->pushButtonDummyDebug->show();
ui_->systemConfigInProgress->show(); ui_->systemConfigInProgress->show();
} }
if (enablePairingFile.exists()) { if (enablePairingFile.exists()) {
@ -1078,7 +1068,6 @@ void f1x::openauto::autoapp::ui::MainWindow::showTime()
if (this->systemDebugmode) { if (this->systemDebugmode) {
ui_->pushButtonDebug->show(); ui_->pushButtonDebug->show();
ui_->pushButtonDebug2->show(); ui_->pushButtonDebug2->show();
ui_->pushButtonDummyDebug->hide();
} }
} }
} }
@ -1143,6 +1132,61 @@ void f1x::openauto::autoapp::ui::MainWindow::showTime()
if (externalExitFile.exists()) { if (externalExitFile.exists()) {
f1x::openauto::autoapp::ui::MainWindow::MainWindow::exit(); f1x::openauto::autoapp::ui::MainWindow::MainWindow::exit();
} }
QFileInfo hotspotFile("/tmp/hotspot_active");
this->hotspotActive = hotspotFile.exists();
// hide wifi if not forced
if (!this->hotspotActive) {
if ((ui_->pushButtonWifi->isVisible() == true) || (ui_->pushButtonWifi2->isVisible() == true)){
ui_->pushButtonWifi->hide();
ui_->pushButtonWifi2->hide();
if (!this->cameraButtonForce) {
ui_->pushButtonDummyCamWifi->show();
}
}
} else {
if ((ui_->pushButtonWifi->isVisible() == false) || (ui_->pushButtonWifi2->isVisible() == false)) {
ui_->pushButtonWifi->show();
ui_->pushButtonWifi2->show();
ui_->pushButtonDummyCamWifi->hide();
}
}
// handle dummys in classic menu
int button_count = 0;
if (ui_->pushButtonCameraShow2->isVisible() == true) {
button_count = button_count + 1;
}
if (ui_->pushButtonToggleGUI2->isVisible() == true) {
button_count = button_count + 1;
}
if (ui_->pushButtonWifi2->isVisible() == true) {
button_count = button_count + 1;
}
if (ui_->pushButtonDebug2->isVisible() == true) {
button_count = button_count + 1;
}
if (button_count >= 3) {
ui_->pushButtonDummyClassic1->hide();
ui_->pushButtonDummyClassic2->hide();
ui_->pushButtonDummyClassic3->hide();
}
if (button_count == 2) {
ui_->pushButtonDummyClassic1->show();
ui_->pushButtonDummyClassic2->hide();
ui_->pushButtonDummyClassic3->hide();
}
if (button_count == 1) {
ui_->pushButtonDummyClassic1->show();
ui_->pushButtonDummyClassic2->show();
ui_->pushButtonDummyClassic3->hide();
}
if (button_count == 0) {
ui_->pushButtonDummyClassic1->show();
ui_->pushButtonDummyClassic2->show();
ui_->pushButtonDummyClassic3->show();
}
} }
ui_->Digital_clock->setText(time_text); ui_->Digital_clock->setText(time_text);
ui_->bigClock->setText(time_text); ui_->bigClock->setText(time_text);

View File

@ -55,6 +55,10 @@ 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_->pushButtonHotspotStart , &QPushButton::clicked, this, &SettingsWindow::close);
connect(ui_->pushButtonHotspotStop, &QPushButton::clicked, this, &SettingsWindow::onStopHotspot);
connect(ui_->pushButtonHotspotStop , &QPushButton::clicked, this, &SettingsWindow::close);
connect(ui_->pushButtonSetTime, &QPushButton::clicked, this, &SettingsWindow::setTime); connect(ui_->pushButtonSetTime, &QPushButton::clicked, this, &SettingsWindow::setTime);
// menu // menu
ui_->tab1->show(); ui_->tab1->show();
@ -697,6 +701,16 @@ void SettingsWindow::onShowBindings()
confirmationMessage.exec(); confirmationMessage.exec();
} }
void SettingsWindow::onStartHotspot()
{
system("sudo systemctl start hotspot &");
}
void SettingsWindow::onStopHotspot()
{
system("sudo systemctl stop hotspot &");
}
void SettingsWindow::show_tab1() void SettingsWindow::show_tab1()
{ {
ui_->tab2->hide(); ui_->tab2->hide();

View File

@ -6,154 +6,302 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>301</width> <width>500</width>
<height>389</height> <height>431</height>
</rect> </rect>
</property> </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>360</height>
</size>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Connect to device</string> <string>Connect to device</string>
</property> </property>
<widget class="QGroupBox" name="groupBoxIPAddress"> <property name="styleSheet">
<property name="geometry"> <string notr="true">background-color: rgb(46, 52, 54);
<rect> color: rgb(255, 255, 255);</string>
<x>10</x> </property>
<y>10</y> <layout class="QVBoxLayout" name="verticalLayout">
<width>281</width> <item>
<height>61</height> <widget class="QGroupBox" name="groupBoxIPAddress">
</rect> <property name="sizePolicy">
</property> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<property name="title"> <horstretch>0</horstretch>
<string>IP Address</string> <verstretch>0</verstretch>
</property> </sizepolicy>
<widget class="QLineEdit" name="lineEditIPAddress"> </property>
<property name="geometry"> <property name="title">
<rect> <string>IP Address</string>
<x>10</x> </property>
<y>30</y> <layout class="QVBoxLayout" name="verticalLayout_2">
<width>261</width> <item>
<height>25</height> <widget class="QLineEdit" name="lineEditIPAddress">
</rect> <property name="font">
</property> <font>
</widget> <weight>75</weight>
</widget> <bold>true</bold>
<widget class="QGroupBox" name="groupBoxRecent"> </font>
<property name="geometry"> </property>
<rect> <property name="styleSheet">
<x>10</x> <string notr="true">background-color: rgb(85, 87, 83);
<y>80</y> color: rgb(255, 255, 255);</string>
<width>281</width> </property>
<height>181</height> <property name="alignment">
</rect> <set>Qt::AlignCenter</set>
</property> </property>
<property name="title"> <property name="dragEnabled">
<string>Recent</string> <bool>false</bool>
</property> </property>
<widget class="QListView" name="listViewRecent"> </widget>
<property name="geometry"> </item>
<rect> </layout>
<x>10</x> </widget>
<y>30</y> </item>
<width>261</width> <item>
<height>141</height> <widget class="QGroupBox" name="groupBoxRecent">
</rect> <property name="sizePolicy">
</property> <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<property name="editTriggers"> <horstretch>0</horstretch>
<set>QAbstractItemView::NoEditTriggers</set> <verstretch>0</verstretch>
</property> </sizepolicy>
</widget> </property>
</widget> <property name="minimumSize">
<widget class="QLabel" name="labelHeadUnitServerInfo"> <size>
<property name="geometry"> <width>0</width>
<rect> <height>100</height>
<x>60</x> </size>
<y>260</y> </property>
<width>221</width> <property name="title">
<height>81</height> <string>Recent</string>
</rect> </property>
</property> <layout class="QVBoxLayout" name="verticalLayout_3">
<property name="text"> <property name="topMargin">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-style:italic;&quot;&gt;In order to use wireless mode you must enable head unit server in developer settings.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <number>9</number>
</property> </property>
<property name="wordWrap"> <item>
<bool>true</bool> <widget class="QListView" name="listViewRecent">
</property> <property name="sizePolicy">
</widget> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<widget class="QLabel" name="labelCopyrightsInfoIcon"> <horstretch>0</horstretch>
<property name="geometry"> <verstretch>0</verstretch>
<rect> </sizepolicy>
<x>20</x> </property>
<y>290</y> <property name="minimumSize">
<width>21</width> <size>
<height>21</height> <width>0</width>
</rect> <height>100</height>
</property> </size>
<property name="text"> </property>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/ico_info.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <property name="font">
</property> <font>
</widget> <weight>75</weight>
<widget class="QPushButton" name="pushButtonCancel"> <bold>true</bold>
<property name="geometry"> </font>
<rect> </property>
<x>40</x> <property name="styleSheet">
<y>340</y> <string notr="true">background-color: rgb(85, 87, 83);
<width>121</width> color: rgb(255, 255, 255);</string>
<height>41</height> </property>
</rect> <property name="editTriggers">
</property> <set>QAbstractItemView::NoEditTriggers</set>
<property name="text"> </property>
<string>Cancel</string> <property name="batchSize">
</property> <number>100</number>
</widget> </property>
<widget class="QPushButton" name="pushButtonConnect"> </widget>
<property name="geometry"> </item>
<rect> </layout>
<x>170</x> </widget>
<y>340</y> </item>
<width>121</width> <item>
<height>41</height> <widget class="QWidget" name="formWidget" native="true">
</rect> <property name="sizePolicy">
</property> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<property name="text"> <horstretch>0</horstretch>
<string>Connect</string> <verstretch>0</verstretch>
</property> </sizepolicy>
</widget> </property>
<widget class="QProgressBar" name="progressBarConnect"> <layout class="QFormLayout" name="formLayout">
<property name="geometry"> <item row="0" column="0">
<rect> <widget class="QLabel" name="labelCopyrightsInfoIcon">
<x>170</x> <property name="text">
<y>340</y> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/ico_info.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<width>121</width> </property>
<height>41</height> </widget>
</rect> </item>
</property> <item row="0" column="1">
<property name="maximum"> <widget class="QLabel" name="labelHeadUnitServerInfo">
<number>0</number> <property name="sizePolicy">
</property> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<property name="value"> <horstretch>0</horstretch>
<number>0</number> <verstretch>0</verstretch>
</property> </sizepolicy>
</widget> </property>
<widget class="QLabel" name="labelConnecting"> <property name="text">
<property name="geometry"> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-style:italic;&quot;&gt;In order to use wireless mode you must enable head unit server in developer settings.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<rect> </property>
<x>188</x> <property name="wordWrap">
<y>350</y> <bool>true</bool>
<width>91</width> </property>
<height>20</height> </widget>
</rect> </item>
</property> </layout>
<property name="text"> </widget>
<string>Connecting...</string> </item>
</property> <item>
</widget> <widget class="QWidget" name="horizontalWidget" native="true">
<zorder>groupBoxIPAddress</zorder> <property name="sizePolicy">
<zorder>groupBoxRecent</zorder> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<zorder>labelHeadUnitServerInfo</zorder> <horstretch>0</horstretch>
<zorder>labelCopyrightsInfoIcon</zorder> <verstretch>0</verstretch>
<zorder>pushButtonCancel</zorder> </sizepolicy>
<zorder>progressBarConnect</zorder> </property>
<zorder>labelConnecting</zorder> <layout class="QHBoxLayout" name="horizontalLayout">
<zorder>pushButtonConnect</zorder> <item>
<widget class="QPushButton" name="pushButtonUpdate">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(186, 189, 182, 0.5);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Update</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonCancel">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(186, 189, 182, 0.5);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonConnect">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
<stylestrategy>PreferDefault</stylestrategy>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(186, 189, 182, 0.5);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Connect</string>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="progressBarConnect">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>30</height>
</size>
</property>
<property name="font">
<font>
<kerning>true</kerning>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(186, 189, 182, 0.5);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
color: rgb(255, 255, 255);</string>
</property>
<property name="maximum">
<number>0</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="textVisible">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget> </widget>
<resources/> <resources/>
<connections/> <connections/>

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>823</width> <width>800</width>
<height>840</height> <height>865</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -1133,133 +1133,6 @@ color: rgb(255, 255, 255);</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QWidget" name="btControlWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QGridLayout" name="gridLayout">
<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>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QPushButton" name="pushButtonBTPlay">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(114, 159, 207, 0.01);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Play</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="pushButtonBTPause">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(114, 159, 207, 0.01);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Pause</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="pushButtonBTPrev">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(114, 159, 207, 0.01);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Prev</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="pushButtonBTNext">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(114, 159, 207, 0.01);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
color: rgb(255, 255, 255);</string>
</property>
<property name="text">
<string>Next</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout> </layout>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
@ -1837,7 +1710,7 @@ border: 2px solid rgba(255,255,255,0.5);</string>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButtonDummyCamWifi2"> <widget class="QPushButton" name="pushButtonDummyClassic1">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding"> <sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -1865,7 +1738,7 @@ border: 2px solid rgba(255,255,255,0.5);</string>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButtonDummyDebug"> <widget class="QPushButton" name="pushButtonDummyClassic2">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding"> <sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -1892,6 +1765,28 @@ border: 2px solid rgba(255,255,255,0.5);</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QPushButton" name="pushButtonDummyClassic3">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>62</width>
<height>0</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(136, 138, 133, 0.5);</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>800</width> <width>800</width>
<height>2925</height> <height>2976</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -1896,7 +1896,7 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
<string notr="true">background-color: rgb(164, 0, 0);</string> <string notr="true">background-color: rgb(164, 0, 0);</string>
</property> </property>
<property name="text"> <property name="text">
<string>Remove all paired devices</string> <string>Remove all paired devices now!</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -2115,7 +2115,7 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QCheckBox" name="checkBoxHotspot"> <widget class="QCheckBox" name="checkBoxHotspot">
<property name="text"> <property name="text">
<string>Enable</string> <string>Enabled</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -2128,6 +2128,9 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
</sizepolicy> </sizepolicy>
</property> </property>
<layout class="QFormLayout" name="formLayout_5"> <layout class="QFormLayout" name="formLayout_5">
<property name="topMargin">
<number>2</number>
</property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_16"> <widget class="QLabel" name="label_16">
<property name="text"> <property name="text">
@ -2144,13 +2147,71 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>The Hotspot is only available in dev mode and overrides client mode! SSID is fixed.</string> <string>If enabled Hotspot will start on boot and Start/Stop buttons will work.</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="3" column="0">
<widget class="QPushButton" name="pushButtonHotspotStart">
<property name="minimumSize">
<size>
<width>100</width>
<height>20</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(78, 154, 6);</string>
</property>
<property name="text">
<string>Start</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QPushButton" name="pushButtonHotspotStop">
<property name="minimumSize">
<size>
<width>100</width>
<height>20</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(164, 0, 0);</string>
</property>
<property name="text">
<string>Stop</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="labelHotspotStart">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Start hotspot mode now. This will exit client mode.</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="labelHotspotStop">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Stop hotspot mode now. This will exit hotspot and reenable wifi client mode.</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@ -2926,6 +2987,12 @@ subcontrol-position: center left;
</item> </item>
<item> <item>
<widget class="QCheckBox" name="checkBoxDisableShutdown"> <widget class="QCheckBox" name="checkBoxDisableShutdown">
<property name="minimumSize">
<size>
<width>0</width>
<height>32</height>
</size>
</property>
<property name="text"> <property name="text">
<string>Disable</string> <string>Disable</string>
</property> </property>
@ -3053,6 +3120,12 @@ subcontrol-position: center left;
</item> </item>
<item> <item>
<widget class="QCheckBox" name="checkBoxDisableScreenOff"> <widget class="QCheckBox" name="checkBoxDisableScreenOff">
<property name="minimumSize">
<size>
<width>0</width>
<height>32</height>
</size>
</property>
<property name="text"> <property name="text">
<string>Disable</string> <string>Disable</string>
</property> </property>
@ -4659,9 +4732,15 @@ subcontrol-origin: margin;
subcontrol-position: center left; subcontrol-position: center left;
}</string> }</string>
</property> </property>
<property name="showGroupSeparator" stdset="0">
<bool>false</bool>
</property>
<property name="maximum"> <property name="maximum">
<number>23</number> <number>23</number>
</property> </property>
<property name="displayIntegerBase">
<number>10</number>
</property>
</widget> </widget>
</item> </item>
<item> <item>

View File

@ -106,6 +106,8 @@ int main(int argc, char* argv[])
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-440)/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); });
@ -203,7 +205,7 @@ int main(int argc, char* argv[])
mainWindow.showFullScreen(); mainWindow.showFullScreen();
mainWindow.setFixedSize(width, height); mainWindow.setFixedSize(width, height);
//mainWindow.adjustSize(); mainWindow.adjustSize();
aasdk::usb::USBWrapper usbWrapper(usbContext); aasdk::usb::USBWrapper usbWrapper(usbContext);
aasdk::usb::AccessoryModeQueryFactory queryFactory(usbWrapper, ioService); aasdk::usb::AccessoryModeQueryFactory queryFactory(usbWrapper, ioService);