keyboard support in main window, esc key in settings
This commit is contained in:
parent
bc04598aee
commit
2592d3a6f8
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,4 +1,7 @@
|
|||||||
# Add any directories, files, or patterns you don't want to be tracked by version control
|
# Add any directories, files, or patterns you don't want to be tracked by version control
|
||||||
lib/
|
lib/
|
||||||
bin/
|
bin/
|
||||||
|
build/
|
||||||
|
.vscode/
|
||||||
|
openauto.ini
|
||||||
CMakeLists.txt.user
|
CMakeLists.txt.user
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QStringListModel>
|
#include <QStringListModel>
|
||||||
|
#include <QKeyEvent>
|
||||||
#include <f1x/aasdk/TCP/ITCPEndpoint.hpp>
|
#include <f1x/aasdk/TCP/ITCPEndpoint.hpp>
|
||||||
#include <f1x/aasdk/TCP/ITCPWrapper.hpp>
|
#include <f1x/aasdk/TCP/ITCPWrapper.hpp>
|
||||||
#include <f1x/openauto/autoapp/Configuration/IRecentAddressesList.hpp>
|
#include <f1x/openauto/autoapp/Configuration/IRecentAddressesList.hpp>
|
||||||
@ -41,6 +42,9 @@ private slots:
|
|||||||
void onRecentAddressClicked(const QModelIndex& index);
|
void onRecentAddressClicked(const QModelIndex& index);
|
||||||
void onUpdateButtonClicked();
|
void onUpdateButtonClicked();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void keyPressEvent(QKeyEvent *event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void insertIpAddress(const std::string& ipAddress);
|
void insertIpAddress(const std::string& ipAddress);
|
||||||
void loadRecentList();
|
void loadRecentList();
|
||||||
|
@ -69,7 +69,7 @@ public:
|
|||||||
~MainWindow() override;
|
~MainWindow() override;
|
||||||
QMediaPlayer* player;
|
QMediaPlayer* player;
|
||||||
QFileSystemWatcher* watcher;
|
QFileSystemWatcher* watcher;
|
||||||
QFileSystemWatcher* watcher_tmp;
|
QFileSystemWatcher* watcher_tmp;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void exit();
|
void exit();
|
||||||
@ -159,8 +159,6 @@ private slots:
|
|||||||
void resetRetryUSBMessage();
|
void resetRetryUSBMessage();
|
||||||
void updateNetworkInfo();
|
void updateNetworkInfo();
|
||||||
bool check_file_exist(const char *filename);
|
bool check_file_exist(const char *filename);
|
||||||
void KeyPress(QString key);
|
|
||||||
|
|
||||||
void hostModeStateChanged(QBluetoothLocalDevice::HostMode);
|
void hostModeStateChanged(QBluetoothLocalDevice::HostMode);
|
||||||
|
|
||||||
//void on_AlbumCoverListView_clicked(const QModelIndex &index);
|
//void on_AlbumCoverListView_clicked(const QModelIndex &index);
|
||||||
@ -276,33 +274,8 @@ private:
|
|||||||
QBluetoothLocalDevice *localDevice;
|
QBluetoothLocalDevice *localDevice;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void keyPressEvent(QKeyEvent *event) override
|
void keyPressEvent(QKeyEvent *event);
|
||||||
{
|
|
||||||
if (event->key() == Qt::Key_C) {
|
|
||||||
MainWindow::KeyPress("C");
|
|
||||||
}
|
|
||||||
if (event->key() == Qt::Key_X) {
|
|
||||||
MainWindow::KeyPress("X");
|
|
||||||
}
|
|
||||||
if (event->key() == Qt::Key_V) {
|
|
||||||
MainWindow::KeyPress("V");
|
|
||||||
}
|
|
||||||
if (event->key() == Qt::Key_N) {
|
|
||||||
MainWindow::KeyPress("N");
|
|
||||||
}
|
|
||||||
if (event->key() == Qt::Key_B) {
|
|
||||||
MainWindow::KeyPress("B");
|
|
||||||
}
|
|
||||||
if (event->key() == Qt::Key_H) {
|
|
||||||
MainWindow::KeyPress("H");
|
|
||||||
}
|
|
||||||
if (event->key() == Qt::Key_A) {
|
|
||||||
MainWindow::KeyPress("A");
|
|
||||||
}
|
|
||||||
if (event->key() == Qt::Key_L) {
|
|
||||||
MainWindow::KeyPress("L");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <f1x/openauto/autoapp/Configuration/IConfiguration.hpp>
|
#include <f1x/openauto/autoapp/Configuration/IConfiguration.hpp>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
#include <QKeyEvent>
|
||||||
#include <sys/sysinfo.h>
|
#include <sys/sysinfo.h>
|
||||||
|
|
||||||
class QCheckBox;
|
class QCheckBox;
|
||||||
@ -49,6 +50,9 @@ public:
|
|||||||
~SettingsWindow() override;
|
~SettingsWindow() override;
|
||||||
void loadSystemValues();
|
void loadSystemValues();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void keyPressEvent(QKeyEvent *event);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void unpairAll();
|
void unpairAll();
|
||||||
void onSave();
|
void onSave();
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
#include <QKeyEvent>
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class UpdateDialog;
|
class UpdateDialog;
|
||||||
@ -40,6 +41,9 @@ private slots:
|
|||||||
void on_pushButtonUpdateCheck_clicked();
|
void on_pushButtonUpdateCheck_clicked();
|
||||||
void on_pushButtonUpdateCancel_clicked();
|
void on_pushButtonUpdateCancel_clicked();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void keyPressEvent(QKeyEvent *event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::UpdateDialog *ui_;
|
Ui::UpdateDialog *ui_;
|
||||||
QFileSystemWatcher* watcher_tmp;
|
QFileSystemWatcher* watcher_tmp;
|
||||||
|
@ -202,6 +202,14 @@ void ConnectDialog::insertIpAddress(const std::string& ipAddress)
|
|||||||
this->loadRecentList();
|
this->loadRecentList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void f1x::openauto::autoapp::ui::ConnectDialog::keyPressEvent(QKeyEvent *event)
|
||||||
|
{
|
||||||
|
if(event->key() == Qt::Key_Escape)
|
||||||
|
{
|
||||||
|
ConnectDialog::close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,6 +86,7 @@ MainWindow::MainWindow(configuration::IConfiguration::Pointer configuration, QWi
|
|||||||
this->wallpaperEQFileExists = check_file_exist("wallpaper-eq.png");
|
this->wallpaperEQFileExists = check_file_exist("wallpaper-eq.png");
|
||||||
|
|
||||||
ui_->setupUi(this);
|
ui_->setupUi(this);
|
||||||
|
|
||||||
connect(ui_->pushButtonSettings, &QPushButton::clicked, this, &MainWindow::openSettings);
|
connect(ui_->pushButtonSettings, &QPushButton::clicked, this, &MainWindow::openSettings);
|
||||||
connect(ui_->pushButtonSettings2, &QPushButton::clicked, this, &MainWindow::openSettings);
|
connect(ui_->pushButtonSettings2, &QPushButton::clicked, this, &MainWindow::openSettings);
|
||||||
connect(ui_->pushButtonUpdate, &QPushButton::clicked, this, &MainWindow::openUpdateDialog);
|
connect(ui_->pushButtonUpdate, &QPushButton::clicked, this, &MainWindow::openUpdateDialog);
|
||||||
@ -779,31 +780,31 @@ void f1x::openauto::autoapp::ui::MainWindow::updateAlpha()
|
|||||||
this->alpha_current_str = value;
|
this->alpha_current_str = value;
|
||||||
double alpha = value/100.0;
|
double alpha = value/100.0;
|
||||||
QString alp=QString::number(alpha);
|
QString alp=QString::number(alpha);
|
||||||
ui_->pushButtonExit->setStyleSheet( "background-color: rgba(164, 0, 0, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
ui_->pushButtonExit->setStyleSheet( "QPushButton{background-color: rgba(164, 0, 0, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButtonShutdown->setStyleSheet( "background-color: rgba(239, 41, 41, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
ui_->pushButtonShutdown->setStyleSheet( "QPushButton{background-color: rgba(239, 41, 41, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButtonReboot->setStyleSheet( "background-color: rgba(252, 175, 62, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
ui_->pushButtonReboot->setStyleSheet( "QPushButton{background-color: rgba(252, 175, 62, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButtonCancel->setStyleSheet( "background-color: rgba(32, 74, 135, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
ui_->pushButtonCancel->setStyleSheet( "QPushButton{background-color: rgba(32, 74, 135, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButtonBrightness->setStyleSheet( "background-color: rgba(245, 121, 0, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
ui_->pushButtonBrightness->setStyleSheet( "QPushButton{background-color: rgba(245, 121, 0, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButtonVolume->setStyleSheet( "background-color: rgba(64, 191, 191, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
ui_->pushButtonVolume->setStyleSheet( "QPushButton{background-color: rgba(64, 191, 191, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButtonLock->setStyleSheet( "background-color: rgba(15, 54, 5, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
ui_->pushButtonLock->setStyleSheet( "QPushButton{background-color: rgba(15, 54, 5, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButtonSettings->setStyleSheet( "background-color: rgba(138, 226, 52, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
ui_->pushButtonSettings->setStyleSheet( "QPushButton{background-color: rgba(138, 226, 52, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButtonDay->setStyleSheet( "background: rgba(252, 233, 79, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
ui_->pushButtonDay->setStyleSheet( "QPushButton{background: rgba(252, 233, 79, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButtonNight->setStyleSheet( "background-color: rgba(114, 159, 207, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
ui_->pushButtonNight->setStyleSheet( "QPushButton{background-color: rgba(114, 159, 207, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButtonCameraShow->setStyleSheet( "background-color: rgba(100, 62, 4, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
ui_->pushButtonCameraShow->setStyleSheet( "QPushButton{background-color: rgba(100, 62, 4, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButtonWifi->setStyleSheet( "background-color: rgba(252, 175, 62, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
ui_->pushButtonWifi->setStyleSheet( "QPushButton{background-color: rgba(252, 175, 62, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButtonToggleGUI->setStyleSheet( "background-color: rgba(237, 164, 255, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
ui_->pushButtonToggleGUI->setStyleSheet( "QPushButton{background-color: rgba(237, 164, 255, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButton_c1->setStyleSheet( "background-color: rgba(" + this->custom_button_color_c1 + ", " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
ui_->pushButton_c1->setStyleSheet( "QPushButton{background-color: rgba(" + this->custom_button_color_c1 + ", " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButton_c2->setStyleSheet( "background-color: rgba(" + this->custom_button_color_c2 + ", " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
ui_->pushButton_c2->setStyleSheet( "QPushButton{background-color: rgba(" + this->custom_button_color_c2 + ", " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButton_c3->setStyleSheet( "background-color: rgba(" + this->custom_button_color_c3 + ", " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
ui_->pushButton_c3->setStyleSheet( "QPushButton{background-color: rgba(" + this->custom_button_color_c3 + ", " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButton_c4->setStyleSheet( "background-color: rgba(" + this->custom_button_color_c4 + ", " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
ui_->pushButton_c4->setStyleSheet( "QPushButton{background-color: rgba(" + this->custom_button_color_c4 + ", " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButton_c5->setStyleSheet( "background-color: rgba(" + this->custom_button_color_c5 + ", " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
ui_->pushButton_c5->setStyleSheet( "QPushButton{background-color: rgba(" + this->custom_button_color_c5 + ", " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButton_c6->setStyleSheet( "background-color: rgba(" + this->custom_button_color_c6 + ", " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
ui_->pushButton_c6->setStyleSheet( "QPushButton{background-color: rgba(" + this->custom_button_color_c6 + ", " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButtonDummy1->setStyleSheet( "background-color: rgba(186, 189, 182, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
ui_->pushButtonDummy1->setStyleSheet( "QPushButton{background-color: rgba(186, 189, 182, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButtonDummy2->setStyleSheet( "background-color: rgba(186, 189, 182, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
ui_->pushButtonDummy2->setStyleSheet( "QPushButton{background-color: rgba(186, 189, 182, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButtonDummy3->setStyleSheet( "background-color: rgba(186, 189, 182, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
ui_->pushButtonDummy3->setStyleSheet( "QPushButton{background-color: rgba(186, 189, 182, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButtonDebug->setStyleSheet( "background-color: rgba(85, 87, 83, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);");
|
ui_->pushButtonDebug->setStyleSheet( "QPushButton{background-color: rgba(85, 87, 83, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButtonMusic->setStyleSheet( "background-color: rgba(78, 154, 6, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
ui_->pushButtonMusic->setStyleSheet( "QPushButton{background-color: rgba(78, 154, 6, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->pushButtonAndroidAuto->setStyleSheet( "background-color: rgba(48, 140, 198, " + alp + " ); border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255); border-bottom: 0px; border-top: 0px;");
|
ui_->pushButtonAndroidAuto->setStyleSheet( "QPushButton{background-color: rgba(48, 140, 198, " + alp + " ); outline-style: dotted; outline-color: #92a8d1; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255); border-bottom: 0px; border-top: 0px;} QPushButton:focus {border: 2px solid rgba(125,125,125,0.5);}");
|
||||||
ui_->labelAndroidAutoBottom->setStyleSheet( "background-color: rgba(48, 140, 198, " + alp + " ); border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255); border-top: 0px;");
|
ui_->labelAndroidAutoBottom->setStyleSheet( "background-color: rgba(48, 140, 198, " + alp + " ); border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255); border-top: 0px;");
|
||||||
ui_->labelAndroidAutoTop->setStyleSheet( "background-color: rgba(48, 140, 198, " + alp + " ); border-top-left-radius: 4px; border-top-right-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255); border-bottom: 0px;");
|
ui_->labelAndroidAutoTop->setStyleSheet( "background-color: rgba(48, 140, 198, " + alp + " ); border-top-left-radius: 4px; border-top-right-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255); border-bottom: 0px;");
|
||||||
ui_->pushButtonNoDevice->setStyleSheet( "background-color: rgba(48, 140, 198, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
ui_->pushButtonNoDevice->setStyleSheet( "background-color: rgba(48, 140, 198, " + alp + " ); border-radius: 4px; border: 2px solid rgba(255,255,255,0.5); color: rgb(255,255,255);");
|
||||||
@ -1655,38 +1656,51 @@ bool f1x::openauto::autoapp::ui::MainWindow::check_file_exist(const char *fileNa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void f1x::openauto::autoapp::ui::MainWindow::KeyPress(QString key)
|
void f1x::openauto::autoapp::ui::MainWindow::keyPressEvent(QKeyEvent *event)
|
||||||
{
|
{
|
||||||
if (configuration_->playerButtonControl()) {
|
if (configuration_->playerButtonControl()) {
|
||||||
if (key == "C") {
|
if (event->key() == Qt::Key_C) {
|
||||||
on_pushButtonPlayerPause_clicked();
|
on_pushButtonPlayerPause_clicked();
|
||||||
}
|
}
|
||||||
if (key == "X") {
|
if (event->key() == Qt::Key_X) {
|
||||||
on_pushButtonPlayerPlayList_clicked();
|
on_pushButtonPlayerPlayList_clicked();
|
||||||
}
|
}
|
||||||
if (key == "V") {
|
if (event->key() == Qt::Key_V) {
|
||||||
on_pushButtonPlayerPrevBig_clicked();
|
on_pushButtonPlayerPrevBig_clicked();
|
||||||
}
|
}
|
||||||
if (key == "N") {
|
if (event->key() == Qt::Key_N) {
|
||||||
on_pushButtonPlayerNextBig_clicked();
|
on_pushButtonPlayerNextBig_clicked();
|
||||||
}
|
}
|
||||||
if (key == "B") {
|
if (event->key() == Qt::Key_B) {
|
||||||
on_pushButtonPlayerPause_clicked();
|
on_pushButtonPlayerPause_clicked();
|
||||||
}
|
}
|
||||||
if (key == "A") {
|
if (event->key() == Qt::Key_H) {
|
||||||
on_pushButtonPlayerPrevAlbum_clicked();
|
|
||||||
}
|
|
||||||
if (key == "L") {
|
|
||||||
on_pushButtonPlayerNextAlbum_clicked();
|
|
||||||
}
|
|
||||||
if (key == "H") {
|
|
||||||
if (ui_->mediaWidget->isVisible() == false) {
|
if (ui_->mediaWidget->isVisible() == false) {
|
||||||
playerShow();
|
playerShow();
|
||||||
} else {
|
} else {
|
||||||
playerHide();
|
playerHide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (event->key() == Qt::Key_A) {
|
||||||
|
on_pushButtonPlayerPrevAlbum_clicked();
|
||||||
|
}
|
||||||
|
if (event->key() == Qt::Key_L) {
|
||||||
|
on_pushButtonPlayerNextAlbum_clicked();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Return) {
|
||||||
|
QApplication::postEvent (QApplication::focusWidget(), new QKeyEvent ( QEvent::KeyPress, Qt::Key_Space, Qt::NoModifier));
|
||||||
|
}
|
||||||
|
if (event->key() == Qt::Key_1) {
|
||||||
|
QApplication::postEvent (QApplication::focusWidget(), new QKeyEvent ( QEvent::KeyPress, Qt::Key_Tab, Qt::ShiftModifier));
|
||||||
|
}
|
||||||
|
if (event->key() == Qt::Key_2) {
|
||||||
|
QApplication::postEvent (QApplication::focusWidget(), new QKeyEvent ( QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier));
|
||||||
|
}
|
||||||
|
if(event->key() == Qt::Key_Escape)
|
||||||
|
{
|
||||||
|
f1x::openauto::autoapp::ui::MainWindow::toggleExit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void f1x::openauto::autoapp::ui::MainWindow::on_AlbumCoverListView_clicked(const QModelIndex &index)
|
void f1x::openauto::autoapp::ui::MainWindow::on_AlbumCoverListView_clicked(const QModelIndex &index)
|
||||||
@ -2154,4 +2168,3 @@ void f1x::openauto::autoapp::ui::MainWindow::tmpChanged()
|
|||||||
}
|
}
|
||||||
updateNetworkInfo();
|
updateNetworkInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1416,3 +1416,11 @@ void f1x::openauto::autoapp::ui::SettingsWindow::on_pushButtonNetwork1_clicked()
|
|||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
system("/usr/local/bin/crankshaft network 1 >/dev/null 2>&1 &");
|
system("/usr/local/bin/crankshaft network 1 >/dev/null 2>&1 &");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void f1x::openauto::autoapp::ui::SettingsWindow::keyPressEvent(QKeyEvent *event)
|
||||||
|
{
|
||||||
|
if(event->key() == Qt::Key_Escape)
|
||||||
|
{
|
||||||
|
f1x::openauto::autoapp::ui::SettingsWindow::close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -202,6 +202,14 @@ void f1x::openauto::autoapp::ui::UpdateDialog::updateCheck()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void f1x::openauto::autoapp::ui::UpdateDialog::keyPressEvent(QKeyEvent *event)
|
||||||
|
{
|
||||||
|
if(event->key() == Qt::Key_Escape)
|
||||||
|
{
|
||||||
|
UpdateDialog::close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -236,7 +236,6 @@ border-radius: 4px;</string>
|
|||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">background-color: rgb(115, 210, 22);
|
<string notr="true">background-color: rgb(115, 210, 22);
|
||||||
color: rgb(0, 0, 0);
|
color: rgb(0, 0, 0);
|
||||||
outline: none;
|
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
</string>
|
</string>
|
||||||
</property>
|
</property>
|
||||||
@ -725,7 +724,6 @@ color: rgb(0, 102, 255);</string>
|
|||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">background-color: rgb(164, 0, 0);
|
<string notr="true">background-color: rgb(164, 0, 0);
|
||||||
color: rgb(239, 239, 239);
|
color: rgb(239, 239, 239);
|
||||||
outline: none;
|
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
</string>
|
</string>
|
||||||
</property>
|
</property>
|
||||||
@ -817,7 +815,6 @@ border-radius: 4px;
|
|||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">background-color: rgb(32, 74, 135);
|
<string notr="true">background-color: rgb(32, 74, 135);
|
||||||
color: rgb(239, 239, 239);
|
color: rgb(239, 239, 239);
|
||||||
outline: none;
|
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
</string>
|
</string>
|
||||||
</property>
|
</property>
|
||||||
@ -1527,7 +1524,6 @@ border-bottom: 0px;</string>
|
|||||||
<string notr="true">background-color: rgba(48, 140, 198, 0.5);
|
<string notr="true">background-color: rgba(48, 140, 198, 0.5);
|
||||||
color: rgb(255, 255, 255);
|
color: rgb(255, 255, 255);
|
||||||
border: 2px solid rgba(255,255,255,0.5);
|
border: 2px solid rgba(255,255,255,0.5);
|
||||||
outline: none;
|
|
||||||
border-top: 0px;
|
border-top: 0px;
|
||||||
border-bottom: 0px;
|
border-bottom: 0px;
|
||||||
</string>
|
</string>
|
||||||
@ -1610,6 +1606,9 @@ outline: none;</string>
|
|||||||
<string>No
|
<string>No
|
||||||
USB Device</string>
|
USB Device</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@ -1649,7 +1648,7 @@ USB Device</string>
|
|||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
border: 2px solid rgba(255,255,255,0.5);
|
border: 2px solid rgba(255,255,255,0.5);
|
||||||
color: rgb(255, 255, 255);
|
color: rgb(255, 255, 255);
|
||||||
outline: none;</string>
|
</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
@ -1692,6 +1691,9 @@ outline: none;</string>
|
|||||||
<string>No
|
<string>No
|
||||||
WiFi Clients</string>
|
WiFi Clients</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::NoFocus</enum>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@ -5519,7 +5521,7 @@ outline: none;</string>
|
|||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">color: rgb(255, 255, 255);
|
<string notr="true">color: rgb(255, 255, 255);
|
||||||
background-color: rgb(164, 0, 0);
|
background-color: rgb(164, 0, 0);
|
||||||
outline: none;</string>
|
</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Muted</string>
|
<string>Muted</string>
|
||||||
@ -5548,8 +5550,7 @@ outline: none;</string>
|
|||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">color: rgb(255, 255, 255);
|
<string notr="true">color: rgb(255, 255, 255);
|
||||||
background-color: #6d6d6d;
|
background-color: #6d6d6d;</string>
|
||||||
outline: none;</string>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Mute</string>
|
<string>Mute</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user