Rework triggers / usb /network

This commit is contained in:
hawkeyexp 2018-11-03 12:16:10 +01:00
parent 4e2ebcdd4a
commit e5c031774e
9 changed files with 1141 additions and 929 deletions

View File

@ -41,6 +41,7 @@
#include <taglib/fileref.h> #include <taglib/fileref.h>
#include <taglib/tag.h> #include <taglib/tag.h>
#include <QFileSystemWatcher>
namespace Ui namespace Ui
{ {
@ -63,6 +64,8 @@ public:
explicit MainWindow(configuration::IConfiguration::Pointer configuration, QWidget *parent = nullptr); explicit MainWindow(configuration::IConfiguration::Pointer configuration, QWidget *parent = nullptr);
~MainWindow() override; ~MainWindow() override;
QMediaPlayer* player; QMediaPlayer* player;
QFileSystemWatcher* watcher;
QFileSystemWatcher* watcher_tmp;
signals: signals:
void exit(); void exit();
@ -137,6 +140,8 @@ private slots:
void on_StateChanged(QMediaPlayer::State state); void on_StateChanged(QMediaPlayer::State state);
void scanFolders(); void scanFolders();
void scanFiles(); void scanFiles();
void tmpChanged();
void setTrigger();
private: private:
Ui::MainWindow* ui_; Ui::MainWindow* ui_;
@ -223,6 +228,8 @@ private:
int currentPlaylistIndex = 0; int currentPlaylistIndex = 0;
bool background_set = false; bool background_set = false;
bool mediacontentchanged = true;
}; };
} }

View File

@ -24,6 +24,7 @@
#include <QFileDialog> #include <QFileDialog>
class QCheckBox; class QCheckBox;
class QTimer;
namespace Ui namespace Ui
{ {
@ -62,6 +63,7 @@ private slots:
void syncNTPTime(); void syncNTPTime();
void on_pushButtonRescan_clicked(); void on_pushButtonRescan_clicked();
void on_pushButtonAudioTest_clicked(); void on_pushButtonAudioTest_clicked();
void updateNetworkInfo();
private slots: private slots:
void show_tab1(); void show_tab1();
@ -83,6 +85,9 @@ private:
Ui::SettingsWindow* ui_; Ui::SettingsWindow* ui_;
configuration::IConfiguration::Pointer configuration_; configuration::IConfiguration::Pointer configuration_;
QString hotspotssid;
QString wifissid;
}; };
} }

View File

@ -54,7 +54,6 @@ bool RtAudioOutput::open()
RtAudio::StreamOptions streamOptions; RtAudio::StreamOptions streamOptions;
streamOptions.flags = RTAUDIO_MINIMIZE_LATENCY | RTAUDIO_SCHEDULE_REALTIME; streamOptions.flags = RTAUDIO_MINIMIZE_LATENCY | RTAUDIO_SCHEDULE_REALTIME;
uint32_t bufferFrames = sampleRate_ == 16000 ? 1024 : 2048; //according to the observation of audio packets uint32_t bufferFrames = sampleRate_ == 16000 ? 1024 : 2048; //according to the observation of audio packets
//dac_->openStream(&parameters, nullptr, RTAUDIO_SINT16, sampleRate_, &bufferFrames, &RtAudioOutput::audioBufferReadHandler, static_cast<void*>(this), &streamOptions);
dac_->openStream(&parameters, nullptr, RTAUDIO_SINT16, sampleRate_, &bufferFrames, &RtAudioOutput::audioBufferReadHandler, static_cast<void*>(this), &streamOptions); dac_->openStream(&parameters, nullptr, RTAUDIO_SINT16, sampleRate_, &bufferFrames, &RtAudioOutput::audioBufferReadHandler, static_cast<void*>(this), &streamOptions);
OPENAUTO_LOG(info) << "[RtAudioOutput] Sample Rate: " << sampleRate_; OPENAUTO_LOG(info) << "[RtAudioOutput] Sample Rate: " << sampleRate_;
return audioBuffer_.open(QIODevice::ReadWrite); return audioBuffer_.open(QIODevice::ReadWrite);

View File

