Rework triggers / usb /network
This commit is contained in:
parent
4e2ebcdd4a
commit
e5c031774e
@ -41,6 +41,7 @@
|
||||
#include <taglib/fileref.h>
|
||||
#include <taglib/tag.h>
|
||||
|
||||
#include <QFileSystemWatcher>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
@ -63,6 +64,8 @@ public:
|
||||
explicit MainWindow(configuration::IConfiguration::Pointer configuration, QWidget *parent = nullptr);
|
||||
~MainWindow() override;
|
||||
QMediaPlayer* player;
|
||||
QFileSystemWatcher* watcher;
|
||||
QFileSystemWatcher* watcher_tmp;
|
||||
|
||||
signals:
|
||||
void exit();
|
||||
@ -137,6 +140,8 @@ private slots:
|
||||
void on_StateChanged(QMediaPlayer::State state);
|
||||
void scanFolders();
|
||||
void scanFiles();
|
||||
void tmpChanged();
|
||||
void setTrigger();
|
||||
|
||||
private:
|
||||
Ui::MainWindow* ui_;
|
||||
@ -223,6 +228,8 @@ private:
|
||||
int currentPlaylistIndex = 0;
|
||||
|
||||
bool background_set = false;
|
||||
|
||||
bool mediacontentchanged = true;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include <QFileDialog>
|
||||
|
||||
class QCheckBox;
|
||||
class QTimer;
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
@ -62,6 +63,7 @@ private slots:
|
||||
void syncNTPTime();
|
||||
void on_pushButtonRescan_clicked();
|
||||
void on_pushButtonAudioTest_clicked();
|
||||
void updateNetworkInfo();
|
||||
|
||||
private slots:
|
||||
void show_tab1();
|
||||
@ -83,6 +85,9 @@ private:
|
||||
|
||||
Ui::SettingsWindow* ui_;
|
||||
configuration::IConfiguration::Pointer configuration_;
|
||||
|
||||
QString hotspotssid;
|
||||
QString wifissid;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -54,7 +54,6 @@ bool RtAudioOutput::open()
|
||||
RtAudio::StreamOptions streamOptions;
|
||||
streamOptions.flags = RTAUDIO_MINIMIZE_LATENCY | RTAUDIO_SCHEDULE_REALTIME;
|
||||
uint32_t bufferFrames = sampleRate_ == 16000 ? 1024 : 2048; //according to the observation of audio packets
|
||||
//dac_->openStream(¶meters, nullptr, RTAUDIO_SINT16, sampleRate_, &bufferFrames, &RtAudioOutput::audioBufferReadHandler, static_cast<void*>(this), &streamOptions);
|
||||
dac_->openStream(¶meters, nullptr, RTAUDIO_SINT16, sampleRate_, &bufferFrames, &RtAudioOutput::audioBufferReadHandler, static_cast<void*>(this), &streamOptions);
|
||||
OPENAUTO_LOG(info) << "[RtAudioOutput] Sample Rate: " << sampleRate_;
|
||||
return audioBuffer_.open(QIODevice::ReadWrite);
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <QFont>
|
||||
#include <QScreen>
|
||||
#include <QRect>
|
||||
#include <QFileSystemWatcher>
|
||||
|
||||
namespace f1x
|
||||
{
|
||||
@ -164,49 +165,21 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
|
||||
connect(ui_->pushButtonMusic2, &QPushButton::clicked, this, &MainWindow::playerShow);
|
||||
connect(ui_->pushButtonBack, &QPushButton::clicked, this, &MainWindow::playerHide);
|
||||
connect(ui_->pushButtonPlayerBack, &QPushButton::clicked, this, &MainWindow::playerHide);
|
||||
connect(ui_->pushButtonUSB, &QPushButton::clicked, this, &MainWindow::openUSBDialog);
|
||||
connect(ui_->pushButtonRescan, &QPushButton::clicked, this, &MainWindow::scanFolders);
|
||||
//connect(ui_->pushButtonUSB, &QPushButton::clicked, this, &MainWindow::openUSBDialog);
|
||||
|
||||
// by default hide bluetooth button on init
|
||||
ui_->pushButtonBluetooth->hide();
|
||||
|
||||
// by default hide media player
|
||||
ui_->mediaWidget->hide();
|
||||
ui_->pushButtonUSB->hide();
|
||||
|
||||
ui_->SysinfoTopLeft->hide();
|
||||
|
||||
QTimer *timer=new QTimer(this);
|
||||
connect(timer, SIGNAL(timeout()),this,SLOT(showTime()));
|
||||
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
|
||||
if (this->cameraButtonForce) {
|
||||
connect(ui_->pushButtonCameraShow, &QPushButton::clicked, this, &MainWindow::cameraShow);
|
||||
@ -571,13 +544,17 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
|
||||
ui_->labelFolderpath->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();
|
||||
ui_->comboBoxAlbum->setCurrentText(QString::fromStdString(configuration->getMp3SubFolder()));
|
||||
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()
|
||||
@ -977,6 +954,7 @@ void f1x::openauto::autoapp::ui::MainWindow::toggleGUI()
|
||||
}
|
||||
}
|
||||
}
|
||||
f1x::openauto::autoapp::ui::MainWindow::tmpChanged();
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::createDebuglog()
|
||||
@ -1006,7 +984,342 @@ void f1x::openauto::autoapp::ui::MainWindow::showTime()
|
||||
if ((time.second() % 2) == 0) {
|
||||
time_text[3] = ' ';
|
||||
time_text[8] = ' ';
|
||||
}
|
||||
ui_->Digital_clock->setText(time_text);
|
||||
ui_->bigClock->setText(time_text);
|
||||
}
|
||||
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_horizontalSliderProgressPlayer_sliderMoved(int position)
|
||||
{
|
||||
player->setPosition(position);
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_horizontalSliderVolumePlayer_sliderMoved(int position)
|
||||
{
|
||||
player->setVolume(position);
|
||||
ui_->volumeValueLabelPlayer->setText(QString::number(position) + "%");
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonList_clicked()
|
||||
{
|
||||
ui_->mp3selectWidget->show();
|
||||
ui_->PlayerPlayingWidget->hide();
|
||||
ui_->pushButtonList->hide();
|
||||
ui_->pushButtonPlayerPlayList->show();
|
||||
ui_->pushButtonBackToPlayer->show();
|
||||
//ui_->pushButtonUSB->show();
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerStop_clicked()
|
||||
{
|
||||
ui_->mp3List->setCurrentRow(playlist->currentIndex());
|
||||
player->stop();
|
||||
ui_->pushButtonBack->setIcon(QPixmap("://coverlogo.png"));
|
||||
ui_->pushButtonPlayerPause->setStyleSheet( "background-color: rgb(233, 185, 110); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(0,0,0);");
|
||||
ui_->mp3selectWidget->show();
|
||||
ui_->PlayerPlayingWidget->hide();
|
||||
ui_->pushButtonBackToPlayer->hide();
|
||||
ui_->pushButtonPlayerPlayList->show();
|
||||
ui_->pushButtonPlayerStop->hide();
|
||||
ui_->pushButtonList->hide();
|
||||
ui_->pushButtonPlayerPause->hide();
|
||||
ui_->playerPositionTime->setText("00:00 / 00:00");
|
||||
ui_->labelCurrentPlaying->setText("");
|
||||
ui_->labelTrack->setText("");
|
||||
//ui_->pushButtonUSB->show();
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerPause_clicked()
|
||||
{
|
||||
{
|
||||
if(player->state() == QMediaPlayer::PlayingState){
|
||||
player->pause();
|
||||
ui_->pushButtonPlayerPause->setStyleSheet( "background-color: rgb(218, 143, 143); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(0,0,0);");
|
||||
}else{
|
||||
ui_->pushButtonPlayerPause->setStyleSheet( "background-color: rgb(233, 185, 110); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(0,0,0);");
|
||||
player->play();
|
||||
player->setPosition(player->position());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_positionChanged(qint64 position)
|
||||
{
|
||||
ui_->horizontalSliderProgressPlayer->setValue(position);
|
||||
|
||||
//Setting the time
|
||||
QString time_elapsed, time_total;
|
||||
|
||||
int total_seconds, total_minutes;
|
||||
|
||||
total_seconds = (player->duration()/1000) % 60;
|
||||
total_minutes = (player->duration()/1000) / 60;
|
||||
|
||||
if(total_minutes >= 60){
|
||||
int total_hours = (total_minutes/60);
|
||||
total_minutes = total_minutes - (total_hours*60);
|
||||
time_total = QString("%1").arg(total_hours, 2,10,QChar('0')) + ':' + QString("%1").arg(total_minutes, 2,10,QChar('0')) + ':' + QString("%1").arg(total_seconds, 2,10,QChar('0'));
|
||||
|
||||
}else{
|
||||
time_total = QString("%1").arg(total_minutes, 2,10,QChar('0')) + ':' + QString("%1").arg(total_seconds, 2,10,QChar('0'));
|
||||
|
||||
}
|
||||
|
||||
//calculate time elapsed
|
||||
int seconds, minutes;
|
||||
|
||||
seconds = (position/1000) % 60;
|
||||
minutes = (position/1000) / 60;
|
||||
|
||||
//if minutes is over 60 then we should really display hours
|
||||
if(minutes >= 60){
|
||||
int hours = (minutes/60);
|
||||
minutes = minutes - (hours*60);
|
||||
time_elapsed = QString("%1").arg(hours, 2,10,QChar('0')) + ':' + QString("%1").arg(minutes, 2,10,QChar('0')) + ':' + QString("%1").arg(seconds, 2,10,QChar('0'));
|
||||
}else{
|
||||
time_elapsed = QString("%1").arg(minutes, 2,10,QChar('0')) + ':' + QString("%1").arg(seconds, 2,10,QChar('0'));
|
||||
}
|
||||
ui_->playerPositionTime->setText(time_elapsed + " / " + time_total);
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_durationChanged(qint64 position)
|
||||
{
|
||||
ui_->horizontalSliderProgressPlayer->setMaximum(position);
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_mp3List_itemClicked(QListWidgetItem *item)
|
||||
{
|
||||
this->selectedMp3file = item->text();
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::metaDataChanged()
|
||||
{
|
||||
QImage img = player->metaData(QMediaMetaData::CoverArtImage).value<QImage>();
|
||||
QImage imgscaled = img.scaled(270,270,Qt::IgnoreAspectRatio);
|
||||
if (!imgscaled.isNull()) {
|
||||
ui_->pushButtonBack->setIcon(QPixmap::fromImage(imgscaled));
|
||||
} else {
|
||||
ui_->pushButtonBack->setIcon(QPixmap("://coverlogo.png"));
|
||||
}
|
||||
|
||||
QString fullpathplaying = player->currentMedia().canonicalUrl().toString();
|
||||
QString filename = QFileInfo(fullpathplaying).fileName();
|
||||
|
||||
try {
|
||||
// use metadata from mp3list widget (prescanned id3 by taglib)
|
||||
if (playlist->currentIndex() != -1 && fullpathplaying != "") {
|
||||
QString currentsong = ui_->mp3List->item(playlist->currentIndex())->text();
|
||||
ui_->labelCurrentPlaying->setText(currentsong);
|
||||
}
|
||||
} catch (...) {
|
||||
// use metadata from player
|
||||
QString AlbumInterpret = player->metaData(QMediaMetaData::AlbumArtist).toString();
|
||||
QString Title = player->metaData(QMediaMetaData::Title).toString();
|
||||
|
||||
if (AlbumInterpret == "" && ui_->comboBoxAlbum->currentText() != ".") {
|
||||
AlbumInterpret = ui_->comboBoxAlbum->currentText();
|
||||
}
|
||||
QString currentPlaying;
|
||||
|
||||
if (AlbumInterpret != "") {
|
||||
currentPlaying.append(AlbumInterpret);
|
||||
}
|
||||
if (Title != "" && AlbumInterpret != "") {
|
||||
currentPlaying.append(" - ");
|
||||
}
|
||||
if (Title != "") {
|
||||
currentPlaying.append(Title);
|
||||
}
|
||||
ui_->labelCurrentPlaying->setText(currentPlaying);
|
||||
}
|
||||
ui_->labelTrack->setText(QString::number(playlist->currentIndex()+1));
|
||||
ui_->labelTrackCount->setText(QString::number(playlist->mediaCount()));
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerPlayList_clicked()
|
||||
{
|
||||
player->setPlaylist(this->playlist);
|
||||
playlist->setCurrentIndex(this->currentPlaylistIndex);
|
||||
player->play();
|
||||
ui_->mp3selectWidget->hide();
|
||||
ui_->PlayerPlayingWidget->show();
|
||||
ui_->pushButtonPlayerPlayList->hide();
|
||||
ui_->pushButtonList->show();
|
||||
ui_->pushButtonBackToPlayer->hide();
|
||||
ui_->pushButtonPlayerStop->show();
|
||||
ui_->pushButtonPlayerPause->setStyleSheet( "background-color: rgb(233, 185, 110); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(0,0,0);");
|
||||
ui_->pushButtonPlayerPause->show();
|
||||
int currentalbum = ui_->comboBoxAlbum->currentIndex();
|
||||
ui_->labelCurrentAlbumIndex->setText(QString::number(currentalbum+1));
|
||||
//ui_->pushButtonUSB->hide();
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_comboBoxAlbum_currentIndexChanged(const QString &arg1)
|
||||
{
|
||||
this->albumfolder = arg1;
|
||||
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()
|
||||
{
|
||||
try {
|
||||
if (this->mediacontentchanged == true) {
|
||||
this->mediacontentchanged = false;
|
||||
int cleaner = ui_->comboBoxAlbum->count();
|
||||
while (cleaner > -1) {
|
||||
ui_->comboBoxAlbum->removeItem(cleaner);
|
||||
cleaner--;
|
||||
}
|
||||
QDir directory(this->musicfolder);
|
||||
QStringList folders = directory.entryList(QStringList() << "*", QDir::AllDirs, QDir::Name);
|
||||
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();
|
||||
}
|
||||
}
|
||||
catch(...) {
|
||||
ui_->SysinfoTopLeft->hide();
|
||||
//timerscan->stop();
|
||||
qDebug() << "Fail in Folderscan";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::scanFiles()
|
||||
{
|
||||
if (this->mediacontentchanged == false) {
|
||||
int cleaner = ui_->mp3List->count();
|
||||
while (cleaner > -1) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
// set playlist
|
||||
this->playlist->addMedia(content);
|
||||
}
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_mp3List_currentRowChanged(int currentRow)
|
||||
{
|
||||
ui_->labelFolderpath->setText(QString::number(currentRow));
|
||||
this->currentPlaylistIndex = currentRow;
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerNextBig_clicked()
|
||||
{
|
||||
playlist->next();
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerPrevBig_clicked()
|
||||
{
|
||||
playlist->previous();
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerPrevAlbum_clicked()
|
||||
{
|
||||
int albumcount = ui_->comboBoxAlbum->count();
|
||||
int currentalbum = ui_->comboBoxAlbum->currentIndex();
|
||||
if (currentalbum >= 1) {
|
||||
currentalbum = currentalbum-1;
|
||||
ui_->comboBoxAlbum->setCurrentIndex(currentalbum);
|
||||
ui_->labelCurrentAlbumIndex->setText(QString::number(currentalbum+1));
|
||||
player->play();
|
||||
} else {
|
||||
currentalbum = albumcount-1;
|
||||
ui_->comboBoxAlbum->setCurrentIndex(currentalbum);
|
||||
ui_->labelCurrentAlbumIndex->setText(QString::number(currentalbum+1));
|
||||
player->play();
|
||||
}
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerNextAlbum_clicked()
|
||||
{
|
||||
int albumcount = ui_->comboBoxAlbum->count();
|
||||
int currentalbum = ui_->comboBoxAlbum->currentIndex();
|
||||
if (currentalbum < albumcount-1) {
|
||||
currentalbum = currentalbum + 1;
|
||||
ui_->comboBoxAlbum->setCurrentIndex(currentalbum);
|
||||
ui_->labelCurrentAlbumIndex->setText(QString::number(currentalbum+1));
|
||||
player->play();
|
||||
} else {
|
||||
currentalbum = 0;
|
||||
ui_->comboBoxAlbum->setCurrentIndex(currentalbum);
|
||||
ui_->labelCurrentAlbumIndex->setText(QString::number(currentalbum+1));
|
||||
player->play();
|
||||
}
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonBackToPlayer_clicked()
|
||||
{
|
||||
ui_->PlayerPlayingWidget->show();
|
||||
ui_->mp3selectWidget->hide();
|
||||
ui_->pushButtonBackToPlayer->hide();
|
||||
ui_->pushButtonPlayerPlayList->hide();
|
||||
ui_->pushButtonList->show();
|
||||
//ui_->pushButtonUSB->hide();
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_StateChanged(QMediaPlayer::State state)
|
||||
{
|
||||
if (state == QMediaPlayer::StoppedState || state == QMediaPlayer::PausedState) {
|
||||
system("rm -f /tmp/media_playing");
|
||||
} else {
|
||||
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()) {
|
||||
@ -1233,7 +1546,6 @@ void f1x::openauto::autoapp::ui::MainWindow::showTime()
|
||||
ui_->pushButtonDummyCamWifi->hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// handle dummys in classic menu
|
||||
int button_count = 0;
|
||||
@ -1265,307 +1577,5 @@ void f1x::openauto::autoapp::ui::MainWindow::showTime()
|
||||
ui_->pushButtonDummyClassic1->show();
|
||||
ui_->pushButtonDummyClassic2->show();
|
||||
}
|
||||
|
||||
ui_->Digital_clock->setText(time_text);
|
||||
ui_->bigClock->setText(time_text);
|
||||
}
|
||||
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_horizontalSliderProgressPlayer_sliderMoved(int position)
|
||||
{
|
||||
player->setPosition(position);
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_horizontalSliderVolumePlayer_sliderMoved(int position)
|
||||
{
|
||||
player->setVolume(position);
|
||||
ui_->volumeValueLabelPlayer->setText(QString::number(position) + "%");
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonList_clicked()
|
||||
{
|
||||
ui_->mp3selectWidget->show();
|
||||
ui_->PlayerPlayingWidget->hide();
|
||||
ui_->pushButtonList->hide();
|
||||
ui_->pushButtonPlayerPlayList->show();
|
||||
ui_->pushButtonBackToPlayer->show();
|
||||
ui_->pushButtonUSB->show();
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerStop_clicked()
|
||||
{
|
||||
ui_->mp3List->setCurrentRow(playlist->currentIndex());
|
||||
player->stop();
|
||||
ui_->pushButtonBack->setIcon(QPixmap("://coverlogo.png"));
|
||||
ui_->pushButtonPlayerPause->setStyleSheet( "background-color: rgb(233, 185, 110); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(0,0,0);");
|
||||
ui_->mp3selectWidget->show();
|
||||
ui_->PlayerPlayingWidget->hide();
|
||||
ui_->pushButtonBackToPlayer->hide();
|
||||
ui_->pushButtonPlayerPlayList->show();
|
||||
ui_->pushButtonPlayerStop->hide();
|
||||
ui_->pushButtonList->hide();
|
||||
ui_->pushButtonPlayerPause->hide();
|
||||
ui_->playerPositionTime->setText("00:00 / 00:00");
|
||||
ui_->labelCurrentPlaying->setText("");
|
||||
ui_->labelTrack->setText("");
|
||||
ui_->pushButtonUSB->show();
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerPause_clicked()
|
||||
{
|
||||
{
|
||||
if(player->state() == QMediaPlayer::PlayingState){
|
||||
player->pause();
|
||||
ui_->pushButtonPlayerPause->setStyleSheet( "background-color: rgb(218, 143, 143); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(0,0,0);");
|
||||
}else{
|
||||
ui_->pushButtonPlayerPause->setStyleSheet( "background-color: rgb(233, 185, 110); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(0,0,0);");
|
||||
player->play();
|
||||
player->setPosition(player->position());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_positionChanged(qint64 position)
|
||||
{
|
||||
ui_->horizontalSliderProgressPlayer->setValue(position);
|
||||
|
||||
//Setting the time
|
||||
QString time_elapsed, time_total;
|
||||
|
||||
int total_seconds, total_minutes;
|
||||
|
||||
total_seconds = (player->duration()/1000) % 60;
|
||||
total_minutes = (player->duration()/1000) / 60;
|
||||
|
||||
if(total_minutes >= 60){
|
||||
int total_hours = (total_minutes/60);
|
||||
total_minutes = total_minutes - (total_hours*60);
|
||||
time_total = QString("%1").arg(total_hours, 2,10,QChar('0')) + ':' + QString("%1").arg(total_minutes, 2,10,QChar('0')) + ':' + QString("%1").arg(total_seconds, 2,10,QChar('0'));
|
||||
|
||||
}else{
|
||||
time_total = QString("%1").arg(total_minutes, 2,10,QChar('0')) + ':' + QString("%1").arg(total_seconds, 2,10,QChar('0'));
|
||||
|
||||
}
|
||||
|
||||
//calculate time elapsed
|
||||
int seconds, minutes;
|
||||
|
||||
seconds = (position/1000) % 60;
|
||||
minutes = (position/1000) / 60;
|
||||
|
||||
//if minutes is over 60 then we should really display hours
|
||||
if(minutes >= 60){
|
||||
int hours = (minutes/60);
|
||||
minutes = minutes - (hours*60);
|
||||
time_elapsed = QString("%1").arg(hours, 2,10,QChar('0')) + ':' + QString("%1").arg(minutes, 2,10,QChar('0')) + ':' + QString("%1").arg(seconds, 2,10,QChar('0'));
|
||||
}else{
|
||||
time_elapsed = QString("%1").arg(minutes, 2,10,QChar('0')) + ':' + QString("%1").arg(seconds, 2,10,QChar('0'));
|
||||
}
|
||||
ui_->playerPositionTime->setText(time_elapsed + " / " + time_total);
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_durationChanged(qint64 position)
|
||||
{
|
||||
ui_->horizontalSliderProgressPlayer->setMaximum(position);
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_mp3List_itemClicked(QListWidgetItem *item)
|
||||
{
|
||||
this->selectedMp3file = item->text();
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::metaDataChanged()
|
||||
{
|
||||
QImage img = player->metaData(QMediaMetaData::CoverArtImage).value<QImage>();
|
||||
QImage imgscaled = img.scaled(270,270,Qt::IgnoreAspectRatio);
|
||||
if (!imgscaled.isNull()) {
|
||||
ui_->pushButtonBack->setIcon(QPixmap::fromImage(imgscaled));
|
||||
} else {
|
||||
ui_->pushButtonBack->setIcon(QPixmap("://coverlogo.png"));
|
||||
}
|
||||
|
||||
QString fullpathplaying = player->currentMedia().canonicalUrl().toString();
|
||||
QString filename = QFileInfo(fullpathplaying).fileName();
|
||||
|
||||
try {
|
||||
// use metadata from mp3list widget (prescanned id3 by taglib)
|
||||
if (playlist->currentIndex() != -1 && fullpathplaying != "") {
|
||||
QString currentsong = ui_->mp3List->item(playlist->currentIndex())->text();
|
||||
ui_->labelCurrentPlaying->setText(currentsong);
|
||||
}
|
||||
} catch (...) {
|
||||
// use metadata from player
|
||||
QString AlbumInterpret = player->metaData(QMediaMetaData::AlbumArtist).toString();
|
||||
QString Title = player->metaData(QMediaMetaData::Title).toString();
|
||||
|
||||
if (AlbumInterpret == "" && ui_->comboBoxAlbum->currentText() != ".") {
|
||||
AlbumInterpret = ui_->comboBoxAlbum->currentText();
|
||||
}
|
||||
QString currentPlaying;
|
||||
|
||||
if (AlbumInterpret != "") {
|
||||
currentPlaying.append(AlbumInterpret);
|
||||
}
|
||||
if (Title != "" && AlbumInterpret != "") {
|
||||
currentPlaying.append(" - ");
|
||||
}
|
||||
if (Title != "") {
|
||||
currentPlaying.append(Title);
|
||||
}
|
||||
ui_->labelCurrentPlaying->setText(currentPlaying);
|
||||
}
|
||||
ui_->labelTrack->setText(QString::number(playlist->currentIndex()+1));
|
||||
ui_->labelTrackCount->setText(QString::number(playlist->mediaCount()));
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerPlayList_clicked()
|
||||
{
|
||||
player->setPlaylist(this->playlist);
|
||||
playlist->setCurrentIndex(this->currentPlaylistIndex);
|
||||
player->play();
|
||||
ui_->mp3selectWidget->hide();
|
||||
ui_->PlayerPlayingWidget->show();
|
||||
ui_->pushButtonPlayerPlayList->hide();
|
||||
ui_->pushButtonList->show();
|
||||
ui_->pushButtonBackToPlayer->hide();
|
||||
ui_->pushButtonPlayerStop->show();
|
||||
ui_->pushButtonPlayerPause->setStyleSheet( "background-color: rgb(233, 185, 110); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(0,0,0);");
|
||||
ui_->pushButtonPlayerPause->show();
|
||||
int currentalbum = ui_->comboBoxAlbum->currentIndex();
|
||||
ui_->labelCurrentAlbumIndex->setText(QString::number(currentalbum+1));
|
||||
ui_->pushButtonUSB->hide();
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_comboBoxAlbum_currentIndexChanged(const QString &arg1)
|
||||
{
|
||||
this->albumfolder = arg1;
|
||||
f1x::openauto::autoapp::ui::MainWindow::scanFiles();
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::scanFolders()
|
||||
{
|
||||
int cleaner = ui_->comboBoxAlbum->count();
|
||||
while (cleaner > -1) {
|
||||
ui_->comboBoxAlbum->removeItem(cleaner);
|
||||
cleaner--;
|
||||
}
|
||||
QDir directory(this->musicfolder);
|
||||
QStringList folders = directory.entryList(QStringList() << "*", QDir::AllDirs, QDir::Name);
|
||||
foreach (QString foldername, folders) {
|
||||
if (foldername != "..") {
|
||||
ui_->comboBoxAlbum->addItem(foldername);
|
||||
ui_->labelAlbumCount->setText(QString::number(ui_->comboBoxAlbum->count()));
|
||||
}
|
||||
}
|
||||
this->currentPlaylistIndex = 0;
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::scanFiles()
|
||||
{
|
||||
int cleaner = ui_->mp3List->count();
|
||||
while (cleaner > -1) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
// set playlist
|
||||
this->playlist->addMedia(content);
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_mp3List_currentRowChanged(int currentRow)
|
||||
{
|
||||
ui_->labelFolderpath->setText(QString::number(currentRow));
|
||||
this->currentPlaylistIndex = currentRow;
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerNextBig_clicked()
|
||||
{
|
||||
playlist->next();
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerPrevBig_clicked()
|
||||
{
|
||||
playlist->previous();
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerPrevAlbum_clicked()
|
||||
{
|
||||
int albumcount = ui_->comboBoxAlbum->count();
|
||||
int currentalbum = ui_->comboBoxAlbum->currentIndex();
|
||||
if (currentalbum >= 1) {
|
||||
currentalbum = currentalbum-1;
|
||||
ui_->comboBoxAlbum->setCurrentIndex(currentalbum);
|
||||
ui_->labelCurrentAlbumIndex->setText(QString::number(currentalbum+1));
|
||||
player->play();
|
||||
} else {
|
||||
currentalbum = albumcount-1;
|
||||
ui_->comboBoxAlbum->setCurrentIndex(currentalbum);
|
||||
ui_->labelCurrentAlbumIndex->setText(QString::number(currentalbum+1));
|
||||
player->play();
|
||||
}
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonPlayerNextAlbum_clicked()
|
||||
{
|
||||
int albumcount = ui_->comboBoxAlbum->count();
|
||||
int currentalbum = ui_->comboBoxAlbum->currentIndex();
|
||||
if (currentalbum < albumcount-1) {
|
||||
currentalbum = currentalbum + 1;
|
||||
ui_->comboBoxAlbum->setCurrentIndex(currentalbum);
|
||||
ui_->labelCurrentAlbumIndex->setText(QString::number(currentalbum+1));
|
||||
player->play();
|
||||
} else {
|
||||
currentalbum = 0;
|
||||
ui_->comboBoxAlbum->setCurrentIndex(currentalbum);
|
||||
ui_->labelCurrentAlbumIndex->setText(QString::number(currentalbum+1));
|
||||
player->play();
|
||||
}
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_pushButtonBackToPlayer_clicked()
|
||||
{
|
||||
ui_->PlayerPlayingWidget->show();
|
||||
ui_->mp3selectWidget->hide();
|
||||
ui_->pushButtonBackToPlayer->hide();
|
||||
ui_->pushButtonPlayerPlayList->hide();
|
||||
ui_->pushButtonList->show();
|
||||
ui_->pushButtonUSB->hide();
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::MainWindow::on_StateChanged(QMediaPlayer::State state)
|
||||
{
|
||||
if (state == QMediaPlayer::StoppedState || state == QMediaPlayer::PausedState) {
|
||||
system("rm -f /tmp/media_playing");
|
||||
} else {
|
||||
system("touch /tmp/media_playing");
|
||||
}
|
||||
//qDebug() << "/tmp changed";
|
||||
}
|
||||
|
@ -23,8 +23,11 @@
|
||||
#include <QFileInfo>
|
||||
#include <QTextStream>
|
||||
#include <string>
|
||||
#include <QTimer>
|
||||
#include <QDateTime>
|
||||
#include <QProcess>
|
||||
#include <QNetworkInterface>
|
||||
#include <QNetworkConfigurationManager>
|
||||
|
||||
namespace f1x
|
||||
{
|
||||
@ -57,11 +60,10 @@ SettingsWindow::SettingsWindow(configuration::IConfiguration::Pointer configurat
|
||||
connect(ui_->horizontalSliderSystemVolume, &QSlider::valueChanged, this, &SettingsWindow::onUpdateSystemVolume);
|
||||
connect(ui_->horizontalSliderSystemCapture, &QSlider::valueChanged, this, &SettingsWindow::onUpdateSystemCapture);
|
||||
connect(ui_->pushButtonHotspotStart, &QPushButton::clicked, this, &SettingsWindow::onStartHotspot);
|
||||
connect(ui_->pushButtonHotspotStart , &QPushButton::clicked, this, &SettingsWindow::close);
|
||||
connect(ui_->pushButtonHotspotStop, &QPushButton::clicked, this, &SettingsWindow::onStopHotspot);
|
||||
connect(ui_->pushButtonHotspotStop , &QPushButton::clicked, this, &SettingsWindow::close);
|
||||
connect(ui_->pushButtonSetTime, &QPushButton::clicked, this, &SettingsWindow::setTime);
|
||||
connect(ui_->pushButtonSetTime, &QPushButton::clicked, this, &SettingsWindow::close);
|
||||
//connect(ui_->pushButtonSetTime, &QPushButton::clicked, [&]() { &SettingsWindow::setTime; &SettingsWindow::close; });
|
||||
connect(ui_->pushButtonNTP, &QPushButton::clicked, this, &SettingsWindow::close);
|
||||
|
||||
// menu
|
||||
@ -73,14 +75,18 @@ SettingsWindow::SettingsWindow(configuration::IConfiguration::Pointer configurat
|
||||
ui_->tab6->hide();
|
||||
ui_->tab7->hide();
|
||||
ui_->tab8->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_->pushButtonTab2, &QPushButton::clicked, this, &SettingsWindow::show_tab2);
|
||||
connect(ui_->pushButtonTab3, &QPushButton::clicked, this, &SettingsWindow::show_tab3);
|
||||
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::updateNetworkInfo);
|
||||
connect(ui_->pushButtonTab6, &QPushButton::clicked, this, &SettingsWindow::show_tab6);
|
||||
connect(ui_->pushButtonTab7, &QPushButton::clicked, this, &SettingsWindow::show_tab7);
|
||||
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");
|
||||
ui_->spinBoxHour->setValue((time_text_hour).toInt());
|
||||
ui_->spinBoxMinute->setValue((time_text_minute).toInt());
|
||||
|
||||
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()
|
||||
@ -648,7 +668,8 @@ void SettingsWindow::loadSystemValues()
|
||||
ui_->spinBoxGPIOShutdownDelay->setValue(getparams[29].toInt());
|
||||
|
||||
// Wifi Credentials
|
||||
ui_->lineEditWifiClientSSID->setText(getparams[30]);
|
||||
//ui_->lineEditWifiSSID->setText(getparams[30]);
|
||||
this->wifissid = getparams[30];
|
||||
|
||||
// Wifi Hotspot Credentials
|
||||
if (getparams[31] == "1") {
|
||||
@ -657,7 +678,7 @@ void SettingsWindow::loadSystemValues()
|
||||
ui_->checkBoxHotspot->setChecked(false);
|
||||
}
|
||||
|
||||
ui_->lineEditWifiHotspotSSID->setText(getparams[32]);
|
||||
this->hotspotssid = getparams[32];
|
||||
|
||||
// set cam
|
||||
ui_->comboBoxCam->setCurrentText(getparams[33]);
|
||||
@ -724,12 +745,26 @@ void SettingsWindow::onShowBindings()
|
||||
|
||||
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 &");
|
||||
QTimer::singleShot(15000, this, SLOT(updateNetworkInfo()));
|
||||
}
|
||||
|
||||
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 &");
|
||||
QTimer::singleShot(15000, this, SLOT(updateNetworkInfo()));
|
||||
}
|
||||
|
||||
void SettingsWindow::show_tab1()
|
||||
@ -860,3 +895,47 @@ void f1x::openauto::autoapp::ui::SettingsWindow::on_pushButtonAudioTest_clicked(
|
||||
ui_->pushButtonAudioTest->show();
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <ui_usbdialog.h>
|
||||
#include <libusb.h>
|
||||
#include <blkid/blkid.h>
|
||||
#include <exception>
|
||||
|
||||
namespace f1x
|
||||
{
|
||||
@ -23,6 +24,7 @@ USBDialog::USBDialog(QWidget *parent)
|
||||
connect(ui_->pushButtonClose, &QPushButton::clicked, this, &USBDialog::close);
|
||||
connect(ui_->pushButtonUpdate, &QPushButton::clicked, this, &USBDialog::scanDrives);
|
||||
scanDrives();
|
||||
ui_->listWidgetUSB->setCurrentRow(0);
|
||||
}
|
||||
|
||||
USBDialog::~USBDialog()
|
||||
@ -97,28 +99,45 @@ void f1x::openauto::autoapp::ui::USBDialog::scanDrives()
|
||||
currentdevice++;
|
||||
}
|
||||
system("/usr/local/bin/autoapp_helper cleansymlinks &");
|
||||
ui_->listWidgetUSB->setCurrentRow(0);
|
||||
}
|
||||
|
||||
void f1x::openauto::autoapp::ui::USBDialog::on_pushButtonMount_clicked()
|
||||
{
|
||||
QString selected = ui_->listWidgetUSB->item(ui_->listWidgetUSB->currentRow())->text();
|
||||
if (ui_->listWidgetUSB->count() > 0 && selected.contains("/dev/")) {
|
||||
QString mountfulldevicepath = selected.split(" ")[0];
|
||||
QString mountdevice = mountfulldevicepath.split("/")[2];
|
||||
system(qPrintable("sudo umount -f " + mountfulldevicepath));
|
||||
system(qPrintable("sudo fuser -km /media/USBDRIVES/" + mountdevice));
|
||||
system(qPrintable("sudo mkdir -p /media/USBDRIVES/" + mountdevice));
|
||||
system(qPrintable("sudo chmod 777 /media/USBDRIVES/" + mountdevice));
|
||||
system(qPrintable("sudo mount " + mountfulldevicepath + " /media/USBDRIVES/" + mountdevice));
|
||||
system(qPrintable("ln -s /media/USBDRIVES/" + mountdevice + "/Music/* /media/MYMEDIA"));
|
||||
|
||||
system(qPrintable("sudo umount -f " + mountfulldevicepath + " >/dev/null"));
|
||||
system(qPrintable("sudo fuser -km /media/USBDRIVES/" + mountdevice + " >/dev/null"));
|
||||
system(qPrintable("sudo mkdir -p /media/USBDRIVES/" + mountdevice + " >/dev/null"));
|
||||
system(qPrintable("sudo chmod 777 /media/USBDRIVES/" + mountdevice + " >/dev/null"));
|
||||
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()
|
||||
{
|
||||
QString selected = ui_->listWidgetUSB->item(ui_->listWidgetUSB->currentRow())->text();
|
||||
if (ui_->listWidgetUSB->count() > 0 && selected.contains("/dev/")) {
|
||||
QString mountfulldevicepath = selected.split(" ")[0];
|
||||
QString mountdevice = mountfulldevicepath.split("/")[2];
|
||||
system(qPrintable("sudo umount -f " + mountfulldevicepath));
|
||||
system(qPrintable("sudo fuser -km /media/USBDRIVES/" + mountdevice));
|
||||
|
||||
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);
|
||||
}
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1011</width>
|
||||
<height>1295</height>
|
||||
<width>862</width>
|
||||
<height>1297</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -98,7 +98,7 @@
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="Header">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="devlabel_right">
|
||||
@ -183,13 +183,13 @@ color: rgb(255, 255, 255);</string>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>22</height>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>22</height>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
@ -212,7 +212,43 @@ color: rgb(255, 255, 255);</string>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="BuildID">
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_13">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="SysinfoTopLeft">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
@ -233,14 +269,14 @@ color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
<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(255, 255, 255);</string>
|
||||
color: rgb(78, 244, 37);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
@ -250,10 +286,44 @@ color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="phoneConnected">
|
||||
@ -281,6 +351,19 @@ color: rgb(255, 255, 255);</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_11">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>10</width>
|
||||
<height>10</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="btDevice">
|
||||
<property name="sizePolicy">
|
||||
@ -307,6 +390,22 @@ color: rgb(0, 102, 255);</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_13">
|
||||
<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>
|
||||
<widget class="QPushButton" name="pushButtonBluetooth">
|
||||
<property name="sizePolicy">
|
||||
@ -318,13 +417,13 @@ color: rgb(0, 102, 255);</string>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>20</height>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>20</height>
|
||||
<height>22</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="baseSize">
|
||||
@ -344,6 +443,23 @@ outline: none;</string>
|
||||
</widget>
|
||||
</item>
|
||||
</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>
|
||||
<widget class="QLabel" name="Digital_clock">
|
||||
@ -2257,78 +2373,6 @@ QScrollBar {
|
||||
<property name="frame">
|
||||
<bool>true</bool>
|
||||
</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>
|
||||
</item>
|
||||
</layout>
|
||||
@ -2641,6 +2685,19 @@ background-color: rgba(0, 0, 0, 0);</string>
|
||||
</item>
|
||||
<item>
|
||||
<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>
|
||||
<widget class="QPushButton" name="pushButtonPlayerPrevAlbum">
|
||||
<property name="sizePolicy">
|
||||
@ -2651,13 +2708,13 @@ background-color: rgba(0, 0, 0, 0);</string>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<width>90</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<width>90</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -2680,6 +2737,19 @@ background-color: rgba(0, 0, 0, 0);</string>
|
||||
</property>
|
||||
</widget>
|
||||
</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>
|
||||
<widget class="QPushButton" name="pushButtonPlayerPrevBig">
|
||||
<property name="sizePolicy">
|
||||
@ -2690,13 +2760,13 @@ background-color: rgba(0, 0, 0, 0);</string>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<width>90</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<width>90</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -2719,6 +2789,19 @@ background-color: rgba(0, 0, 0, 0);</string>
|
||||
</property>
|
||||
</widget>
|
||||
</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>
|
||||
</item>
|
||||
</layout>
|
||||
@ -2919,6 +3002,19 @@ outline: none;</string>
|
||||
</item>
|
||||
<item>
|
||||
<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>
|
||||
<widget class="QPushButton" name="pushButtonPlayerNextBig">
|
||||
<property name="sizePolicy">
|
||||
@ -2929,13 +3025,13 @@ outline: none;</string>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<width>90</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<width>90</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -2958,6 +3054,19 @@ outline: none;</string>
|
||||
</property>
|
||||
</widget>
|
||||
</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>
|
||||
<widget class="QPushButton" name="pushButtonPlayerNextAlbum">
|
||||
<property name="sizePolicy">
|
||||
@ -2968,13 +3077,13 @@ outline: none;</string>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<width>90</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<width>90</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -2997,6 +3106,19 @@ outline: none;</string>
|
||||
</property>
|
||||
</widget>
|
||||
</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>
|
||||
</item>
|
||||
</layout>
|
||||
@ -3556,6 +3678,12 @@ outline: none;</string>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(92, 231, 57);
|
||||
color: rgb(0, 0, 0);</string>
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>3271</height>
|
||||
<width>963</width>
|
||||
<height>3125</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -2206,7 +2206,7 @@ QSlider::groove:horizontal { background: #6d6d6d; height: 32px;}</string>
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>9</number>
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="btsettings">
|
||||
@ -2333,84 +2333,10 @@ outline: none;</string>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</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">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="sizeIncrement">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
@ -2426,114 +2352,182 @@ outline: none;</string>
|
||||
<property name="title">
|
||||
<string>Networking</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_3">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<layout class="QFormLayout" name="formLayout_10">
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_ipeth0">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>130</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>130</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>No wifi network</string>
|
||||
<string>IP-Address (eth0)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton_2">
|
||||
<property name="text">
|
||||
<string>wifi client</string>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_eth0">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButton">
|
||||
<property name="text">
|
||||
<string>wifi hotspot</string>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</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">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>9</number>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="WifiButtonArea">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWidget" name="wifihotspot" native="true">
|
||||
<widget class="QPushButton" name="pushButtonHotspotStart">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_28">
|
||||
<property name="leftMargin">
|
||||
<number>9</number>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="checkBoxHotspot">
|
||||
<property name="text">
|
||||
<string>Enabled</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QWidget" name="formWidget" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_5">
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_16">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><img src=":/ico_info.png"/></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="labelWifiHotspotNote">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
<italic>true</italic>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(78, 154, 6);
|
||||
outline: none;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>If enabled Hotspot will start on boot and Start/Stop buttons will work.</string>
|
||||
<string>Switch to Hotspot Mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButtonHotspotStop">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(164, 0, 0);
|
||||
outline: none;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Switch to Client Mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_modeswitchprogress">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color: rgb(32, 74, 135);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Mode switch in progress ...</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="labelWifiHotspotSSID">
|
||||
<item row="0" column="1">
|
||||
<layout class="QFormLayout" name="formLayout_9">
|
||||
<property name="topMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_ipwlan0">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
@ -2542,14 +2536,49 @@ outline: none;</string>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>35</height>
|
||||
<width>140</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>35</height>
|
||||
<width>140</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>IP-Address (wlan0)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_wlan0">
|
||||
<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="1" column="0">
|
||||
<widget class="QLabel" name="labelWifiClientSSID">
|
||||
<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">
|
||||
@ -2557,106 +2586,8 @@ outline: none;</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>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Start</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="labelHotspotStart">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Start hotspot mode now. This will exit client mode.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QPushButton" name="pushButtonHotspotStop">
|
||||
<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(164, 0, 0);
|
||||
outline: none;</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Stop</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLabel" name="labelHotspotStop">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>32</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Stop hotspot mode now. This will exit hotspot and reenable wifi client mode.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEditWifiHotspotSSID">
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="lineEditWifiSSID">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
@ -2669,58 +2600,91 @@ outline: none;</string>
|
||||
<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>
|
||||
<widget class="QLabel" name="label_20">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
<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><html><head/><body><p><img src=":/ico_info.png"/></p></body></html></string>
|
||||
<string>Wifi Mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_19">
|
||||
<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="Expanding" vsizetype="Preferred">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>35</height>
|
||||
<width>140</width>
|
||||
<height>36</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>35</height>
|
||||
<width>140</width>
|
||||
<height>36</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<italic>true</italic>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>The default password is 1234567890 - Change it in /boot/crankshaft/crankshaft_env.sh!</string>
|
||||
<string>Enable Hotspot</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<item row="3" column="1">
|
||||
<widget class="QCheckBox" name="checkBoxHotspot">
|
||||
<property name="text">
|
||||
<string>Yes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
@ -97,8 +97,9 @@ int main(int argc, char* argv[])
|
||||
mainWindow.setWindowFlags(Qt::WindowStaysOnTopHint);
|
||||
|
||||
autoapp::ui::SettingsWindow settingsWindow(configuration);
|
||||
settingsWindow.setFixedSize(width, height);
|
||||
settingsWindow.setWindowFlags(Qt::WindowStaysOnTopHint);
|
||||
//settingsWindow.showFullScreen();
|
||||
settingsWindow.setFixedSize(width, height);
|
||||
settingsWindow.adjustSize();
|
||||
|
||||
autoapp::configuration::RecentAddressesList recentAddressesList(7);
|
||||
|
Loading…
x
Reference in New Issue
Block a user