[gui][script] Rearcam / reworks / kodi button / shutdown/reboot buttons
BIN
assets/back-hot.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
assets/bg_exit.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
assets/bg_rearcam.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
assets/kodi-hot.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
assets/rearcam-hot.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
assets/reboot-hot.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
BIN
assets/recordactive-hot.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
@ -23,5 +23,12 @@
|
|||||||
<file>record-hot.png</file>
|
<file>record-hot.png</file>
|
||||||
<file>stop-hot.png</file>
|
<file>stop-hot.png</file>
|
||||||
<file>save-hot.png</file>
|
<file>save-hot.png</file>
|
||||||
|
<file>reboot-hot.png</file>
|
||||||
|
<file>back-hot.png</file>
|
||||||
|
<file>bg_exit.png</file>
|
||||||
|
<file>kodi-hot.png</file>
|
||||||
|
<file>bg_rearcam.png</file>
|
||||||
|
<file>rearcam-hot.png</file>
|
||||||
|
<file>recordactive-hot.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
@ -46,6 +46,7 @@ public:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void exit();
|
void exit();
|
||||||
|
void reboot();
|
||||||
void openSettings();
|
void openSettings();
|
||||||
void toggleCursor();
|
void toggleCursor();
|
||||||
void TriggerScriptDay();
|
void TriggerScriptDay();
|
||||||
@ -57,6 +58,9 @@ signals:
|
|||||||
void cameraRecord();
|
void cameraRecord();
|
||||||
void openConnectDialog();
|
void openConnectDialog();
|
||||||
void showBrightnessSlider();
|
void showBrightnessSlider();
|
||||||
|
void startKodi();
|
||||||
|
void showRearCam();
|
||||||
|
void hideRearCam();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_horizontalSliderBrightness_valueChanged(int value);
|
void on_horizontalSliderBrightness_valueChanged(int value);
|
||||||
@ -68,6 +72,9 @@ private slots:
|
|||||||
void showTime();
|
void showTime();
|
||||||
void cameraControlShow();
|
void cameraControlShow();
|
||||||
void cameraControlHide();
|
void cameraControlHide();
|
||||||
|
void toggleExit();
|
||||||
|
void showRearCamBG();
|
||||||
|
void hideRearCamBG();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MainWindow* ui_;
|
Ui::MainWindow* ui_;
|
||||||
@ -76,8 +83,14 @@ private:
|
|||||||
QFile *brightnessFile;
|
QFile *brightnessFile;
|
||||||
char brightness_str[5];
|
char brightness_str[5];
|
||||||
|
|
||||||
|
bool wifiButtonForce = false;
|
||||||
|
bool cameraButtonForce = false;
|
||||||
|
bool kodiButtonForce = false;
|
||||||
|
bool brightnessButtonForce = false;
|
||||||
|
|
||||||
bool nightModeEnabled = false;
|
bool nightModeEnabled = false;
|
||||||
bool DayNightModeState = false;
|
bool DayNightModeState = false;
|
||||||
|
|
||||||
bool devModeEnabled = false;
|
bool devModeEnabled = false;
|
||||||
|
|
||||||
bool wallpaperDayFileExists = false;
|
bool wallpaperDayFileExists = false;
|
||||||
@ -86,7 +99,13 @@ private:
|
|||||||
bool wallpaperDevNightFileExists = false;
|
bool wallpaperDevNightFileExists = false;
|
||||||
|
|
||||||
bool masterButtonBGState = false;
|
bool masterButtonBGState = false;
|
||||||
|
bool exitMenuVisible = false;
|
||||||
|
|
||||||
|
bool rearCamEnabled = false;
|
||||||
bool dashcamBGState = false;
|
bool dashcamBGState = false;
|
||||||
|
bool rearcamState = false;
|
||||||
|
|
||||||
|
bool dashCamRecording = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
namespace f1x
|
namespace f1x
|
||||||
{
|
{
|
||||||
@ -89,13 +90,26 @@ 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_->pushButtonExit, &QPushButton::clicked, this, &MainWindow::exit);
|
connect(ui_->pushButtonSettings, &QPushButton::clicked, this, &MainWindow::cameraHide);
|
||||||
|
connect(ui_->pushButtonSettings, &QPushButton::clicked, this, &MainWindow::cameraControlHide);
|
||||||
|
connect(ui_->pushButtonExit, &QPushButton::clicked, this, &MainWindow::toggleExit);
|
||||||
|
connect(ui_->pushButtonExit, &QPushButton::clicked, this, &MainWindow::cameraStop);
|
||||||
|
connect(ui_->pushButtonExit, &QPushButton::clicked, this, &MainWindow::cameraHide);
|
||||||
|
connect(ui_->pushButtonExit, &QPushButton::clicked, this, &MainWindow::cameraControlHide);
|
||||||
|
connect(ui_->pushButtonShutdown, &QPushButton::clicked, this, &MainWindow::exit);
|
||||||
|
connect(ui_->pushButtonReboot, &QPushButton::clicked, this, &MainWindow::reboot);
|
||||||
|
connect(ui_->pushButtonCancel, &QPushButton::clicked, this, &MainWindow::toggleExit);
|
||||||
connect(ui_->pushButtonCameraShow, &QPushButton::clicked, this, &MainWindow::cameraShow);
|
connect(ui_->pushButtonCameraShow, &QPushButton::clicked, this, &MainWindow::cameraShow);
|
||||||
connect(ui_->pushButtonCameraShow, &QPushButton::clicked, this, &MainWindow::cameraControlShow);
|
connect(ui_->pushButtonCameraShow, &QPushButton::clicked, this, &MainWindow::cameraControlShow);
|
||||||
connect(ui_->pushButtonCameraHide, &QPushButton::clicked, this, &MainWindow::cameraHide);
|
connect(ui_->pushButtonCameraHide, &QPushButton::clicked, this, &MainWindow::cameraHide);
|
||||||
connect(ui_->pushButtonCameraHide, &QPushButton::clicked, this, &MainWindow::cameraControlHide);
|
connect(ui_->pushButtonCameraHide, &QPushButton::clicked, this, &MainWindow::cameraControlHide);
|
||||||
connect(ui_->pushButtonStop, &QPushButton::clicked, this, &MainWindow::cameraStop);
|
connect(ui_->pushButtonStop, &QPushButton::clicked, this, &MainWindow::cameraStop);
|
||||||
connect(ui_->pushButtonRecord, &QPushButton::clicked, this, &MainWindow::cameraRecord);
|
connect(ui_->pushButtonRecord, &QPushButton::clicked, this, &MainWindow::cameraRecord);
|
||||||
|
connect(ui_->pushButtonRearcam, &QPushButton::clicked, this, &MainWindow::showRearCamBG);
|
||||||
|
connect(ui_->pushButtonRearcam, &QPushButton::clicked, this, &MainWindow::showRearCam);
|
||||||
|
connect(ui_->pushButtonRearcamBack, &QPushButton::clicked, this, &MainWindow::hideRearCamBG);
|
||||||
|
connect(ui_->pushButtonRearcamBack, &QPushButton::clicked, this, &MainWindow::hideRearCam);
|
||||||
|
connect(ui_->pushButtonRearcamBack, &QPushButton::clicked, this, &MainWindow::cameraControlHide);
|
||||||
connect(ui_->pushButtonSave, &QPushButton::clicked, this, &MainWindow::cameraSave);
|
connect(ui_->pushButtonSave, &QPushButton::clicked, this, &MainWindow::cameraSave);
|
||||||
connect(ui_->pushButtonToggleCursor, &QPushButton::clicked, this, &MainWindow::toggleCursor);
|
connect(ui_->pushButtonToggleCursor, &QPushButton::clicked, this, &MainWindow::toggleCursor);
|
||||||
connect(ui_->pushButtonDay, &QPushButton::clicked, this, &MainWindow::TriggerScriptDay);
|
connect(ui_->pushButtonDay, &QPushButton::clicked, this, &MainWindow::TriggerScriptDay);
|
||||||
@ -103,6 +117,7 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
|
|||||||
connect(ui_->pushButtonNight, &QPushButton::clicked, this, &MainWindow::TriggerScriptNight);
|
connect(ui_->pushButtonNight, &QPushButton::clicked, this, &MainWindow::TriggerScriptNight);
|
||||||
connect(ui_->pushButtonNight, &QPushButton::clicked, this, &MainWindow::switchGuiToNight);
|
connect(ui_->pushButtonNight, &QPushButton::clicked, this, &MainWindow::switchGuiToNight);
|
||||||
connect(ui_->pushButtonWirelessConnection, &QPushButton::clicked, this, &MainWindow::openConnectDialog);
|
connect(ui_->pushButtonWirelessConnection, &QPushButton::clicked, this, &MainWindow::openConnectDialog);
|
||||||
|
connect(ui_->pushButtonKodi, &QPushButton::clicked, this, &MainWindow::startKodi);
|
||||||
connect(ui_->pushButtonBrightness, &QPushButton::clicked, this, &MainWindow::showBrightnessSlider);
|
connect(ui_->pushButtonBrightness, &QPushButton::clicked, this, &MainWindow::showBrightnessSlider);
|
||||||
|
|
||||||
QTimer *timer=new QTimer(this);
|
QTimer *timer=new QTimer(this);
|
||||||
@ -113,13 +128,16 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
|
|||||||
bool cursorButtonForce = cursorButtonFile.exists();
|
bool cursorButtonForce = cursorButtonFile.exists();
|
||||||
|
|
||||||
QFileInfo wifiButtonFile("/etc/button_wifi_visible");
|
QFileInfo wifiButtonFile("/etc/button_wifi_visible");
|
||||||
bool wifiButtonForce = wifiButtonFile.exists();
|
this->wifiButtonForce = wifiButtonFile.exists();
|
||||||
|
|
||||||
QFileInfo cameraButtonFile("/etc/button_camera_visible");
|
QFileInfo cameraButtonFile("/etc/button_camera_visible");
|
||||||
bool cameraButtonForce = cameraButtonFile.exists();
|
this->cameraButtonForce = cameraButtonFile.exists();
|
||||||
|
|
||||||
QFileInfo brightnessButtonFile("/etc/button_brightness_visible");
|
QFileInfo brightnessButtonFile("/etc/button_brightness_visible");
|
||||||
bool brightnessButtonForce = brightnessButtonFile.exists();
|
this->brightnessButtonForce = brightnessButtonFile.exists();
|
||||||
|
|
||||||
|
QFileInfo kodiInstalledFile("/usr/bin/kodi");
|
||||||
|
this->kodiButtonForce = kodiInstalledFile.exists();
|
||||||
|
|
||||||
if (configuration->hasTouchScreen() && !cursorButtonForce) {
|
if (configuration->hasTouchScreen() && !cursorButtonForce) {
|
||||||
ui_->pushButtonToggleCursor->hide();
|
ui_->pushButtonToggleCursor->hide();
|
||||||
@ -130,9 +148,13 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
|
|||||||
ui_->masterButtonBG->setPixmap(image);
|
ui_->masterButtonBG->setPixmap(image);
|
||||||
ui_->pushButtonStop->hide();
|
ui_->pushButtonStop->hide();
|
||||||
ui_->pushButtonRecord->hide();
|
ui_->pushButtonRecord->hide();
|
||||||
|
ui_->pushButtonRecordActive->hide();
|
||||||
ui_->pushButtonSave->hide();
|
ui_->pushButtonSave->hide();
|
||||||
|
ui_->pushButtonRearcam->hide();
|
||||||
|
ui_->pushButtonRearcamBack->hide();
|
||||||
|
ui_->rearcamBG->hide();
|
||||||
|
|
||||||
if (!cameraButtonForce) {
|
if (!this->cameraButtonForce) {
|
||||||
ui_->pushButtonCameraShow->hide();
|
ui_->pushButtonCameraShow->hide();
|
||||||
ui_->pushButtonCameraHide->hide();
|
ui_->pushButtonCameraHide->hide();
|
||||||
} else {
|
} else {
|
||||||
@ -140,22 +162,30 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
|
|||||||
ui_->pushButtonCameraHide->hide();
|
ui_->pushButtonCameraHide->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wifiButtonForce) {
|
if (!this->wifiButtonForce) {
|
||||||
ui_->pushButtonWirelessConnection->hide();
|
ui_->pushButtonWirelessConnection->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
QFileInfo brightnessFile(brightnessFilename);
|
QFileInfo brightnessFile(brightnessFilename);
|
||||||
|
|
||||||
if (!brightnessFile.exists() && !brightnessButtonForce) {
|
if (!brightnessFile.exists() && !this->brightnessButtonForce) {
|
||||||
ui_->pushButtonBrightness->hide();
|
ui_->pushButtonBrightness->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!this->kodiButtonForce) {
|
||||||
|
ui_->pushButtonKodi->hide();
|
||||||
|
}
|
||||||
|
|
||||||
ui_->horizontalSliderBrightness->hide();
|
ui_->horizontalSliderBrightness->hide();
|
||||||
|
|
||||||
if (!configuration->showClock()) {
|
if (!configuration->showClock()) {
|
||||||
ui_->Digital_clock->hide();
|
ui_->Digital_clock->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ui_->pushButtonShutdown->hide();
|
||||||
|
ui_->pushButtonReboot->hide();
|
||||||
|
ui_->pushButtonCancel->hide();
|
||||||
|
|
||||||
// init bg's on startup
|
// init bg's on startup
|
||||||
if (!this->nightModeEnabled) {
|
if (!this->nightModeEnabled) {
|
||||||
if (this->devModeEnabled) {
|
if (this->devModeEnabled) {
|
||||||
@ -203,6 +233,7 @@ void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonBrightness_clicked()
|
|||||||
this->brightnessSliderVisible = !this->brightnessSliderVisible;
|
this->brightnessSliderVisible = !this->brightnessSliderVisible;
|
||||||
if (this->brightnessSliderVisible) {
|
if (this->brightnessSliderVisible) {
|
||||||
f1x::openauto::autoapp::ui::MainWindow::cameraControlHide();
|
f1x::openauto::autoapp::ui::MainWindow::cameraControlHide();
|
||||||
|
f1x::openauto::autoapp::ui::MainWindow::cameraHide();
|
||||||
// Get the current brightness value
|
// Get the current brightness value
|
||||||
this->brightnessFile = new QFile(this->brightnessFilename);
|
this->brightnessFile = new QFile(this->brightnessFilename);
|
||||||
if (this->brightnessFile->open(QIODevice::ReadOnly)) {
|
if (this->brightnessFile->open(QIODevice::ReadOnly)) {
|
||||||
@ -281,17 +312,22 @@ void f1x::openauto::autoapp::ui::MainWindow::switchGuiToDay()
|
|||||||
|
|
||||||
void f1x::openauto::autoapp::ui::MainWindow::cameraControlHide()
|
void f1x::openauto::autoapp::ui::MainWindow::cameraControlHide()
|
||||||
{
|
{
|
||||||
|
if (this->cameraButtonForce) {
|
||||||
ui_->pushButtonCameraHide->hide();
|
ui_->pushButtonCameraHide->hide();
|
||||||
ui_->pushButtonStop->hide();
|
ui_->pushButtonStop->hide();
|
||||||
ui_->pushButtonRecord->hide();
|
ui_->pushButtonRecord->hide();
|
||||||
|
ui_->pushButtonRecordActive->hide();
|
||||||
|
ui_->pushButtonRearcam->hide();
|
||||||
ui_->pushButtonSave->hide();
|
ui_->pushButtonSave->hide();
|
||||||
ui_->dashcamBG->hide();
|
ui_->dashcamBG->hide();
|
||||||
this->dashcamBGState = false;
|
this->dashcamBGState = false;
|
||||||
ui_->pushButtonCameraShow->show();
|
ui_->pushButtonCameraShow->show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void f1x::openauto::autoapp::ui::MainWindow::cameraControlShow()
|
void f1x::openauto::autoapp::ui::MainWindow::cameraControlShow()
|
||||||
{
|
{
|
||||||
|
if (this->cameraButtonForce) {
|
||||||
ui_->pushButtonCameraShow->hide();
|
ui_->pushButtonCameraShow->hide();
|
||||||
QPixmap image;
|
QPixmap image;
|
||||||
image.load(":/bg_dashcam.png");
|
image.load(":/bg_dashcam.png");
|
||||||
@ -299,9 +335,46 @@ void f1x::openauto::autoapp::ui::MainWindow::cameraControlShow()
|
|||||||
ui_->dashcamBG->show();
|
ui_->dashcamBG->show();
|
||||||
ui_->pushButtonStop->show();
|
ui_->pushButtonStop->show();
|
||||||
ui_->pushButtonRecord->show();
|
ui_->pushButtonRecord->show();
|
||||||
|
ui_->pushButtonRearcam->show();
|
||||||
ui_->pushButtonSave->show();
|
ui_->pushButtonSave->show();
|
||||||
this->dashcamBGState = true;
|
this->dashcamBGState = true;
|
||||||
ui_->pushButtonCameraHide->show();
|
ui_->pushButtonCameraHide->show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void f1x::openauto::autoapp::ui::MainWindow::toggleExit()
|
||||||
|
{
|
||||||
|
if (!this->exitMenuVisible) {
|
||||||
|
f1x::openauto::autoapp::ui::MainWindow::cameraControlHide();
|
||||||
|
if (this->brightnessSliderVisible) {
|
||||||
|
ui_->horizontalSliderBrightness->hide();
|
||||||
|
this->brightnessSliderVisible = false;
|
||||||
|
}
|
||||||
|
ui_->pushButtonShutdown->show();
|
||||||
|
ui_->pushButtonReboot->show();
|
||||||
|
ui_->pushButtonCancel->show();
|
||||||
|
QPixmap image;
|
||||||
|
image.load(":/bg_exit.png");
|
||||||
|
ui_->exitBG->setPixmap(image);
|
||||||
|
ui_->exitBG->show();
|
||||||
|
this->exitMenuVisible = true;
|
||||||
|
} else {
|
||||||
|
ui_->pushButtonShutdown->hide();
|
||||||
|
ui_->pushButtonReboot->hide();
|
||||||
|
ui_->pushButtonCancel->hide();
|
||||||
|
ui_->exitBG->hide();
|
||||||
|
this->exitMenuVisible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void f1x::openauto::autoapp::ui::MainWindow::showRearCamBG()
|
||||||
|
{
|
||||||
|
ui_->pushButtonRearcamBack->show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void f1x::openauto::autoapp::ui::MainWindow::hideRearCamBG()
|
||||||
|
{
|
||||||
|
ui_->pushButtonRearcamBack->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void f1x::openauto::autoapp::ui::MainWindow::showTime()
|
void f1x::openauto::autoapp::ui::MainWindow::showTime()
|
||||||
@ -323,6 +396,26 @@ void f1x::openauto::autoapp::ui::MainWindow::showTime()
|
|||||||
QFileInfo nightModeFile("/tmp/night_mode_enabled");
|
QFileInfo nightModeFile("/tmp/night_mode_enabled");
|
||||||
this->nightModeEnabled = nightModeFile.exists();
|
this->nightModeEnabled = nightModeFile.exists();
|
||||||
|
|
||||||
|
QFileInfo rearCamFile("/tmp/rearcam_enabled");
|
||||||
|
this->rearCamEnabled = rearCamFile.exists();
|
||||||
|
|
||||||
|
QFileInfo dashCamRecordingFile("/tmp/dashcam_is_recording");
|
||||||
|
this->dashCamRecording = dashCamRecordingFile.exists();
|
||||||
|
|
||||||
|
if (this->dashcamBGState) {
|
||||||
|
if (this->dashCamRecording) {
|
||||||
|
if (ui_->pushButtonRecord->isVisible() == true) {
|
||||||
|
ui_->pushButtonRecordActive->show();
|
||||||
|
ui_->pushButtonRecord->hide();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (ui_->pushButtonRecordActive->isVisible() == true) {
|
||||||
|
ui_->pushButtonRecord->show();
|
||||||
|
ui_->pushButtonRecordActive->hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (this->nightModeEnabled) {
|
if (this->nightModeEnabled) {
|
||||||
if (!this->DayNightModeState) {
|
if (!this->DayNightModeState) {
|
||||||
this->DayNightModeState = true;
|
this->DayNightModeState = true;
|
||||||
@ -334,4 +427,18 @@ void f1x::openauto::autoapp::ui::MainWindow::showTime()
|
|||||||
f1x::openauto::autoapp::ui::MainWindow::switchGuiToDay();
|
f1x::openauto::autoapp::ui::MainWindow::switchGuiToDay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this->rearCamEnabled) {
|
||||||
|
if (!this->rearcamState) {
|
||||||
|
f1x::openauto::autoapp::ui::MainWindow::cameraControlHide();
|
||||||
|
f1x::openauto::autoapp::ui::MainWindow::showRearCamBG();
|
||||||
|
f1x::openauto::autoapp::ui::MainWindow::showRearCam();
|
||||||
|
this->rearcamState = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (this->rearcamState) {
|
||||||
|
f1x::openauto::autoapp::ui::MainWindow::hideRearCamBG();
|
||||||
|
f1x::openauto::autoapp::ui::MainWindow::hideRearCam();
|
||||||
|
this->rearcamState = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -80,6 +80,29 @@
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QPushButton" name="pushButtonKodi">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>30</x>
|
||||||
|
<y>104</y>
|
||||||
|
<width>64</width>
|
||||||
|
<height>64</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../assets/resources.qrc">
|
||||||
|
<normaloff>:/kodi-hot.png</normaloff>:/kodi-hot.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>64</width>
|
||||||
|
<height>64</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
<widget class="QPushButton" name="pushButtonToggleCursor">
|
<widget class="QPushButton" name="pushButtonToggleCursor">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
@ -340,6 +363,52 @@
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QPushButton" name="pushButtonRecordActive">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>216</x>
|
||||||
|
<y>384</y>
|
||||||
|
<width>64</width>
|
||||||
|
<height>64</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../assets/resources.qrc">
|
||||||
|
<normaloff>:/recordactive-hot.png</normaloff>:/recordactive-hot.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>64</width>
|
||||||
|
<height>64</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" name="pushButtonRearcam">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>286</x>
|
||||||
|
<y>384</y>
|
||||||
|
<width>64</width>
|
||||||
|
<height>64</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../assets/resources.qrc">
|
||||||
|
<normaloff>:/rearcam-hot.png</normaloff>:/rearcam-hot.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>64</width>
|
||||||
|
<height>64</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
<widget class="QPushButton" name="pushButtonSave">
|
<widget class="QPushButton" name="pushButtonSave">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
@ -363,6 +432,118 @@
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QLabel" name="exitBG">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>284</x>
|
||||||
|
<y>198</y>
|
||||||
|
<width>232</width>
|
||||||
|
<height>84</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" name="pushButtonShutdown">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>294</x>
|
||||||
|
<y>208</y>
|
||||||
|
<width>64</width>
|
||||||
|
<height>64</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../assets/resources.qrc">
|
||||||
|
<normaloff>:/power-hot.png</normaloff>:/power-hot.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>64</width>
|
||||||
|
<height>64</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" name="pushButtonReboot">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>368</x>
|
||||||
|
<y>208</y>
|
||||||
|
<width>64</width>
|
||||||
|
<height>64</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../assets/resources.qrc">
|
||||||
|
<normaloff>:/reboot-hot.png</normaloff>:/reboot-hot.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>64</width>
|
||||||
|
<height>64</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" name="pushButtonCancel">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>442</x>
|
||||||
|
<y>208</y>
|
||||||
|
<width>64</width>
|
||||||
|
<height>64</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../assets/resources.qrc">
|
||||||
|
<normaloff>:/back-hot.png</normaloff>:/back-hot.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>64</width>
|
||||||
|
<height>64</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="rearcamBG">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>800</width>
|
||||||
|
<height>480</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" name="pushButtonRearcamBack">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>800</width>
|
||||||
|
<height>480</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../assets/resources.qrc">
|
||||||
|
<normaloff>:/bg_rearcam.png</normaloff>:/bg_rearcam.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>800</width>
|
||||||
|
<height>480</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="flat">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
|
@ -110,6 +110,10 @@ int main(int argc, char* argv[])
|
|||||||
qApplication.setOverrideCursor(cursor);
|
qApplication.setOverrideCursor(cursor);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::reboot, [&qApplication]() {
|
||||||
|
system("sudo shutdown -r now");
|
||||||
|
});
|
||||||
|
|
||||||
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::cameraHide, [&qApplication]() {
|
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::cameraHide, [&qApplication]() {
|
||||||
#ifdef RASPBERRYPI3
|
#ifdef RASPBERRYPI3
|
||||||
system("/opt/crankshaft/cameracontrol.py Background &");
|
system("/opt/crankshaft/cameracontrol.py Background &");
|
||||||
@ -128,6 +132,25 @@ int main(int argc, char* argv[])
|
|||||||
#endif
|
#endif
|
||||||
});
|
});
|
||||||
|
|
||||||
|
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::hideRearCam, [&qApplication]() {
|
||||||
|
#ifdef RASPBERRYPI3
|
||||||
|
system("/opt/crankshaft/cameracontrol.py DashcamMode &");
|
||||||
|
system("sudo rm /tmp/rearcam_enabled &");
|
||||||
|
OPENAUTO_LOG(info) << "[CS] Ran RPiCameraControl script.";
|
||||||
|
#else
|
||||||
|
OPENAUTO_LOG(info) << "[CS] You are not running this on a Raspberry Pi, skipping Cam script.";
|
||||||
|
#endif
|
||||||
|
});
|
||||||
|
|
||||||
|
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::showRearCam, [&qApplication]() {
|
||||||
|
#ifdef RASPBERRYPI3
|
||||||
|
system("/opt/crankshaft/cameracontrol.py Rearcam &");
|
||||||
|
OPENAUTO_LOG(info) << "[CS] Ran RPiCameraControl script.";
|
||||||
|
#else
|
||||||
|
OPENAUTO_LOG(info) << "[CS] You are not running this on a Raspberry Pi, skipping Cam script.";
|
||||||
|
#endif
|
||||||
|
});
|
||||||
|
|
||||||
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::cameraRecord, [&qApplication]() {
|
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::cameraRecord, [&qApplication]() {
|
||||||
#ifdef RASPBERRYPI3
|
#ifdef RASPBERRYPI3
|
||||||
system("/opt/crankshaft/cameracontrol.py Record &");
|
system("/opt/crankshaft/cameracontrol.py Record &");
|
||||||
@ -173,6 +196,15 @@ int main(int argc, char* argv[])
|
|||||||
#endif
|
#endif
|
||||||
});
|
});
|
||||||
|
|
||||||
|
QObject::connect(&mainWindow, &autoapp::ui::MainWindow::startKodi, [&qApplication]() {
|
||||||
|
#ifdef RASPBERRYPI3
|
||||||
|
system("/usr/bin/kodi &");
|
||||||
|
OPENAUTO_LOG(info) << "[CS] Run kodi binary.";
|
||||||
|
#else
|
||||||
|
OPENAUTO_LOG(info) << "[CS] You are not running this on a Raspberry Pi, skipping kodi.";
|
||||||
|
#endif
|
||||||
|
});
|
||||||
|
|
||||||
mainWindow.showFullScreen();
|
mainWindow.showFullScreen();
|
||||||
|
|
||||||
aasdk::usb::USBWrapper usbWrapper(usbContext);
|
aasdk::usb::USBWrapper usbWrapper(usbContext);
|
||||||
|