@ -29,6 +29,7 @@
#include <QFont> #include <QFont>
#include <QScreen> #include <QScreen>
#include <QRect> #include <QRect>
#include <QFileSystemWatcher>
namespace f1x namespace f1x
{ {
@ -164,49 +165,21 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
connect(ui_->pushButtonMusic2, &QPushButton::clicked, this, &MainWindow::playerShow); connect(ui_->pushButtonMusic2, &QPushButton::clicked, this, &MainWindow::playerShow);
connect(ui_->pushButtonBack, &QPushButton::clicked, this, &MainWindow::playerHide); connect(ui_->pushButtonBack, &QPushButton::clicked, this, &MainWindow::playerHide);
connect(ui_->pushButtonPlayerBack, &QPushButton::clicked, this, &MainWindow::playerHide); connect(ui_->pushButtonPlayerBack, &QPushButton::clicked, this, &MainWindow::playerHide);
connect(ui_->pushButtonUSB, &QPushButton::clicked, this, &MainWindow::openUSBDialog); //connect(ui_->pushButtonUSB, &QPushButton::clicked, this, &MainWindow::openUSBDialog);
connect(ui_->pushButtonRescan, &QPushButton::clicked, this, &MainWindow::scanFolders);
// by default hide bluetooth button on init // by default hide bluetooth button on init
ui_->pushButtonBluetooth->hide(); ui_->pushButtonBluetooth->hide();
// by default hide media player // by default hide media player
ui_->mediaWidget->hide(); ui_->mediaWidget->hide();
ui_->pushButtonUSB->hide();
ui_->SysinfoTopLeft->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(1000); timer->start(1000);
// Build Version string for mainscreen
// Get git version string
//QFileInfo vFile("/etc/crankshaft.build");
//if (vFile.exists()) {
// QFile versionFile(QString("/etc/crankshaft.build"));
// versionFile.open(QIODevice::ReadOnly);
// QTextStream data_version(&versionFile);
// QString lineversion = data_version.readAll();
// versionFile.close();
// this->bversion=lineversion.simplified();
//} else {
// this->bversion="unknown";
//}
// Get date string
//QFileInfo dFile("/etc/crankshaft.build");
//if (dFile.exists()) {
// QFile dateFile(QString("/etc/crankshaft.date"));
// dateFile.open(QIODevice::ReadOnly);
// QTextStream data_date(&dateFile);
// QString linedate = data_date.readAll();
// dateFile.close();
// this->bdate=linedate.simplified();
//} else {
// this->bdate="- - -";
//}
//QString buildid = "Build: " + this->bversion + " (" + this->bdate + ")";
//ui_->BuildID->setText(buildid);
// enable connects while cam is enabled // enable connects while cam is enabled
if (this->cameraButtonForce) { if (this->cameraButtonForce) {
connect(ui_->pushButtonCameraShow, &QPushButton::clicked, this, &MainWindow::cameraShow); connect(ui_->pushButtonCameraShow, &QPushButton::clicked, this, &MainWindow::cameraShow);
@ -571,13 +544,17 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
ui_->labelFolderpath->hide(); ui_->labelFolderpath->hide();
ui_->labelAlbumpath->hide(); ui_->labelAlbumpath->hide();
// link possible existing media
system(qPrintable("ln -s /media/CSSTORAGE/Music/* /media/MYMEDIA"));
system(qPrintable("/usr/local/bin/autoapp_helper cleansymlinks"));
MainWindow::scanFolders(); MainWindow::scanFolders();
ui_->comboBoxAlbum->setCurrentText(QString::fromStdString(configuration->getMp3SubFolder())); ui_->comboBoxAlbum->setCurrentText(QString::fromStdString(configuration->getMp3SubFolder()));
MainWindow::scanFiles(); MainWindow::scanFiles();
watcher = new QFileSystemWatcher(this);
watcher->addPath("/media/USBDRIVES");
connect(watcher, &QFileSystemWatcher::directoryChanged, this, &MainWindow::setTrigger);
watcher_tmp = new QFileSystemWatcher(this);
watcher_tmp->addPath("/tmp");
connect(watcher_tmp, &QFileSystemWatcher::directoryChanged, this, &MainWindow::tmpChanged);
} }
MainWindow::~MainWindow() MainWindow::~MainWindow()
@ -977,6 +954,7 @@ void f1x::openauto::autoapp::ui::MainWindow::toggleGUI()
} }
} }
} }
f1x::openauto::autoapp::ui::MainWindow::tmpChanged();
} }
void f1x::openauto::autoapp::ui::MainWindow::createDebuglog() void f1x::openauto::autoapp::ui::MainWindow::createDebuglog()
@ -1006,266 +984,7 @@ void f1x::openauto::autoapp::ui::MainWindow::showTime()
if ((time.second() % 2) == 0) { if ((time.second() % 2) == 0) {
time_text[3] = ' '; time_text[3] = ' ';
time_text[8] = ' '; time_text[8] = ' ';
// check if system is in display off mode (tap2wake)
QFileInfo blankFile("/tmp/blankscreen");
if (blankFile.exists()) {
if (ui_->centralWidget->isVisible() == true) {
ui_->centralWidget->hide();
}
} else {
if (ui_->centralWidget->isVisible() == false) {
ui_->centralWidget->show();
}
}
// check if custom command needs black background
QFileInfo blackFile("/tmp/blackscreen");
if (blackFile.exists()) {
if (ui_->centralWidget->isVisible() == true) {
ui_->centralWidget->hide();
this->setStyleSheet("QMainWindow {background-color: rgb(0,0,0);}");
this->background_set = false;
}
} else {
if (this->background_set == false) {
if (!this->nightModeEnabled) {
if (this->oldGUIStyle) {
if (this->wallpaperClassicDayFileExists) {
this->setStyleSheet("QMainWindow { background: url(wallpaper-classic.png); background-repeat: no-repeat; background-position: center; }");
} else {
this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
}
} else {
if (this->wallpaperDayFileExists) {
this->setStyleSheet("QMainWindow { background: url(wallpaper.png); background-repeat: no-repeat; background-position: center; }");
} else {
this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
}
}
} else {
if (this->oldGUIStyle) {
if (this->wallpaperClassicNightFileExists) {
this->setStyleSheet("QMainWindow { background: url(wallpaper-classic-night.png); background-repeat: no-repeat; background-position: center; }");
} else {
this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
}
} else {
if (this->wallpaperNightFileExists) {
this->setStyleSheet("QMainWindow { background: url(wallpaper-night.png); background-repeat: no-repeat; background-position: center; }");
} else {
this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
}
}
}
this->background_set = true;
}
}
// check if phone is conencted to usb
QFileInfo phoneConnectedFile("/tmp/android_device");
if (phoneConnectedFile.exists()) {
if (ui_->phoneConnected->isVisible() == false) {
ui_->phoneConnected->setText("USB connected");
ui_->phoneConnected->show();
}
} else {
if (ui_->phoneConnected->isVisible() == true) {
ui_->phoneConnected->hide();
}
}
// check if bluetooth available
QFileInfo bluetoothButtonFile("/tmp/button_bluetooth_visible");
this->bluetoothEnabled = bluetoothButtonFile.exists();
if (this->bluetoothEnabled) {
if (ui_->pushButtonBluetooth->isVisible() == false) {
ui_->pushButtonBluetooth->show();
}
} else {
if (ui_->pushButtonBluetooth->isVisible() == true) {
ui_->pushButtonBluetooth->hide();
}
}
// check if a device is connected via bluetooth
QFileInfo phoneBTConnectedFile("/tmp/btdevice");
if (phoneBTConnectedFile.exists()) {
if (ui_->btDevice->isVisible() == false) {
QFile phoneBTData(QString("/tmp/btdevice"));
phoneBTData.open(QIODevice::ReadOnly);
QTextStream data_date(&phoneBTData);
QString linedate = data_date.readAll();
phoneBTData.close();
ui_->btDevice->setText(linedate.simplified());
ui_->btDevice->show();
}
} else {
if (ui_->btDevice->isVisible() == true) {
ui_->btDevice->hide();
}
}
// check the need for system messages
QFileInfo configInProgressFile("/tmp/config_in_progress");
QFileInfo debugInProgressFile("/tmp/debug_in_progress");
QFileInfo enablePairingFile("/tmp/enable_pairing");
if (configInProgressFile.exists() || debugInProgressFile.exists() || enablePairingFile.exists()) {
if (ui_->systemConfigInProgress->isVisible() == false) {
if (configInProgressFile.exists()) {
ui_->systemConfigInProgress->setText("System config in progress - please wait ...");
ui_->pushButtonSettings->hide();
ui_->pushButtonSettings2->hide();
ui_->pushButtonLock->show();
ui_->pushButtonLock2->show();
ui_->systemConfigInProgress->show();
}
if (debugInProgressFile.exists()) {
ui_->systemConfigInProgress->setText("Creating debug.zip on /boot - please wait ...");
ui_->pushButtonSettings->hide();
ui_->pushButtonSettings2->hide();
ui_->pushButtonDebug->hide();
ui_->pushButtonDebug2->hide();
ui_->pushButtonLock->show();
ui_->pushButtonLock2->show();
ui_->systemConfigInProgress->show();
}
if (enablePairingFile.exists()) {
ui_->systemConfigInProgress->setText("Auto Bluetooth Pairing enabled for 120 seconds!");
ui_->pushButtonDebug->hide();
ui_->pushButtonDebug2->hide();
ui_->systemConfigInProgress->show();
}
}
} else {
if (ui_->systemConfigInProgress->isVisible() == true) {
ui_->systemConfigInProgress->hide();
ui_->pushButtonSettings->show();
ui_->pushButtonSettings2->show();
ui_->pushButtonLock->hide();
ui_->pushButtonLock2->hide();
if (this->systemDebugmode) {
ui_->pushButtonDebug->show();
ui_->pushButtonDebug2->show();
}
}
}
// update day/night state
QFileInfo nightModeFile("/tmp/night_mode_enabled");
this->nightModeEnabled = nightModeFile.exists();
if (this->nightModeEnabled) {
if (!this->DayNightModeState) {
this->DayNightModeState = true;
f1x::openauto::autoapp::ui::MainWindow::switchGuiToNight();
}
} else {
if (this->DayNightModeState) {
this->DayNightModeState = false;
f1x::openauto::autoapp::ui::MainWindow::switchGuiToDay();
}
}
// camera stuff
if (this->cameraButtonForce) {
// check if dashcam is recording
QFileInfo dashCamRecordingFile("/tmp/dashcam_is_recording");
this->dashCamRecording = dashCamRecordingFile.exists();
// show recording state if dashcam is visible
if (ui_->cameraWidget->isVisible() == true) {
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();
}
}
}
// check if rearcam is eanbled
QFileInfo rearCamFile("/tmp/rearcam_enabled");
this->rearCamEnabled = rearCamFile.exists();
if (this->rearCamEnabled) {
if (!this->rearCamVisible) {
this->rearCamVisible = true;
f1x::openauto::autoapp::ui::MainWindow::MainWindow::showRearCam();
}
} else {
if (this->rearCamVisible) {
this->rearCamVisible = false;
f1x::openauto::autoapp::ui::MainWindow::MainWindow::hideRearCam();
}
}
}
// check if sutdown is external triggered and init clean app exit
QFileInfo externalExitFile("/tmp/external_exit");
if (externalExitFile.exists()) {
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();
}
if (button_count == 2) {
ui_->pushButtonDummyClassic1->hide();
ui_->pushButtonDummyClassic2->hide();
}
if (button_count == 1) {
ui_->pushButtonDummyClassic1->show();
ui_->pushButtonDummyClassic2->hide();
}
if (button_count == 0) {
ui_->pushButtonDummyClassic1->show();
ui_->pushButtonDummyClassic2->show();
}
ui_->Digital_clock->setText(time_text); ui_->Digital_clock->setText(time_text);
ui_->bigClock->setText(time_text); ui_->bigClock->setText(time_text);
} }
@ -1289,7 +1008,7 @@ void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonList_clicked()
ui_->pushButtonList->hide(); ui_->pushButtonList->hide();
ui_->pushButtonPlayerPlayList->show(); ui_->pushButtonPlayerPlayList->show();
ui_->pushButtonBackToPlayer->show(); ui_->pushButtonBackToPlayer->show();
ui_->pushButtonUSB->show(); //ui_->pushButtonUSB->show();
} }
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerStop_clicked() void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerStop_clicked()
@ -1308,7 +1027,7 @@ void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerStop_clicked()
ui_->playerPositionTime->setText("00:00 / 00:00"); ui_->playerPositionTime->setText("00:00 / 00:00");
ui_->labelCurrentPlaying->setText(""); ui_->labelCurrentPlaying->setText("");
ui_->labelTrack->setText(""); ui_->labelTrack->setText("");
ui_->pushButtonUSB->show(); //ui_->pushButtonUSB->show();
} }
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerPause_clicked() void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerPause_clicked()
@ -1434,71 +1153,100 @@ void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerPlayList_clicked
ui_->pushButtonPlayerPause->show(); ui_->pushButtonPlayerPause->show();
int currentalbum = ui_->comboBoxAlbum->currentIndex(); int currentalbum = ui_->comboBoxAlbum->currentIndex();
ui_->labelCurrentAlbumIndex->setText(QString::number(currentalbum+1)); ui_->labelCurrentAlbumIndex->setText(QString::number(currentalbum+1));
ui_->pushButtonUSB->hide(); //ui_->pushButtonUSB->hide();
} }
void f1x::openauto::autoapp::ui::MainWindow::on_comboBoxAlbum_currentIndexChanged(const QString &arg1) void f1x::openauto::autoapp::ui::MainWindow::on_comboBoxAlbum_currentIndexChanged(const QString &arg1)
{ {
this->albumfolder = arg1; this->albumfolder = arg1;
f1x::openauto::autoapp::ui::MainWindow::scanFiles(); MainWindow::scanFiles();
}
void f1x::openauto::autoapp::ui::MainWindow::setTrigger()
{
this->mediacontentchanged = true;
ui_->SysinfoTopLeft->setText("Media changed - Scanning ...");
ui_->SysinfoTopLeft->show();
//QTimer *timerscan=new QTimer(this);
//connect(timerscan, SIGNAL(timeout()),this,SLOT(scanFolders()));
//timerscan->start(10000);
// Start delayed folderscan after usb event
QTimer::singleShot(10000, this, SLOT(scanFolders()));
} }
void f1x::openauto::autoapp::ui::MainWindow::scanFolders() void f1x::openauto::autoapp::ui::MainWindow::scanFolders()
{ {
int cleaner = ui_->comboBoxAlbum->count(); try {
while (cleaner > -1) { if (this->mediacontentchanged == true) {
ui_->comboBoxAlbum->removeItem(cleaner); this->mediacontentchanged = false;
cleaner--; int cleaner = ui_->comboBoxAlbum->count();
} while (cleaner > -1) {
QDir directory(this->musicfolder); ui_->comboBoxAlbum->removeItem(cleaner);
QStringList folders = directory.entryList(QStringList() << "*", QDir::AllDirs, QDir::Name); cleaner--;
foreach (QString foldername, folders) { }
if (foldername != "..") { QDir directory(this->musicfolder);
ui_->comboBoxAlbum->addItem(foldername); QStringList folders = directory.entryList(QStringList() << "*", QDir::AllDirs, QDir::Name);
ui_->labelAlbumCount->setText(QString::number(ui_->comboBoxAlbum->count())); foreach (QString foldername, folders) {
if (foldername != "..") {
ui_->comboBoxAlbum->addItem(foldername);
ui_->labelAlbumCount->setText(QString::number(ui_->comboBoxAlbum->count()));
}
}
this->currentPlaylistIndex = 0;
ui_->SysinfoTopLeft->hide();
//timerscan->stop();
} }
} }
this->currentPlaylistIndex = 0; catch(...) {
ui_->SysinfoTopLeft->hide();
//timerscan->stop();
qDebug() << "Fail in Folderscan";
}
} }
void f1x::openauto::autoapp::ui::MainWindow::scanFiles() void f1x::openauto::autoapp::ui::MainWindow::scanFiles()
{ {
int cleaner = ui_->mp3List->count(); if (this->mediacontentchanged == false) {
while (cleaner > -1) { int cleaner = ui_->mp3List->count();
ui_->mp3List->takeItem(cleaner); while (cleaner > -1) {
cleaner--; ui_->mp3List->takeItem(cleaner);
} cleaner--;
this->playlist->clear();
QList<QMediaContent> content;
QDir directory(this->musicfolder + "/" + this->albumfolder);
QStringList mp3s = directory.entryList(QStringList() << "*.mp3" << "*.flac" << "*.aac" << "*.ogg" << "*.mp4" << "*.mp4a" << "*.wma",QDir::Files, QDir::Name);
foreach (QString filename, mp3s) {
// add to mediacontent
content.push_back(QMediaContent(QUrl::fromLocalFile(this->musicfolder + "/" + this->albumfolder + "/" + filename)));
// add items to gui
// read metadata using taglib
try {
TagLib::FileRef file((this->musicfolder + "/" + this->albumfolder + "/" + filename).toUtf8(),true);
TagLib::String artist_string = file.tag()->artist();
TagLib::String title_string = file.tag()->title();
TagLib::uint track_string = file.tag()->track();
QString artistid3 = QString::fromStdWString(artist_string.toCWString());
QString titleid3 = QString::fromStdWString(title_string.toCWString());
QString trackid3 = QString::number(track_string);
int tracklength = trackid3.length();
if (tracklength < 2) {
trackid3 = "0" + trackid3;
}
QString ID3Entry = trackid3 + ": " + artistid3 + " - " + titleid3;
ui_->mp3List->addItem(ID3Entry);
} catch (...) {
// old way only adding filename to list
ui_->mp3List->addItem(filename);
} }
this->playlist->clear();
QList<QMediaContent> content;
QDir directory(this->musicfolder + "/" + this->albumfolder);
QStringList mp3s = directory.entryList(QStringList() << "*.mp3" << "*.flac" << "*.aac" << "*.ogg" << "*.mp4" << "*.mp4a" << "*.wma",QDir::Files, QDir::Name);
foreach (QString filename, mp3s) {
// add to mediacontent
content.push_back(QMediaContent(QUrl::fromLocalFile(this->musicfolder + "/" + this->albumfolder + "/" + filename)));
// add items to gui
// read metadata using taglib
try {
TagLib::FileRef file((this->musicfolder + "/" + this->albumfolder + "/" + filename).toUtf8(),true);
TagLib::String artist_string = file.tag()->artist();
TagLib::String title_string = file.tag()->title();
TagLib::uint track_string = file.tag()->track();
QString artistid3 = QString::fromStdWString(artist_string.toCWString());
QString titleid3 = QString::fromStdWString(title_string.toCWString());
QString trackid3 = QString::number(track_string);
int tracklength = trackid3.length();
if (tracklength < 2) {
trackid3 = "0" + trackid3;
}
QString ID3Entry = trackid3 + ": " + artistid3 + " - " + titleid3;
ui_->mp3List->addItem(ID3Entry);
} catch (...) {
// old way only adding filename to list
ui_->mp3List->addItem(filename);
}
}
// set playlist
this->playlist->addMedia(content);
} }
// set playlist
this->playlist->addMedia(content);
} }
void f1x::openauto::autoapp::ui::MainWindow::on_mp3List_currentRowChanged(int currentRow) void f1x::openauto::autoapp::ui::MainWindow::on_mp3List_currentRowChanged(int currentRow)
@ -1558,7 +1306,7 @@ void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonBackToPlayer_clicked()
ui_->pushButtonBackToPlayer->hide(); ui_->pushButtonBackToPlayer->hide();
ui_->pushButtonPlayerPlayList->hide(); ui_->pushButtonPlayerPlayList->hide();
ui_->pushButtonList->show(); ui_->pushButtonList->show();
ui_->pushButtonUSB->hide(); //ui_->pushButtonUSB->hide();
} }
void f1x::openauto::autoapp::ui::MainWindow::on_StateChanged(QMediaPlayer::State state) void f1x::openauto::autoapp::ui::MainWindow::on_StateChanged(QMediaPlayer::State state)
@ -1569,3 +1317,265 @@ void f1x::openauto::autoapp::ui::MainWindow::on_StateChanged(QMediaPlayer::State
system("touch /tmp/media_playing"); system("touch /tmp/media_playing");
} }
} }
void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
{
// check if system is in display off mode (tap2wake)
QFileInfo blankFile("/tmp/blankscreen");
if (blankFile.exists()) {
if (ui_->centralWidget->isVisible() == true) {
ui_->centralWidget->hide();
}
} else {
if (ui_->centralWidget->isVisible() == false) {
ui_->centralWidget->show();
}
}
// check if custom command needs black background
QFileInfo blackFile("/tmp/blackscreen");
if (blackFile.exists()) {
if (ui_->centralWidget->isVisible() == true) {
ui_->centralWidget->hide();
this->setStyleSheet("QMainWindow {background-color: rgb(0,0,0);}");
this->background_set = false;
}
} else {
if (this->background_set == false) {
if (!this->nightModeEnabled) {
if (this->oldGUIStyle) {
if (this->wallpaperClassicDayFileExists) {
this->setStyleSheet("QMainWindow { background: url(wallpaper-classic.png); background-repeat: no-repeat; background-position: center; }");
} else {
this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
}
} else {
if (this->wallpaperDayFileExists) {
this->setStyleSheet("QMainWindow { background: url(wallpaper.png); background-repeat: no-repeat; background-position: center; }");
} else {
this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
}
}
} else {
if (this->oldGUIStyle) {
if (this->wallpaperClassicNightFileExists) {
this->setStyleSheet("QMainWindow { background: url(wallpaper-classic-night.png); background-repeat: no-repeat; background-position: center; }");
} else {
this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
}
} else {
if (this->wallpaperNightFileExists) {
this->setStyleSheet("QMainWindow { background: url(wallpaper-night.png); background-repeat: no-repeat; background-position: center; }");
} else {
this->setStyleSheet("QMainWindow { background: url(:/black.png); background-repeat: no-repeat; background-position: center; }");
}
}
}
this->background_set = true;
}
}
// check if phone is conencted to usb
QFileInfo phoneConnectedFile("/tmp/android_device");
if (phoneConnectedFile.exists()) {
if (ui_->phoneConnected->isVisible() == false) {
ui_->phoneConnected->setText("USB connected");
ui_->phoneConnected->show();
}
} else {
if (ui_->phoneConnected->isVisible() == true) {
ui_->phoneConnected->hide();
}
}
// check if bluetooth available
QFileInfo bluetoothButtonFile("/tmp/button_bluetooth_visible");
this->bluetoothEnabled = bluetoothButtonFile.exists();
if (this->bluetoothEnabled) {
if (ui_->pushButtonBluetooth->isVisible() == false) {
ui_->pushButtonBluetooth->show();
}
} else {
if (ui_->pushButtonBluetooth->isVisible() == true) {
ui_->pushButtonBluetooth->hide();
}
}
// check if a device is connected via bluetooth
QFileInfo phoneBTConnectedFile("/tmp/btdevice");
if (phoneBTConnectedFile.exists()) {
if (ui_->btDevice->isVisible() == false) {
QFile phoneBTData(QString("/tmp/btdevice"));
phoneBTData.open(QIODevice::ReadOnly);
QTextStream data_date(&phoneBTData);
QString linedate = data_date.readAll();
phoneBTData.close();
ui_->btDevice->setText(linedate.simplified());
ui_->btDevice->show();
}
} else {
if (ui_->btDevice->isVisible() == true) {
ui_->btDevice->hide();
}
}
// check the need for system messages
QFileInfo configInProgressFile("/tmp/config_in_progress");
QFileInfo debugInProgressFile("/tmp/debug_in_progress");
QFileInfo enablePairingFile("/tmp/enable_pairing");
if (configInProgressFile.exists() || debugInProgressFile.exists() || enablePairingFile.exists()) {
if (ui_->systemConfigInProgress->isVisible() == false) {
if (configInProgressFile.exists()) {
ui_->systemConfigInProgress->setText("System config in progress - please wait ...");
ui_->pushButtonSettings->hide();
ui_->pushButtonSettings2->hide();
ui_->pushButtonLock->show();
ui_->pushButtonLock2->show();
ui_->systemConfigInProgress->show();
}
if (debugInProgressFile.exists()) {
ui_->systemConfigInProgress->setText("Creating debug.zip on /boot - please wait ...");
ui_->pushButtonSettings->hide();
ui_->pushButtonSettings2->hide();
ui_->pushButtonDebug->hide();
ui_->pushButtonDebug2->hide();
ui_->pushButtonLock->show();
ui_->pushButtonLock2->show();
ui_->systemConfigInProgress->show();
}
if (enablePairingFile.exists()) {
ui_->systemConfigInProgress->setText("Auto Bluetooth Pairing enabled for 120 seconds!");
ui_->pushButtonDebug->hide();
ui_->pushButtonDebug2->hide();
ui_->systemConfigInProgress->show();
}
}
} else {
if (ui_->systemConfigInProgress->isVisible() == true) {
ui_->systemConfigInProgress->hide();
ui_->pushButtonSettings->show();
ui_->pushButtonSettings2->show();
ui_->pushButtonLock->hide();
ui_->pushButtonLock2->hide();
if (this->systemDebugmode) {
ui_->pushButtonDebug->show();
ui_->pushButtonDebug2->show();
}
}
}
// update day/night state
QFileInfo nightModeFile("/tmp/night_mode_enabled");
this->nightModeEnabled = nightModeFile.exists();
if (this->nightModeEnabled) {
if (!this->DayNightModeState) {
this->DayNightModeState = true;
f1x::openauto::autoapp::ui::MainWindow::switchGuiToNight();
}
} else {
if (this->DayNightModeState) {
this->DayNightModeState = false;
f1x::openauto::autoapp::ui::MainWindow::switchGuiToDay();
}
}
// camera stuff
if (this->cameraButtonForce) {
// check if dashcam is recording
QFileInfo dashCamRecordingFile("/tmp/dashcam_is_recording");
this->dashCamRecording = dashCamRecordingFile.exists();
// show recording state if dashcam is visible
if (ui_->cameraWidget->isVisible() == true) {
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();
}
}
}
// check if rearcam is eanbled
QFileInfo rearCamFile("/tmp/rearcam_enabled");
this->rearCamEnabled = rearCamFile.exists();
if (this->rearCamEnabled) {
if (!this->rearCamVisible) {
this->rearCamVisible = true;
f1x::openauto::autoapp::ui::MainWindow::MainWindow::showRearCam();
}
} else {
if (this->rearCamVisible) {
this->rearCamVisible = false;
f1x::openauto::autoapp::ui::MainWindow::MainWindow::hideRearCam();
}
}
}
// check if sutdown is external triggered and init clean app exit
QFileInfo externalExitFile("/tmp/external_exit");
if (externalExitFile.exists()) {
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();
}
if (button_count == 2) {
ui_->pushButtonDummyClassic1->hide();
ui_->pushButtonDummyClassic2->hide();
}
if (button_count == 1) {
ui_->pushButtonDummyClassic1->show();
ui_->pushButtonDummyClassic2->hide();
}
if (button_count == 0) {
ui_->pushButtonDummyClassic1->show();
ui_->pushButtonDummyClassic2->show();
}
//qDebug() << "/tmp changed";
}

