mirror of
https://github.com/Quill-OS/quill.git
synced 2024-12-26 07:37:21 -08:00
Implement logger; design language fixes
This commit is contained in:
parent
65639294fe
commit
f652dbddf0
39 changed files with 95 additions and 40 deletions
|
@ -12,7 +12,7 @@ alert::alert(QWidget *parent) :
|
||||||
ui(new Ui::alert)
|
ui(new Ui::alert)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
alert::setFont(QFont("u001"));
|
ui->messageLabel->setFont(QFont("u001"));
|
||||||
|
|
||||||
// Getting the screen's size
|
// Getting the screen's size
|
||||||
float sW = QGuiApplication::screens()[0]->size().width();
|
float sW = QGuiApplication::screens()[0]->size().width();
|
||||||
|
@ -82,9 +82,9 @@ alert::alert(QWidget *parent) :
|
||||||
qApp->quit();
|
qApp->quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->warningLabel->setStyleSheet("QLabel { background-color : black; color : white; font-size: 18pt }");
|
ui->warningLabel->setStyleSheet("QLabel { background-color : black; color : white; font-size: 16pt }");
|
||||||
ui->messageLabel->setStyleSheet("QLabel { background-color : black; color : white; font-size: 10pt }");
|
ui->messageLabel->setStyleSheet("QLabel { background-color : black; color : white; font-size: 10pt }");
|
||||||
ui->securityLabel->setStyleSheet("QLabel { background-color : black; color : white; font-size: 12pt }");
|
ui->securityLabel->setStyleSheet("QLabel { background-color : black; color : white; font-size: 11pt }");
|
||||||
ui->continueBtn->setProperty("type", "borderless");
|
ui->continueBtn->setProperty("type", "borderless");
|
||||||
ui->resetBtn->setProperty("type", "borderless");
|
ui->resetBtn->setProperty("type", "borderless");
|
||||||
ui->continueBtn->setStyleSheet("padding: 20px");
|
ui->continueBtn->setStyleSheet("padding: 20px");
|
||||||
|
|
1
alert.h
1
alert.h
|
@ -14,6 +14,7 @@ class alert : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
explicit alert(QWidget *parent = nullptr);
|
explicit alert(QWidget *parent = nullptr);
|
||||||
~alert();
|
~alert();
|
||||||
bool signatureError = false;
|
bool signatureError = false;
|
||||||
|
|
5
apps.cpp
5
apps.cpp
|
@ -114,6 +114,7 @@ void apps::on_calculatorLaunchBtn_clicked()
|
||||||
void apps::on_koboxAppsOpenButton_clicked()
|
void apps::on_koboxAppsOpenButton_clicked()
|
||||||
{
|
{
|
||||||
koboxAppsDialogWindow = new koboxAppsDialog();
|
koboxAppsDialogWindow = new koboxAppsDialog();
|
||||||
|
connect(koboxAppsDialogWindow, SIGNAL(showToast(QString)), SLOT(showToastNative(QString)));
|
||||||
koboxAppsDialogWindow->setAttribute(Qt::WA_DeleteOnClose);
|
koboxAppsDialogWindow->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
koboxAppsDialogWindow->show();
|
koboxAppsDialogWindow->show();
|
||||||
}
|
}
|
||||||
|
@ -146,3 +147,7 @@ void apps::on_g2048LaunchBtn_clicked()
|
||||||
process.startDetached("2048", QStringList());
|
process.startDetached("2048", QStringList());
|
||||||
qApp->quit();
|
qApp->quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void apps::showToastNative(QString messageToDisplay) {
|
||||||
|
emit showToast(messageToDisplay);
|
||||||
|
}
|
||||||
|
|
3
apps.h
3
apps.h
|
@ -16,6 +16,7 @@ class apps : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
explicit apps(QWidget *parent = nullptr);
|
explicit apps(QWidget *parent = nullptr);
|
||||||
~apps();
|
~apps();
|
||||||
|
|
||||||
|
@ -31,6 +32,7 @@ private slots:
|
||||||
void on_reversiLaunchBtn_clicked();
|
void on_reversiLaunchBtn_clicked();
|
||||||
void refreshScreenNative();
|
void refreshScreenNative();
|
||||||
void on_g2048LaunchBtn_clicked();
|
void on_g2048LaunchBtn_clicked();
|
||||||
|
void showToastNative(QString messageToDisplay);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::apps *ui;
|
Ui::apps *ui;
|
||||||
|
@ -41,6 +43,7 @@ private:
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void refreshScreen();
|
void refreshScreen();
|
||||||
|
void showToast(QString messageToDisplay);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // APPS_H
|
#endif // APPS_H
|
||||||
|
|
|
@ -12,6 +12,7 @@ class bookInfoDialog : public QDialog
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
explicit bookInfoDialog(QWidget *parent = nullptr);
|
explicit bookInfoDialog(QWidget *parent = nullptr);
|
||||||
~bookInfoDialog();
|
~bookInfoDialog();
|
||||||
float sH;
|
float sH;
|
||||||
|
|
|
@ -14,6 +14,7 @@ class brightnessDialog : public QDialog
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
QString checkconfig_str_val;
|
QString checkconfig_str_val;
|
||||||
int oldValue;
|
int oldValue;
|
||||||
int oldWarmthValue;
|
int oldWarmthValue;
|
||||||
|
|
|
@ -12,6 +12,7 @@ class calendarApp : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
explicit calendarApp(QWidget *parent = nullptr);
|
explicit calendarApp(QWidget *parent = nullptr);
|
||||||
~calendarApp();
|
~calendarApp();
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ class dictionaryWidget : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
explicit dictionaryWidget(QWidget *parent = nullptr);
|
explicit dictionaryWidget(QWidget *parent = nullptr);
|
||||||
~dictionaryWidget();
|
~dictionaryWidget();
|
||||||
void dictionaryLookup(std::string word, QString first_letter, int position);
|
void dictionaryLookup(std::string word, QString first_letter, int position);
|
||||||
|
|
|
@ -16,13 +16,9 @@ encryptionManager::encryptionManager(QWidget *parent) :
|
||||||
ui(new Ui::encryptionManager)
|
ui(new Ui::encryptionManager)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->encryptionSetupLabel->setFont(QFont("u001"));
|
|
||||||
ui->successLabel->setFont(QFont("u001"));
|
|
||||||
ui->failureLabel->setFont(QFont("u001"));
|
|
||||||
ui->descriptionLabel->setFont(QFont("u001"));
|
ui->descriptionLabel->setFont(QFont("u001"));
|
||||||
ui->successDescriptionLabel->setFont(QFont("u001"));
|
ui->successDescriptionLabel->setFont(QFont("u001"));
|
||||||
ui->failureDescriptionLabel->setFont(QFont("u001"));
|
ui->failureDescriptionLabel->setFont(QFont("u001"));
|
||||||
ui->warningLabel->setFont(QFont("u001"));
|
|
||||||
ui->warningDescriptionLabel->setFont(QFont("u001"));
|
ui->warningDescriptionLabel->setFont(QFont("u001"));
|
||||||
|
|
||||||
// Stylesheet
|
// Stylesheet
|
||||||
|
@ -31,11 +27,11 @@ encryptionManager::encryptionManager(QWidget *parent) :
|
||||||
this->setStyleSheet(stylesheetFile.readAll());
|
this->setStyleSheet(stylesheetFile.readAll());
|
||||||
stylesheetFile.close();
|
stylesheetFile.close();
|
||||||
|
|
||||||
ui->encryptionSetupLabel->setStyleSheet("font-size: 18pt; font-weight: bold");
|
ui->encryptionSetupLabel->setStyleSheet("font-size: 15pt; font-weight: bold");
|
||||||
ui->descriptionLabel->setStyleSheet("font-size: 10pt");
|
ui->descriptionLabel->setStyleSheet("font-size: 10pt");
|
||||||
ui->successLabel->setStyleSheet("font-size: 18pt; font-weight: bold");
|
ui->successLabel->setStyleSheet("font-size: 15pt; font-weight: bold");
|
||||||
ui->successDescriptionLabel->setStyleSheet("font-size: 10pt");
|
ui->successDescriptionLabel->setStyleSheet("font-size: 10pt");
|
||||||
ui->failureLabel->setStyleSheet("font-size: 18pt; font-weight: bold");
|
ui->failureLabel->setStyleSheet("font-size: 15pt; font-weight: bold");
|
||||||
ui->failureDescriptionLabel->setStyleSheet("font-size: 10pt");
|
ui->failureDescriptionLabel->setStyleSheet("font-size: 10pt");
|
||||||
ui->setupContinueBtn->setStyleSheet("background: lightGrey; border: 3px solid black; color: black; padding: 10px; outline: none; font-size: 10pt; font-weight: bold; border-radius: 10px");
|
ui->setupContinueBtn->setStyleSheet("background: lightGrey; border: 3px solid black; color: black; padding: 10px; outline: none; font-size: 10pt; font-weight: bold; border-radius: 10px");
|
||||||
ui->setupAbortBtn->setStyleSheet("background: lightGrey; border: 3px solid black; color: black; padding: 10px; outline: none; font-size: 10pt; font-weight: bold; border-radius: 10px");
|
ui->setupAbortBtn->setStyleSheet("background: lightGrey; border: 3px solid black; color: black; padding: 10px; outline: none; font-size: 10pt; font-weight: bold; border-radius: 10px");
|
||||||
|
@ -43,7 +39,7 @@ encryptionManager::encryptionManager(QWidget *parent) :
|
||||||
ui->failureContinueBtn->setStyleSheet("background: lightGrey; border: 3px solid black; color: black; padding: 10px; outline: none; font-size: 10pt; font-weight: bold; border-radius: 10px");
|
ui->failureContinueBtn->setStyleSheet("background: lightGrey; border: 3px solid black; color: black; padding: 10px; outline: none; font-size: 10pt; font-weight: bold; border-radius: 10px");
|
||||||
ui->acceptBtn->setStyleSheet("background: lightGrey; border: 3px solid black; color: black; padding: 10px; outline: none; font-size: 10pt; font-weight: bold; border-radius: 10px");
|
ui->acceptBtn->setStyleSheet("background: lightGrey; border: 3px solid black; color: black; padding: 10px; outline: none; font-size: 10pt; font-weight: bold; border-radius: 10px");
|
||||||
ui->usbmsBtn->setStyleSheet("background: lightGrey; border: 3px solid black; color: black; padding: 10px; outline: none; font-size: 10pt; font-weight: bold; border-radius: 10px");
|
ui->usbmsBtn->setStyleSheet("background: lightGrey; border: 3px solid black; color: black; padding: 10px; outline: none; font-size: 10pt; font-weight: bold; border-radius: 10px");
|
||||||
ui->warningLabel->setStyleSheet("font-size: 18pt; font-weight: bold");
|
ui->warningLabel->setStyleSheet("font-size: 15pt; font-weight: bold");
|
||||||
ui->warningDescriptionLabel->setStyleSheet("font-size: 10pt");
|
ui->warningDescriptionLabel->setStyleSheet("font-size: 10pt");
|
||||||
|
|
||||||
// Getting the screen's size
|
// Getting the screen's size
|
||||||
|
@ -259,7 +255,7 @@ void encryptionManager::unlockEncryptedStorage() {
|
||||||
std::string unlockTime_str = to_string(currentEpoch);
|
std::string unlockTime_str = to_string(currentEpoch);
|
||||||
global::encfs::unlockTime = QDateTime::fromTime_t(currentEpoch).toString();
|
global::encfs::unlockTime = QDateTime::fromTime_t(currentEpoch).toString();
|
||||||
QString message = "FATAL: 4 invalid passphrase tries, locking down device until " + global::encfs::unlockTime;
|
QString message = "FATAL: 4 invalid passphrase tries, locking down device until " + global::encfs::unlockTime;
|
||||||
qDebug() << message;
|
log(message, className);
|
||||||
string_writeconfig("/external_root/boot/flags/ENCRYPT_LOCK", unlockTime_str);
|
string_writeconfig("/external_root/boot/flags/ENCRYPT_LOCK", unlockTime_str);
|
||||||
global::encfs::lockdown = true;
|
global::encfs::lockdown = true;
|
||||||
setupMessageBoxRan = true;
|
setupMessageBoxRan = true;
|
||||||
|
@ -328,7 +324,7 @@ void encryptionManager::on_failureContinueBtn_clicked()
|
||||||
|
|
||||||
void encryptionManager::setupFailedAuthenticationMessageBox() {
|
void encryptionManager::setupFailedAuthenticationMessageBox() {
|
||||||
ui->activityWidget->hide();
|
ui->activityWidget->hide();
|
||||||
QMessageBox::critical(this, tr("Invalid argument"), tr("Invalid passphrase. Please try again."));
|
QMessageBox::critical(this, tr("Invalid argument"), tr("<font face='u001'>Invalid passphrase. Please try again.</font>"));
|
||||||
QFile::remove("/external_root/run/encfs_mounted");
|
QFile::remove("/external_root/run/encfs_mounted");
|
||||||
quit_restart();
|
quit_restart();
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ class encryptionManager : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
explicit encryptionManager(QWidget *parent = nullptr);
|
explicit encryptionManager(QWidget *parent = nullptr);
|
||||||
~encryptionManager();
|
~encryptionManager();
|
||||||
bool setupExitWidgetRan = false;
|
bool setupExitWidgetRan = false;
|
||||||
|
|
|
@ -75,8 +75,7 @@
|
||||||
<item row="5" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QLabel" name="descriptionLabel">
|
<widget class="QLabel" name="descriptionLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><font face="u001">Encrypted storage allows you to keep your most important files and data safe from anyone else than you.
|
<string><html><head/><body><p><span style=" font-family:'u001';">Encrypted storage allows you to keep your most important files and data safe from anyone else but you. Would you like to enable it</span><span style=" font-family:'Inter';">?</span></p></body></html></string>
|
||||||
Would you like to enable it</font><font face="Inter">?</font></string>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignCenter</set>
|
<set>Qt::AlignCenter</set>
|
||||||
|
|
12
functions.h
12
functions.h
|
@ -12,6 +12,7 @@
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QRandomGenerator>
|
#include <QRandomGenerator>
|
||||||
|
#include <QDateTime>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
@ -116,6 +117,9 @@ namespace global {
|
||||||
namespace localStorage {
|
namespace localStorage {
|
||||||
inline QStringList searchResultsPaths;
|
inline QStringList searchResultsPaths;
|
||||||
}
|
}
|
||||||
|
namespace logger {
|
||||||
|
inline bool status;
|
||||||
|
}
|
||||||
inline QString systemInfoText;
|
inline QString systemInfoText;
|
||||||
inline bool forbidOpenSearchDialog;
|
inline bool forbidOpenSearchDialog;
|
||||||
inline bool isN705;
|
inline bool isN705;
|
||||||
|
@ -142,6 +146,13 @@ namespace {
|
||||||
int defaultPdfPageWidth;
|
int defaultPdfPageWidth;
|
||||||
int defaultPdfPageHeight;
|
int defaultPdfPageHeight;
|
||||||
bool checked_box = false;
|
bool checked_box = false;
|
||||||
|
void log(QString message, QString className) {
|
||||||
|
if(global::logger::status == true) {
|
||||||
|
QDebug logger = qDebug();
|
||||||
|
logger.noquote();
|
||||||
|
logger << QDateTime::currentDateTime().toString("dd/MM/yyyy @ hh:mm:ss") << "|" << className + ":" << message;
|
||||||
|
}
|
||||||
|
}
|
||||||
bool checkconfig(QString file) {
|
bool checkconfig(QString file) {
|
||||||
if(QFile::exists(file)) {
|
if(QFile::exists(file)) {
|
||||||
QFile config(file);
|
QFile config(file);
|
||||||
|
@ -690,7 +701,6 @@ namespace {
|
||||||
}
|
}
|
||||||
return exitCode;
|
return exitCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // FUNCTIONS_H
|
#endif // FUNCTIONS_H
|
||||||
|
|
|
@ -650,13 +650,13 @@ void generalDialog::syncGutenbergCatalog() {
|
||||||
connect(syncCheckTimer, &QTimer::timeout, [&]() {
|
connect(syncCheckTimer, &QTimer::timeout, [&]() {
|
||||||
if(QFile::exists("/inkbox/gutenbergSyncDone") == true) {
|
if(QFile::exists("/inkbox/gutenbergSyncDone") == true) {
|
||||||
if(checkconfig("/inkbox/gutenbergSyncDone") == true) {
|
if(checkconfig("/inkbox/gutenbergSyncDone") == true) {
|
||||||
qDebug() << "Gutenberg sync successfully completed";
|
log("Gutenberg sync successfully completed", className);
|
||||||
gutenbergSyncDone = true;
|
gutenbergSyncDone = true;
|
||||||
gutenbergSyncStatus = true;
|
gutenbergSyncStatus = true;
|
||||||
emit closeIndefiniteToast();
|
emit closeIndefiniteToast();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qDebug() << "Gutenberg sync encountered an error";
|
log("Gutenberg sync encountered an error", className);
|
||||||
gutenbergSyncDone = true;
|
gutenbergSyncDone = true;
|
||||||
gutenbergSyncStatus = false;
|
gutenbergSyncStatus = false;
|
||||||
emit closeIndefiniteToast();
|
emit closeIndefiniteToast();
|
||||||
|
|
|
@ -22,6 +22,7 @@ class generalDialog : public QDialog
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
explicit generalDialog(QWidget *parent = nullptr);
|
explicit generalDialog(QWidget *parent = nullptr);
|
||||||
~generalDialog();
|
~generalDialog();
|
||||||
bool resetDialog = false;
|
bool resetDialog = false;
|
||||||
|
|
|
@ -12,6 +12,7 @@ class hourglassAnimationWidget : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
explicit hourglassAnimationWidget(QWidget *parent = nullptr);
|
explicit hourglassAnimationWidget(QWidget *parent = nullptr);
|
||||||
~hourglassAnimationWidget();
|
~hourglassAnimationWidget();
|
||||||
int i;
|
int i;
|
||||||
|
|
|
@ -90,8 +90,8 @@ void koboxAppsDialog::on_launchBtn_clicked()
|
||||||
{
|
{
|
||||||
index = ui->appsList->currentIndex();
|
index = ui->appsList->currentIndex();
|
||||||
itemText = index.data(Qt::DisplayRole).toString();
|
itemText = index.data(Qt::DisplayRole).toString();
|
||||||
if(itemText == "") {
|
if(itemText.isEmpty()) {
|
||||||
QMessageBox::critical(this, tr("Invalid argument"), tr("Please select an application."));
|
emit showToast("Please select an application");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// DPI setting
|
// DPI setting
|
||||||
|
|
|
@ -15,6 +15,7 @@ class koboxAppsDialog : public QDialog
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
explicit koboxAppsDialog(QWidget *parent = nullptr);
|
explicit koboxAppsDialog(QWidget *parent = nullptr);
|
||||||
~koboxAppsDialog();
|
~koboxAppsDialog();
|
||||||
|
|
||||||
|
@ -30,6 +31,9 @@ private slots:
|
||||||
void on_cancelBtn_clicked();
|
void on_cancelBtn_clicked();
|
||||||
void on_launchBtn_clicked();
|
void on_launchBtn_clicked();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void showToast(QString messageToDisplay);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::koboxAppsDialog *ui;
|
Ui::koboxAppsDialog *ui;
|
||||||
usbms_splash *usbmsSplashWindow;
|
usbms_splash *usbmsSplashWindow;
|
||||||
|
|
|
@ -15,6 +15,7 @@ class koboxSettings : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
explicit koboxSettings(QWidget *parent = nullptr);
|
explicit koboxSettings(QWidget *parent = nullptr);
|
||||||
~koboxSettings();
|
~koboxSettings();
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ class libraryWidget : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
explicit libraryWidget(QWidget *parent = nullptr);
|
explicit libraryWidget(QWidget *parent = nullptr);
|
||||||
~libraryWidget();
|
~libraryWidget();
|
||||||
float sH;
|
float sH;
|
||||||
|
|
7
main.cpp
7
main.cpp
|
@ -32,6 +32,13 @@
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
global::deviceID = readFile("/opt/inkbox_device");
|
global::deviceID = readFile("/opt/inkbox_device");
|
||||||
|
|
||||||
|
if(char * debug = std::getenv("DEBUG")) {
|
||||||
|
if(std::atoi(debug) == 1) {
|
||||||
|
global::logger::status = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setDefaultWorkDir();
|
setDefaultWorkDir();
|
||||||
if(checkconfig(".config/18-encrypted_storage/status") == true and checkconfig("/external_root/run/encfs_mounted") == false) {
|
if(checkconfig(".config/18-encrypted_storage/status") == true and checkconfig("/external_root/run/encfs_mounted") == false) {
|
||||||
// Open Encryption Manager to unlock encrypted storage
|
// Open Encryption Manager to unlock encrypted storage
|
||||||
|
|
|
@ -314,7 +314,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qDebug() << "Warning! Battery is at a critical charge level!";
|
log("Warning! Battery is at a critical charge level!", className);
|
||||||
openCriticalBatteryAlertWindow();
|
openCriticalBatteryAlertWindow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -334,7 +334,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qDebug() << "Warning! Battery is low!";
|
log("Warning! Battery is low!", className);
|
||||||
openLowBatteryDialog();
|
openLowBatteryDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -662,6 +662,7 @@ void MainWindow::on_appsBtn_clicked()
|
||||||
// Create widget
|
// Create widget
|
||||||
appsWindow = new apps();
|
appsWindow = new apps();
|
||||||
connect(appsWindow, SIGNAL(refreshScreen()), SLOT(refreshScreen()));
|
connect(appsWindow, SIGNAL(refreshScreen()), SLOT(refreshScreen()));
|
||||||
|
connect(appsWindow, SIGNAL(showToast(QString)), SLOT(showToast(QString)));
|
||||||
ui->stackedWidget->insertWidget(1, appsWindow);
|
ui->stackedWidget->insertWidget(1, appsWindow);
|
||||||
global::mainwindow::tabSwitcher::appsWidgetCreated = true;
|
global::mainwindow::tabSwitcher::appsWidgetCreated = true;
|
||||||
|
|
||||||
|
@ -1029,7 +1030,7 @@ void MainWindow::showToast(QString messageToDisplay) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::hello(int testNumber) {
|
void MainWindow::hello(int testNumber) {
|
||||||
qDebug() << "Hello" << testNumber;
|
log("Hello" + QString::number(testNumber), className);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::closeIndefiniteToast() {
|
void MainWindow::closeIndefiniteToast() {
|
||||||
|
@ -1079,11 +1080,11 @@ void MainWindow::checkForUpdate() {
|
||||||
if(checkconfig("/mnt/onboard/onboard/.inkbox/can_update") == true) {
|
if(checkconfig("/mnt/onboard/onboard/.inkbox/can_update") == true) {
|
||||||
if(checkconfig("/tmp/cancelUpdateDialog") == false) {
|
if(checkconfig("/tmp/cancelUpdateDialog") == false) {
|
||||||
// I'm sorry.
|
// I'm sorry.
|
||||||
qDebug() << "An update is available.";
|
log("An update is available.", className);
|
||||||
QTimer::singleShot(2000, this, SLOT(openUpdateDialog()));
|
QTimer::singleShot(2000, this, SLOT(openUpdateDialog()));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qDebug() << "Not showing update dialog, user dismissed it...";
|
log("Not showing update dialog, user dismissed it ...", className);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,7 @@ class MainWindow : public QMainWindow
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
MainWindow(QWidget *parent = nullptr);
|
MainWindow(QWidget *parent = nullptr);
|
||||||
~MainWindow();
|
~MainWindow();
|
||||||
|
|
||||||
|
|
|
@ -13,18 +13,18 @@ otaManager::otaManager(QWidget *parent) :
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
QThread::msleep(500);
|
QThread::msleep(500);
|
||||||
if(global::otaUpdate::downloadOta == false) {
|
if(global::otaUpdate::downloadOta == false) {
|
||||||
qDebug() << "Checking for available OTA update ...";
|
log("Checking for available OTA update ...", className);
|
||||||
string_writeconfig("/opt/ibxd", "ota_update_check\n");
|
string_writeconfig("/opt/ibxd", "ota_update_check\n");
|
||||||
QTimer * otaCheckTimer = new QTimer(this);
|
QTimer * otaCheckTimer = new QTimer(this);
|
||||||
otaCheckTimer->setInterval(100);
|
otaCheckTimer->setInterval(100);
|
||||||
connect(otaCheckTimer, &QTimer::timeout, [&]() {
|
connect(otaCheckTimer, &QTimer::timeout, [&]() {
|
||||||
if(QFile::exists("/run/can_ota_update") == true) {
|
if(QFile::exists("/run/can_ota_update") == true) {
|
||||||
if(checkconfig("/run/can_ota_update") == true) {
|
if(checkconfig("/run/can_ota_update") == true) {
|
||||||
qDebug() << "OTA update is available!";
|
log("OTA update is available!", className);
|
||||||
emit canOtaUpdate(true);
|
emit canOtaUpdate(true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qDebug() << "No OTA update available.";
|
log("No OTA update available.", className);
|
||||||
emit canOtaUpdate(false);
|
emit canOtaUpdate(false);
|
||||||
}
|
}
|
||||||
unsigned long currentEpoch = QDateTime::currentSecsSinceEpoch();
|
unsigned long currentEpoch = QDateTime::currentSecsSinceEpoch();
|
||||||
|
@ -35,7 +35,7 @@ otaManager::otaManager(QWidget *parent) :
|
||||||
otaCheckTimer->start();
|
otaCheckTimer->start();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qDebug() << "Downloading OTA update ...";
|
log("Downloading OTA update ...", className);
|
||||||
QFile::remove("/run/can_install_ota_update");
|
QFile::remove("/run/can_install_ota_update");
|
||||||
string_writeconfig("/opt/ibxd", "ota_update_download\n");
|
string_writeconfig("/opt/ibxd", "ota_update_download\n");
|
||||||
QTimer * otaDownloadTimer = new QTimer(this);
|
QTimer * otaDownloadTimer = new QTimer(this);
|
||||||
|
@ -43,12 +43,12 @@ otaManager::otaManager(QWidget *parent) :
|
||||||
connect(otaDownloadTimer, &QTimer::timeout, [&]() {
|
connect(otaDownloadTimer, &QTimer::timeout, [&]() {
|
||||||
if(QFile::exists("/run/can_install_ota_update") == true) {
|
if(QFile::exists("/run/can_install_ota_update") == true) {
|
||||||
if(checkconfig("/run/can_install_ota_update") == true) {
|
if(checkconfig("/run/can_install_ota_update") == true) {
|
||||||
qDebug() << "Download succeeded.";
|
log("Download succeeded.", className);
|
||||||
emit downloadedOtaUpdate(true);
|
emit downloadedOtaUpdate(true);
|
||||||
global::otaUpdate::downloadOta = false;
|
global::otaUpdate::downloadOta = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qDebug() << "Download failed.";
|
log("Download failed.", className);
|
||||||
emit downloadedOtaUpdate(false);
|
emit downloadedOtaUpdate(false);
|
||||||
global::otaUpdate::downloadOta = false;
|
global::otaUpdate::downloadOta = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ class otaManager : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
explicit otaManager(QWidget *parent = nullptr);
|
explicit otaManager(QWidget *parent = nullptr);
|
||||||
~otaManager();
|
~otaManager();
|
||||||
|
|
||||||
|
|
1
quit.h
1
quit.h
|
@ -14,6 +14,7 @@ class quit : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
explicit quit(QWidget *parent = nullptr);
|
explicit quit(QWidget *parent = nullptr);
|
||||||
~quit();
|
~quit();
|
||||||
|
|
||||||
|
|
|
@ -219,7 +219,7 @@ reader::reader(QWidget *parent) :
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
qDebug() << "Reader: Opening file" << book_file;
|
log("Opening file '" + book_file + "'", className);
|
||||||
|
|
||||||
// Writing book path to file
|
// Writing book path to file
|
||||||
std::string book_file_str = book_file.toStdString();
|
std::string book_file_str = book_file.toStdString();
|
||||||
|
@ -697,7 +697,7 @@ reader::reader(QWidget *parent) :
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(isBatteryCritical() == true) {
|
if(isBatteryCritical() == true) {
|
||||||
qDebug() << "Warning! Battery is at a critical charge level!";
|
log("Warning! Battery is at a critical charge level!", className);
|
||||||
openCriticalBatteryAlertWindow();
|
openCriticalBatteryAlertWindow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -716,7 +716,7 @@ reader::reader(QWidget *parent) :
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qDebug() << "Warning! Battery is low!";
|
log("Warning! Battery is low!", className);
|
||||||
openLowBatteryDialog();
|
openLowBatteryDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
1
reader.h
1
reader.h
|
@ -46,6 +46,7 @@ class reader : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
explicit reader(QWidget *parent = nullptr);
|
explicit reader(QWidget *parent = nullptr);
|
||||||
~reader();
|
~reader();
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ class savedwords : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
explicit savedwords(QWidget *parent = nullptr);
|
explicit savedwords(QWidget *parent = nullptr);
|
||||||
~savedwords();
|
~savedwords();
|
||||||
QString words;
|
QString words;
|
||||||
|
|
|
@ -14,6 +14,7 @@ class searchResultsWidget : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
explicit searchResultsWidget(QWidget *parent = nullptr);
|
explicit searchResultsWidget(QWidget *parent = nullptr);
|
||||||
~searchResultsWidget();
|
~searchResultsWidget();
|
||||||
void setListViewContents(QStringList searchResults);
|
void setListViewContents(QStringList searchResults);
|
||||||
|
|
|
@ -55,7 +55,7 @@ settings::settings(QWidget *parent) :
|
||||||
ui->generateSystemReportBtn->setStyleSheet("font-size: 9pt");
|
ui->generateSystemReportBtn->setStyleSheet("font-size: 9pt");
|
||||||
ui->checkOtaUpdateBtn->setStyleSheet("font-size: 9pt");
|
ui->checkOtaUpdateBtn->setStyleSheet("font-size: 9pt");
|
||||||
ui->comboBox->setStyleSheet("font-size: 9pt");
|
ui->comboBox->setStyleSheet("font-size: 9pt");
|
||||||
ui->tzComboBox->setStyleSheet("font-size: 9pt");
|
ui->tzComboBox->setStyleSheet("font-size: 8.5pt");
|
||||||
ui->sleepTimeoutComboBox->setStyleSheet("font-size: 9pt");
|
ui->sleepTimeoutComboBox->setStyleSheet("font-size: 9pt");
|
||||||
ui->setPasscodeBtn->setStyleSheet("font-size: 9pt");
|
ui->setPasscodeBtn->setStyleSheet("font-size: 9pt");
|
||||||
ui->repackBtn->setStyleSheet("font-size: 9pt");
|
ui->repackBtn->setStyleSheet("font-size: 9pt");
|
||||||
|
|
|
@ -19,6 +19,7 @@ class settings : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
int settings_page = 1;
|
int settings_page = 1;
|
||||||
bool launch_sh = false;
|
bool launch_sh = false;
|
||||||
bool ui_enable_changed = false;
|
bool ui_enable_changed = false;
|
||||||
|
|
|
@ -15,6 +15,7 @@ class settingsChooser : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
explicit settingsChooser(QWidget *parent = nullptr);
|
explicit settingsChooser(QWidget *parent = nullptr);
|
||||||
~settingsChooser();
|
~settingsChooser();
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ class textwidget : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
explicit textwidget(QWidget *parent = nullptr);
|
explicit textwidget(QWidget *parent = nullptr);
|
||||||
~textwidget();
|
~textwidget();
|
||||||
|
|
||||||
|
|
1
toast.h
1
toast.h
|
@ -14,6 +14,7 @@ class toast : public QDialog
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
explicit toast(QWidget *parent = nullptr);
|
explicit toast(QWidget *parent = nullptr);
|
||||||
~toast();
|
~toast();
|
||||||
void centerToast();
|
void centerToast();
|
||||||
|
|
|
@ -13,6 +13,7 @@ usbms_splash::usbms_splash(QWidget *parent) :
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
usbms_splash::setFont(QFont("u001"));
|
usbms_splash::setFont(QFont("u001"));
|
||||||
|
ui->label->setFont(QFont("Inter"));
|
||||||
|
|
||||||
// Getting the screen's size
|
// Getting the screen's size
|
||||||
sW = QGuiApplication::screens()[0]->size().width();
|
sW = QGuiApplication::screens()[0]->size().width();
|
||||||
|
@ -29,8 +30,9 @@ usbms_splash::usbms_splash(QWidget *parent) :
|
||||||
this->setStyleSheet(stylesheetFile.readAll());
|
this->setStyleSheet(stylesheetFile.readAll());
|
||||||
stylesheetFile.close();
|
stylesheetFile.close();
|
||||||
|
|
||||||
|
ui->label->setFont(QFont("Inter"));
|
||||||
ui->label->setText("Launching KoBox subsystem");
|
ui->label->setText("Launching KoBox subsystem");
|
||||||
ui->label->setStyleSheet("font-size: 14pt");
|
ui->label->setStyleSheet("font-size: 14pt; font-weight: bold");
|
||||||
ui->label_3->setText("Please wait, this could take a while.");
|
ui->label_3->setText("Please wait, this could take a while.");
|
||||||
if(global::deviceID == "n905\n") {
|
if(global::deviceID == "n905\n") {
|
||||||
ui->label_3->setStyleSheet("font-size: 11pt");
|
ui->label_3->setStyleSheet("font-size: 11pt");
|
||||||
|
@ -48,7 +50,7 @@ usbms_splash::usbms_splash(QWidget *parent) :
|
||||||
float stdIconHeight = sH / 1.15;
|
float stdIconHeight = sH / 1.15;
|
||||||
|
|
||||||
this->setStyleSheet("background-color:black;");
|
this->setStyleSheet("background-color:black;");
|
||||||
ui->label->setStyleSheet("QLabel { background-color : black; color : white; font-size: 15pt }");
|
ui->label->setStyleSheet("QLabel { background-color : black; color : white; font-size: 15pt; font-weight: bold }");
|
||||||
ui->label_3->setStyleSheet("QLabel { background-color : black; color : white; font-size: 10pt }");
|
ui->label_3->setStyleSheet("QLabel { background-color : black; color : white; font-size: 10pt }");
|
||||||
|
|
||||||
QPixmap pixmap(":/resources/usbms.png");
|
QPixmap pixmap(":/resources/usbms.png");
|
||||||
|
@ -64,6 +66,7 @@ usbms_splash::usbms_splash(QWidget *parent) :
|
||||||
|
|
||||||
void usbms_splash::usbms_launch()
|
void usbms_splash::usbms_launch()
|
||||||
{
|
{
|
||||||
|
log("Entering USBMS session ...", className);
|
||||||
string_writeconfig("/tmp/in_usbms", "true");
|
string_writeconfig("/tmp/in_usbms", "true");
|
||||||
QTimer::singleShot(1500, this, SLOT(brightnessDown()));
|
QTimer::singleShot(1500, this, SLOT(brightnessDown()));
|
||||||
|
|
||||||
|
@ -114,13 +117,15 @@ void usbms_splash::usbms_launch()
|
||||||
qApp->quit();
|
qApp->quit();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qDebug() << "Exiting USBMS session...";
|
log("Exiting USBMS session ...", className);
|
||||||
ui->label->setText("Processing content");
|
// '<font/>' bit: because nothing else works ...
|
||||||
|
ui->label->setText("<font face='Inter'>Processing content</font>");
|
||||||
|
ui->label->setFont(QFont("Inter"));
|
||||||
ui->label_3->setText("Please wait");
|
ui->label_3->setText("Please wait");
|
||||||
|
ui->label_3->setFont(QFont("u001"));
|
||||||
ui->label->setStyleSheet("QLabel { background-color : black; color : white; font-size: 15pt; font-weight: bold }");
|
ui->label->setStyleSheet("QLabel { background-color : black; color : white; font-size: 15pt; font-weight: bold }");
|
||||||
ui->label_3->setStyleSheet("QLabel { background-color : black; color : white; font-size: 11pt }");
|
ui->label_3->setStyleSheet("QLabel { background-color : black; color : white; font-size: 11pt }");
|
||||||
ui->label->setFont(QFont("u001"));
|
ui->label->setFont(QFont("u001"));
|
||||||
ui->label_3->setFont(QFont("u001"));
|
|
||||||
|
|
||||||
float stdIconWidth = sW / 2;
|
float stdIconWidth = sW / 2;
|
||||||
float stdIconHeight = sH / 2;
|
float stdIconHeight = sH / 2;
|
||||||
|
@ -181,6 +186,7 @@ void usbms_splash::restartServices() {
|
||||||
// Checking for updates
|
// Checking for updates
|
||||||
string_writeconfig("/opt/ibxd", "update_inkbox_restart\n");
|
string_writeconfig("/opt/ibxd", "update_inkbox_restart\n");
|
||||||
QThread::msleep(2500);
|
QThread::msleep(2500);
|
||||||
|
string_writeconfig("/tmp/in_usbms", "false");
|
||||||
|
|
||||||
quit_restart();
|
quit_restart();
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ class usbms_splash : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
explicit usbms_splash(QWidget *parent = nullptr);
|
explicit usbms_splash(QWidget *parent = nullptr);
|
||||||
~usbms_splash();
|
~usbms_splash();
|
||||||
float sW;
|
float sW;
|
||||||
|
|
|
@ -13,6 +13,7 @@ class virtualkeyboard : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
explicit virtualkeyboard(QWidget *parent = nullptr);
|
explicit virtualkeyboard(QWidget *parent = nullptr);
|
||||||
~virtualkeyboard();
|
~virtualkeyboard();
|
||||||
bool shift;
|
bool shift;
|
||||||
|
|
|
@ -13,6 +13,7 @@ class virtualkeypad : public QWidget
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
explicit virtualkeypad(QWidget *parent = nullptr);
|
explicit virtualkeypad(QWidget *parent = nullptr);
|
||||||
~virtualkeypad();
|
~virtualkeypad();
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ class wifiDialog : public QDialog
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
QString className = this->metaObject()->className();
|
||||||
explicit wifiDialog(QWidget *parent = nullptr);
|
explicit wifiDialog(QWidget *parent = nullptr);
|
||||||
~wifiDialog();
|
~wifiDialog();
|
||||||
QString wifiNetworksList;
|
QString wifiNetworksList;
|
||||||
|
|
Loading…
Reference in a new issue