View File

@ -23,8 +23,11 @@
#include <QFileInfo> #include <QFileInfo>
#include <QTextStream> #include <QTextStream>
#include <string> #include <string>
#include <QTimer>
#include <QDateTime> #include <QDateTime>
#include <QProcess> #include <QProcess>
#include <QNetworkInterface>
#include <QNetworkConfigurationManager>
namespace f1x namespace f1x
{ {
@ -57,12 +60,11 @@ SettingsWindow::SettingsWindow(configuration::IConfiguration::Pointer configurat
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::onStartHotspot);
connect(ui_->pushButtonHotspotStart , &QPushButton::clicked, this, &SettingsWindow::close);
connect(ui_->pushButtonHotspotStop, &QPushButton::clicked, this, &SettingsWindow::onStopHotspot); 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);
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_->pushButtonSetTime, &QPushButton::clicked, [&]() { &SettingsWindow::setTime; &SettingsWindow::close; });
connect(ui_->pushButtonNTP, &QPushButton::clicked, this, &SettingsWindow::close);
// menu // menu
ui_->tab1->show(); ui_->tab1->show();
@ -73,14 +75,18 @@ SettingsWindow::SettingsWindow(configuration::IConfiguration::Pointer configurat
ui_->tab6->hide(); ui_->tab6->hide();
ui_->tab7->hide(); ui_->tab7->hide();
ui_->tab8->hide(); ui_->tab8->hide();
ui_->horizontalGroupBox->hide(); ui_->horizontalGroupBox->hide();
ui_->groupBoxNetworking->hide(); ui_->labelBluetoothAdapterAddress->hide();
ui_->lineEditExternalBluetoothAdapterAddress->hide();
ui_->labelTestInProgress->hide();
connect(ui_->pushButtonTab1, &QPushButton::clicked, this, &SettingsWindow::show_tab1); connect(ui_->pushButtonTab1, &QPushButton::clicked, this, &SettingsWindow::show_tab1);
connect(ui_->pushButtonTab2, &QPushButton::clicked, this, &SettingsWindow::show_tab2); connect(ui_->pushButtonTab2, &QPushButton::clicked, this, &SettingsWindow::show_tab2);
connect(ui_->pushButtonTab3, &QPushButton::clicked, this, &SettingsWindow::show_tab3); connect(ui_->pushButtonTab3, &QPushButton::clicked, this, &SettingsWindow::show_tab3);
connect(ui_->pushButtonTab4, &QPushButton::clicked, this, &SettingsWindow::show_tab4); connect(ui_->pushButtonTab4, &QPushButton::clicked, this, &SettingsWindow::show_tab4);
connect(ui_->pushButtonTab5, &QPushButton::clicked, this, &SettingsWindow::show_tab5); connect(ui_->pushButtonTab5, &QPushButton::clicked, this, &SettingsWindow::show_tab5);
connect(ui_->pushButtonTab5, &QPushButton::clicked, this, &SettingsWindow::updateNetworkInfo);
connect(ui_->pushButtonTab6, &QPushButton::clicked, this, &SettingsWindow::show_tab6); connect(ui_->pushButtonTab6, &QPushButton::clicked, this, &SettingsWindow::show_tab6);
connect(ui_->pushButtonTab7, &QPushButton::clicked, this, &SettingsWindow::show_tab7); connect(ui_->pushButtonTab7, &QPushButton::clicked, this, &SettingsWindow::show_tab7);
connect(ui_->pushButtonTab8, &QPushButton::clicked, this, &SettingsWindow::show_tab8); connect(ui_->pushButtonTab8, &QPushButton::clicked, this, &SettingsWindow::show_tab8);
@ -90,8 +96,22 @@ 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());
SettingsWindow::on_pushButtonRescan_clicked(); SettingsWindow::on_pushButtonRescan_clicked();
ui_->labelTestInProgress->hide(); ui_->label_modeswitchprogress->hide();
QFileInfo hotspotFile("/tmp/hotspot_active");
if (hotspotFile.exists()) {
ui_->pushButtonHotspotStop->show();
ui_->pushButtonHotspotStart->hide();
ui_->lineEdit_wifimode->setText("Hotspot");
ui_->lineEditWifiSSID->setText(this->hotspotssid);
} else {
ui_->pushButtonHotspotStart->show();
ui_->pushButtonHotspotStop->hide();
ui_->lineEdit_wifimode->setText("Client");
ui_->lineEditWifiSSID->setText(this->wifissid);
}
} }
SettingsWindow::~SettingsWindow() SettingsWindow::~SettingsWindow()
@ -648,7 +668,8 @@ void SettingsWindow::loadSystemValues()
ui_->spinBoxGPIOShutdownDelay->setValue(getparams[29].toInt()); ui_->spinBoxGPIOShutdownDelay->setValue(getparams[29].toInt());
// Wifi Credentials // Wifi Credentials
ui_->lineEditWifiClientSSID->setText(getparams[30]); //ui_->lineEditWifiSSID->setText(getparams[30]);
this->wifissid = getparams[30];
// Wifi Hotspot Credentials // Wifi Hotspot Credentials
if (getparams[31] == "1") { if (getparams[31] == "1") {
@ -657,7 +678,7 @@ void SettingsWindow::loadSystemValues()
ui_->checkBoxHotspot->setChecked(false); ui_->checkBoxHotspot->setChecked(false);
} }
ui_->lineEditWifiHotspotSSID->setText(getparams[32]); this->hotspotssid = getparams[32];
// set cam // set cam
ui_->comboBoxCam->setCurrentText(getparams[33]); ui_->comboBoxCam->setCurrentText(getparams[33]);
@ -724,12 +745,26 @@ void SettingsWindow::onShowBindings()
void SettingsWindow::onStartHotspot() void SettingsWindow::onStartHotspot()
{ {
ui_->label_modeswitchprogress->show();
ui_->pushButtonHotspotStart->hide();
ui_->pushButtonHotspotStop->hide();
ui_->lineEdit_wifimode->setText("");
ui_->lineEdit_wlan0->setText("");
ui_->lineEditWifiSSID->setText("");
system("sudo systemctl start hotspot &"); system("sudo systemctl start hotspot &");
QTimer::singleShot(15000, this, SLOT(updateNetworkInfo()));
} }
void SettingsWindow::onStopHotspot() void SettingsWindow::onStopHotspot()
{ {
ui_->label_modeswitchprogress->show();
ui_->pushButtonHotspotStart->hide();
ui_->pushButtonHotspotStop->hide();
ui_->lineEdit_wifimode->setText("");
ui_->lineEdit_wlan0->setText("");
ui_->lineEditWifiSSID->setText("");
system("sudo systemctl stop hotspot &"); system("sudo systemctl stop hotspot &");
QTimer::singleShot(15000, this, SLOT(updateNetworkInfo()));
} }
void SettingsWindow::show_tab1() void SettingsWindow::show_tab1()
@ -860,3 +895,47 @@ void f1x::openauto::autoapp::ui::SettingsWindow::on_pushButtonAudioTest_clicked(
ui_->pushButtonAudioTest->show(); ui_->pushButtonAudioTest->show();
ui_->labelTestInProgress->hide(); ui_->labelTestInProgress->hide();
} }
void f1x::openauto::autoapp::ui::SettingsWindow::updateNetworkInfo()
{
QNetworkInterface eth0if = QNetworkInterface::interfaceFromName("eth0");
if (eth0if.flags().testFlag(QNetworkInterface::IsUp)) {
QList<QNetworkAddressEntry> entrieseth0 = eth0if.addressEntries();
if (!entrieseth0.isEmpty()) {
QNetworkAddressEntry eth0 = entrieseth0.first();
//qDebug() << "eth0: " << eth0.ip();
ui_->lineEdit_eth0->setText(eth0.ip().toString());
}
} else {
//qDebug() << "eth0: down";
ui_->lineEdit_eth0->setText("interface down");
}
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_->lineEdit_wlan0->setText(wlan0.ip().toString());
}
} else {
//qDebug() << "wlan0: down";
ui_->lineEdit_wlan0->setText("interface down");
}
QFileInfo hotspotFile("/tmp/hotspot_active");
if (hotspotFile.exists()) {
ui_->pushButtonHotspotStop->show();
ui_->pushButtonHotspotStart->hide();
ui_->label_modeswitchprogress->hide();
ui_->lineEdit_wifimode->setText("Hotspot");
ui_->lineEditWifiSSID->setText(this->hotspotssid);
} else {
ui_->pushButtonHotspotStart->show();
ui_->pushButtonHotspotStop->hide();
ui_->label_modeswitchprogress->hide();
ui_->lineEdit_wifimode->setText("Client");
ui_->lineEditWifiSSID->setText(this->wifissid);
}
}

View File

@ -5,6 +5,7 @@
#include <ui_usbdialog.h> #include <ui_usbdialog.h>
#include <libusb.h> #include <libusb.h>
#include <blkid/blkid.h> #include <blkid/blkid.h>
#include <exception>
namespace f1x namespace f1x
{ {
@ -23,6 +24,7 @@ USBDialog::USBDialog(QWidget *parent)
connect(ui_->pushButtonClose, &QPushButton::clicked, this, &USBDialog::close); connect(ui_->pushButtonClose, &QPushButton::clicked, this, &USBDialog::close);
connect(ui_->pushButtonUpdate, &QPushButton::clicked, this, &USBDialog::scanDrives); connect(ui_->pushButtonUpdate, &QPushButton::clicked, this, &USBDialog::scanDrives);
scanDrives(); scanDrives();
ui_->listWidgetUSB->setCurrentRow(0);
} }
USBDialog::~USBDialog() USBDialog::~USBDialog()
@ -97,28 +99,45 @@ void f1x::openauto::autoapp::ui::USBDialog::scanDrives()
currentdevice++; currentdevice++;
} }
system("/usr/local/bin/autoapp_helper cleansymlinks &"); system("/usr/local/bin/autoapp_helper cleansymlinks &");
ui_->listWidgetUSB->setCurrentRow(0);
} }
void f1x::openauto::autoapp::ui::USBDialog::on_pushButtonMount_clicked() void f1x::openauto::autoapp::ui::USBDialog::on_pushButtonMount_clicked()
{ {
QString selected = ui_->listWidgetUSB->item(ui_->listWidgetUSB->currentRow())->text(); QString selected = ui_->listWidgetUSB->item(ui_->listWidgetUSB->currentRow())->text();
QString mountfulldevicepath = selected.split(" ")[0]; if (ui_->listWidgetUSB->count() > 0 && selected.contains("/dev/")) {
QString mountdevice = mountfulldevicepath.split("/")[2]; QString mountfulldevicepath = selected.split(" ")[0];
system(qPrintable("sudo umount -f " + mountfulldevicepath)); QString mountdevice = mountfulldevicepath.split("/")[2];
system(qPrintable("sudo fuser -km /media/USBDRIVES/" + mountdevice));
system(qPrintable("sudo mkdir -p /media/USBDRIVES/" + mountdevice)); system(qPrintable("sudo umount -f " + mountfulldevicepath + " >/dev/null"));
system(qPrintable("sudo chmod 777 /media/USBDRIVES/" + mountdevice)); system(qPrintable("sudo fuser -km /media/USBDRIVES/" + mountdevice + " >/dev/null"));
system(qPrintable("sudo mount " + mountfulldevicepath + " /media/USBDRIVES/" + mountdevice)); system(qPrintable("sudo mkdir -p /media/USBDRIVES/" + mountdevice + " >/dev/null"));
system(qPrintable("ln -s /media/USBDRIVES/" + mountdevice + "/Music/* /media/MYMEDIA")); system(qPrintable("sudo chmod 777 /media/USBDRIVES/" + mountdevice + " >/dev/null"));
scanDrives(); system(qPrintable("sudo mount " + mountfulldevicepath + " /media/USBDRIVES/" + mountdevice + " >/dev/null"));
system(qPrintable("ln -s /media/USBDRIVES/" + mountdevice + "/Music/* /media/MYMEDIA >/dev/null"));
scanDrives();
} else {
QMessageBox errorMessage(QMessageBox::Critical, "Select error", "Nothing selected!", QMessageBox::Ok);
errorMessage.setWindowFlags(Qt::WindowStaysOnTopHint);
errorMessage.exec();
}
ui_->listWidgetUSB->setCurrentRow(0);
} }
void f1x::openauto::autoapp::ui::USBDialog::on_pushButtonRemove_clicked() void f1x::openauto::autoapp::ui::USBDialog::on_pushButtonRemove_clicked()
{ {
QString selected = ui_->listWidgetUSB->item(ui_->listWidgetUSB->currentRow())->text(); QString selected = ui_->listWidgetUSB->item(ui_->listWidgetUSB->currentRow())->text();
QString mountfulldevicepath = selected.split(" ")[0]; if (ui_->listWidgetUSB->count() > 0 && selected.contains("/dev/")) {
QString mountdevice = mountfulldevicepath.split("/")[2]; QString mountfulldevicepath = selected.split(" ")[0];
system(qPrintable("sudo umount -f " + mountfulldevicepath)); QString mountdevice = mountfulldevicepath.split("/")[2];
system(qPrintable("sudo fuser -km /media/USBDRIVES/" + mountdevice));
scanDrives(); system(qPrintable("sudo umount -f " + mountfulldevicepath + " >/dev/null" + " && sudo rmdir /media/USBDRIVES/" + mountdevice + " >/dev/null"));
system(qPrintable("sudo fuser -km /media/USBDRIVES/" + mountdevice + " >/dev/null" + " && sudo rmdir /media/USBDRIVES/" + mountdevice + " >/dev/null"));
scanDrives();
} else {
QMessageBox errorMessage(QMessageBox::Critical, "Select error", "Nothing selected!", QMessageBox::Ok);
errorMessage.setWindowFlags(Qt::WindowStaysOnTopHint);
errorMessage.exec();
}
ui_->listWidgetUSB->setCurrentRow(0);
} }

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1011</width> <width>862</width>
<height>1295</height> <height>1297</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -98,7 +98,7 @@
<item> <item>
<layout class="QHBoxLayout" name="Header"> <layout class="QHBoxLayout" name="Header">
<property name="spacing"> <property name="spacing">
<number>6</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="devlabel_right"> <widget class="QLabel" name="devlabel_right">
@ -183,13 +183,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="styleSheet"> <property name="styleSheet">
@ -212,9 +212,9 @@ color: rgb(255, 255, 255);</string>
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="BuildID"> <widget class="QWidget" name="widget" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -222,128 +222,244 @@ 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"> <layout class="QHBoxLayout" name="horizontalLayout_13">
<font> <property name="spacing">
<pointsize>8</pointsize> <number>0</number>
<weight>75</weight> </property>
<bold>true</bold> <property name="leftMargin">
</font> <number>0</number>
</property> </property>
<property name="styleSheet"> <property name="topMargin">
<string notr="true">background-color: rgba(0, 0, 0, 0); <number>0</number>
color: rgb(255, 255, 255);</string> </property>
</property> <property name="rightMargin">
<property name="text"> <number>0</number>
<string/> </property>
</property> <property name="bottomMargin">
<property name="alignment"> <number>0</number>
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> </property>
</property> <item>
<widget class="QLabel" name="SysinfoTopLeft">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>22</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>22</height>
</size>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(0, 0, 0, 0);
color: rgb(78, 244, 37);</string>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <widget class="QWidget" name="widget" native="true">
<property name="spacing"> <property name="sizePolicy">
<number>6</number> <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<item> <property name="minimumSize">
<widget class="QLabel" name="phoneConnected"> <size>
<property name="sizePolicy"> <width>0</width>
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <height>24</height>
<horstretch>0</horstretch> </size>
<verstretch>0</verstretch> </property>
</sizepolicy> <property name="maximumSize">
</property> <size>
<property name="font"> <width>16777215</width>
<font> <height>24</height>
<weight>75</weight> </size>
<bold>true</bold> </property>
</font> <layout class="QHBoxLayout" name="horizontalLayout_3">
</property> <property name="spacing">
<property name="styleSheet"> <number>0</number>
<string notr="true">background-color: rgba(255, 255, 255, 0); </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="phoneConnected">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(255, 255, 255, 0);
color: rgb(255, 255, 255);</string> color: rgb(255, 255, 255);</string>
</property> </property>
<property name="text"> <property name="text">
<string>USB Connected</string> <string>USB Connected</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="btDevice"> <spacer name="horizontalSpacer_11">
<property name="sizePolicy"> <property name="orientation">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <enum>Qt::Horizontal</enum>
<horstretch>0</horstretch> </property>
<verstretch>0</verstretch> <property name="sizeHint" stdset="0">
</sizepolicy> <size>
</property> <width>10</width>
<property name="font"> <height>10</height>
<font> </size>
<weight>75</weight> </property>
<bold>true</bold> </spacer>
</font> </item>
</property> <item>
<property name="styleSheet"> <widget class="QLabel" name="btDevice">
<string notr="true">background-color: rgba(255, 255, 255, 0); <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(255, 255, 255, 0);
color: rgb(0, 102, 255);</string> color: rgb(0, 102, 255);</string>
</property> </property>
<property name="text"> <property name="text">
<string>BT-Device</string> <string>BT-Device</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pushButtonBluetooth"> <spacer name="horizontalSpacer_13">
<property name="sizePolicy"> <property name="orientation">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred"> <enum>Qt::Horizontal</enum>
<horstretch>0</horstretch> </property>
<verstretch>0</verstretch> <property name="sizeType">
</sizepolicy> <enum>QSizePolicy::Fixed</enum>
</property> </property>
<property name="minimumSize"> <property name="sizeHint" stdset="0">
<size> <size>
<width>80</width> <width>10</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
<property name="maximumSize"> </spacer>
<size> </item>
<width>80</width> <item>
<height>20</height> <widget class="QPushButton" name="pushButtonBluetooth">
</size> <property name="sizePolicy">
</property> <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<property name="baseSize"> <horstretch>0</horstretch>
<size> <verstretch>0</verstretch>
<width>0</width> </sizepolicy>
<height>0</height> </property>
</size> <property name="minimumSize">
</property> <size>
<property name="styleSheet"> <width>80</width>
<string notr="true">background-color: rgb(32, 74, 135); <height>22</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>80</width>
<height>22</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(32, 74, 135);
color: rgb(239, 239, 239); color: rgb(239, 239, 239);
outline: none;</string> outline: none;</string>
</property> </property>
<property name="text"> <property name="text">
<string>BT-Pairing</string> <string>BT-Pairing</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</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> <item>
<widget class="QLabel" name="Digital_clock"> <widget class="QLabel" name="Digital_clock">
@ -2257,78 +2373,6 @@ QScrollBar {
<property name="frame"> <property name="frame">
<bool>true</bool> <bool>true</bool>
</property> </property>
<item>
<property name="text">
<string>Neues Element</string>
</property>
</item>
<item>
<property name="text">
<string>Neues Element</string>
</property>
</item>
<item>
<property name="text">
<string>Neues Element</string>
</property>
</item>
<item>
<property name="text">
<string>Neues Element</string>
</property>
</item>
<item>
<property name="text">
<string>Neues Element</string>
</property>
</item>
<item>
<property name="text">
<string>Neues Element</string>
</property>
</item>
<item>
<property name="text">
<string>Neues Element</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonRescan">
<property name="minimumSize">
<size>
<width>100</width>
<height>45</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>45</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgba(117, 80, 123, 0.9);
color: rgb(0, 0, 0);
border-radius: 4px;
border: 2px solid rgba(255,255,255,0.5);
outline: none;</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset>
<normalon>:/reboot-hot.png</normalon>
</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
@ -2641,6 +2685,19 @@ background-color: rgba(0, 0, 0, 0);</string>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_8"> <layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<widget class="QPushButton" name="pushButtonPlayerPrevAlbum"> <widget class="QPushButton" name="pushButtonPlayerPrevAlbum">
<property name="sizePolicy"> <property name="sizePolicy">
@ -2651,13 +2708,13 @@ background-color: rgba(0, 0, 0, 0);</string>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>90</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>100</width> <width>90</width>
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
@ -2680,6 +2737,19 @@ background-color: rgba(0, 0, 0, 0);</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<widget class="QPushButton" name="pushButtonPlayerPrevBig"> <widget class="QPushButton" name="pushButtonPlayerPrevBig">
<property name="sizePolicy"> <property name="sizePolicy">
@ -2690,13 +2760,13 @@ background-color: rgba(0, 0, 0, 0);</string>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>90</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>100</width> <width>90</width>
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
@ -2719,6 +2789,19 @@ background-color: rgba(0, 0, 0, 0);</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
@ -2919,6 +3002,19 @@ outline: none;</string>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_9"> <layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<widget class="QPushButton" name="pushButtonPlayerNextBig"> <widget class="QPushButton" name="pushButtonPlayerNextBig">
<property name="sizePolicy"> <property name="sizePolicy">
@ -2929,13 +3025,13 @@ outline: none;</string>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>90</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>100</width> <width>90</width>
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
@ -2958,6 +3054,19 @@ outline: none;</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item> <item>
<widget class="QPushButton" name="pushButtonPlayerNextAlbum"> <widget class="QPushButton" name="pushButtonPlayerNextAlbum">
<property name="sizePolicy"> <property name="sizePolicy">
@ -2968,13 +3077,13 @@ outline: none;</string>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>100</width> <width>90</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>100</width> <width>90</width>
<height>16777215</height> <height>16777215</height>
</size> </size>
</property> </property>
@ -2997,6 +3106,19 @@ outline: none;</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
@ -3556,6 +3678,12 @@ outline: none;</string>
<height>30</height> <height>30</height>
</size> </size>
</property> </property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">background-color: rgb(92, 231, 57); <string notr="true">background-color: rgb(92, 231, 57);
color: rgb(0, 0, 0);</string> color: rgb(0, 0, 0);</string>

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>800</width> <width>963</width>
<height>3271</height> <height>3125</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -2206,7 +2206,7 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
<number>2</number> <number>2</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>9</number> <number>2</number>
</property> </property>
<item> <item>
<layout class="QHBoxLayout" name="btsettings"> <layout class="QHBoxLayout" name="btsettings">
@ -2333,84 +2333,10 @@ outline: none;</string>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
</widget> <property name="maximumSize">
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBoxWifiClient">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Wifi client settings</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_35">
<property name="topMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item>
<widget class="QWidget" name="wificlient" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QFormLayout" name="formLayout_34">
<property name="leftMargin">
<number>9</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="labelWifiClientSSID">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Used SSID:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEditWifiClientSSID">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size> <size>
<width>200</width> <width>200</width>
<height>0</height> <height>16777215</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>0</width>
<height>0</height>
</size> </size>
</property> </property>
</widget> </widget>
@ -2426,301 +2352,339 @@ outline: none;</string>
<property name="title"> <property name="title">
<string>Networking</string> <string>Networking</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_5"> <layout class="QGridLayout" name="gridLayout">
<item>
<widget class="QRadioButton" name="radioButton_3">
<property name="text">
<string>No wifi network</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_2">
<property name="text">
<string>wifi client</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton">
<property name="text">
<string>wifi hotspot</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBoxWifiHotspot">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Hotspot settings</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_36">
<property name="topMargin"> <property name="topMargin">
<number>2</number> <number>2</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>9</number> <number>2</number>
</property> </property>
<item> <item row="0" column="0">
<widget class="QWidget" name="wifihotspot" native="true"> <layout class="QFormLayout" name="formLayout_10">
<property name="sizePolicy"> <property name="topMargin">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <number>2</number>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<layout class="QFormLayout" name="formLayout_28"> <property name="bottomMargin">
<property name="leftMargin"> <number>2</number>
<number>9</number> </property>
</property> <item row="0" column="0">
<property name="topMargin"> <widget class="QLabel" name="label_ipeth0">
<number>2</number> <property name="minimumSize">
</property> <size>
<property name="rightMargin"> <width>130</width>
<number>9</number> <height>0</height>
</property> </size>
<property name="bottomMargin"> </property>
<number>2</number> <property name="maximumSize">
</property> <size>
<item row="0" column="0"> <width>130</width>
<widget class="QCheckBox" name="checkBoxHotspot"> <height>16777215</height>
<property name="text"> </size>
<string>Enabled</string> </property>
</property> <property name="text">
</widget> <string>IP-Address (eth0)</string>
</item> </property>
<item row="0" column="1"> </widget>
<widget class="QWidget" name="formWidget" native="true"> </item>
<property name="sizePolicy"> <item row="0" column="1">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <widget class="QLineEdit" name="lineEdit_eth0">
<horstretch>0</horstretch> <property name="minimumSize">
<verstretch>0</verstretch> <size>
</sizepolicy> <width>200</width>
</property> <height>0</height>
<layout class="QFormLayout" name="formLayout_5"> </size>
<property name="topMargin"> </property>
<number>2</number> <property name="maximumSize">
</property> <size>
<item row="0" column="0"> <width>200</width>
<widget class="QLabel" name="label_16"> <height>16777215</height>
<property name="text"> </size>
<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>
</property> </widget>
</widget> </item>
</item> </layout>
<item row="0" column="1"> </item>
<widget class="QLabel" name="labelWifiHotspotNote"> <item row="1" column="1">
<property name="font"> <layout class="QHBoxLayout" name="WifiButtonArea">
<font> <property name="spacing">
<pointsize>10</pointsize> <number>0</number>
<italic>true</italic> </property>
</font> <item>
</property> <widget class="QPushButton" name="pushButtonHotspotStart">
<property name="text"> <property name="sizePolicy">
<string>If enabled Hotspot will start on boot and Start/Stop buttons will work.</string> <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
</property> <horstretch>0</horstretch>
</widget> <verstretch>0</verstretch>
</item> </sizepolicy>
</layout> </property>
</widget> <property name="minimumSize">
</item> <size>
<item row="3" column="0"> <width>0</width>
<widget class="QLabel" name="labelWifiHotspotSSID"> <height>32</height>
<property name="sizePolicy"> </size>
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> </property>
<horstretch>0</horstretch> <property name="maximumSize">
<verstretch>0</verstretch> <size>
</sizepolicy> <width>16777215</width>
</property> <height>32</height>
<property name="minimumSize"> </size>
<size> </property>
<width>100</width> <property name="font">
<height>35</height> <font>
</size> <weight>75</weight>
</property> <bold>true</bold>
<property name="maximumSize"> </font>
<size> </property>
<width>16777215</width> <property name="styleSheet">
<height>35</height> <string notr="true">background-color: rgb(78, 154, 6);
</size>
</property>
<property name="text">
<string>Used SSID:</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QPushButton" name="pushButtonHotspotStart">
<property name="minimumSize">
<size>
<width>100</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>32</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(78, 154, 6);
outline: none;</string> outline: none;</string>
</property> </property>
<property name="text"> <property name="text">
<string>Start</string> <string>Switch to Hotspot Mode</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item>
<widget class="QLabel" name="labelHotspotStart"> <widget class="QPushButton" name="pushButtonHotspotStop">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <sizepolicy hsizetype="Expanding" 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>0</width> <width>0</width>
<height>32</height> <height>32</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>16777215</width> <width>16777215</width>
<height>32</height> <height>32</height>
</size> </size>
</property> </property>
<property name="text"> <property name="font">
<string>Start hotspot mode now. This will exit client mode.</string> <font>
</property> <weight>75</weight>
</widget> <bold>true</bold>
</item> </font>
<item row="5" column="0"> </property>
<widget class="QPushButton" name="pushButtonHotspotStop"> <property name="styleSheet">
<property name="minimumSize"> <string notr="true">background-color: rgb(164, 0, 0);
<size>
<width>100</width>
<height>32</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>32</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(164, 0, 0);
outline: none;</string> outline: none;</string>
</property> </property>
<property name="text"> <property name="text">
<string>Stop</string> <string>Switch to Client Mode</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="1"> <item>
<widget class="QLabel" name="labelHotspotStop"> <widget class="QLabel" name="label_modeswitchprogress">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> <sizepolicy hsizetype="Expanding" 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>0</width> <width>0</width>
<height>32</height> <height>32</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>16777215</width> <width>16777215</width>
<height>32</height> <height>32</height>
</size> </size>
</property> </property>
<property name="text"> <property name="font">
<string>Stop hotspot mode now. This will exit hotspot and reenable wifi client mode.</string> <font>
</property> <weight>75</weight>
</widget> <bold>true</bold>
</item> </font>
<item row="3" column="1"> </property>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <property name="styleSheet">
<item> <string notr="true">background-color: rgb(32, 74, 135);</string>
<widget class="QLineEdit" name="lineEditWifiHotspotSSID"> </property>
<property name="sizePolicy"> <property name="text">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <string>Mode switch in progress ...</string>
<horstretch>0</horstretch> </property>
<verstretch>0</verstretch> <property name="alignment">
</sizepolicy> <set>Qt::AlignCenter</set>
</property> </property>
<property name="minimumSize"> </widget>
<size> </item>
<width>200</width> </layout>
<height>0</height> </item>
</size> <item row="0" column="1">
</property> <layout class="QFormLayout" name="formLayout_9">
</widget> <property name="topMargin">
</item> <number>2</number>
<item> </property>
<widget class="QLabel" name="label_20"> <property name="bottomMargin">
<property name="sizePolicy"> <number>2</number>
<sizepolicy hsizetype="Fixed" vsizetype="Expanding"> </property>
<horstretch>0</horstretch> <item row="0" column="0">
<verstretch>0</verstretch> <widget class="QLabel" name="label_ipwlan0">
</sizepolicy> <property name="sizePolicy">
</property> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<property name="text"> <horstretch>0</horstretch>
<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> <verstretch>0</verstretch>
</property> </sizepolicy>
</widget> </property>
</item> <property name="minimumSize">
<item> <size>
<widget class="QLabel" name="label_19"> <width>140</width>
<property name="sizePolicy"> <height>0</height>
<sizepolicy hsizetype="Expanding" vsizetype="Preferred"> </size>
<horstretch>0</horstretch> </property>
<verstretch>0</verstretch> <property name="maximumSize">
</sizepolicy> <size>
</property> <width>140</width>
<property name="minimumSize"> <height>16777215</height>
<size> </size>
<width>0</width> </property>
<height>35</height> <property name="text">
</size> <string>IP-Address (wlan0)</string>
</property> </property>
<property name="maximumSize"> </widget>
<size> </item>
<width>16777215</width> <item row="0" column="1">
<height>35</height> <widget class="QLineEdit" name="lineEdit_wlan0">
</size> <property name="minimumSize">
</property> <size>
<property name="font"> <width>200</width>
<font> <height>0</height>
<italic>true</italic> </size>
</font> </property>
</property> <property name="maximumSize">
<property name="text"> <size>
<string>The default password is 1234567890 - Change it in /boot/crankshaft/crankshaft_env.sh!</string> <width>200</width>
</property> <height>16777215</height>
<property name="wordWrap"> </size>
<bool>true</bool> </property>
</property> </widget>
</widget> </item>
</item> <item row="1" column="0">
</layout> <widget class="QLabel" name="labelWifiClientSSID">
</item> <property name="minimumSize">
</layout> <size>
</widget> <width>140</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Used SSID:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEditWifiSSID">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>16777215</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_wifimode">
<property name="minimumSize">
<size>
<width>140</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Wifi Mode</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_wifimode">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_23">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>36</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>140</width>
<height>36</height>
</size>
</property>
<property name="text">
<string>Enable Hotspot</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="checkBoxHotspot">
<property name="text">
<string>Yes</string>
</property>
</widget>
</item>
</layout>
</item> </item>
</layout> </layout>
</widget> </widget>

View File

@ -97,8 +97,9 @@ int main(int argc, char* argv[])
mainWindow.setWindowFlags(Qt::WindowStaysOnTopHint); mainWindow.setWindowFlags(Qt::WindowStaysOnTopHint);
autoapp::ui::SettingsWindow settingsWindow(configuration); autoapp::ui::SettingsWindow settingsWindow(configuration);
settingsWindow.setFixedSize(width, height);
settingsWindow.setWindowFlags(Qt::WindowStaysOnTopHint); settingsWindow.setWindowFlags(Qt::WindowStaysOnTopHint);
//settingsWindow.showFullScreen();
settingsWindow.setFixedSize(width, height);
settingsWindow.adjustSize(); settingsWindow.adjustSize();
autoapp::configuration::RecentAddressesList recentAddressesList(7); autoapp::configuration::RecentAddressesList recentAddressesList(7);