From c5ec3f35605c33fdc6ccec7f5a4aaa632fff78ea Mon Sep 17 00:00:00 2001 From: Nicolas Mailloux Date: Sat, 18 Jun 2022 10:05:03 -0400 Subject: [PATCH] GUI user applications: small fixes --- apps.cpp | 9 +++++++-- apps.h | 1 + userapps.cpp | 2 ++ userapps.ui | 40 +++++++++++++++++++++++++--------------- 4 files changed, 35 insertions(+), 17 deletions(-) diff --git a/apps.cpp b/apps.cpp index 19fb1ab..1c86248 100644 --- a/apps.cpp +++ b/apps.cpp @@ -317,7 +317,7 @@ void apps::showUserApps(bool showDisabledJson) emit clearAppsLayout(); if(jsonParseSuccess == true) { - QString function = __func__; log(function + ": JSON is valid", className); + QString function = __func__; log(function + ": Main user applications' JSON is valid", className); QJsonArray jsonListArray = jsonDocument.object()["list"].toArray(); for(QJsonValueRef refJsonObject: jsonListArray) { QJsonObject appInfo = refJsonObject.toObject(); @@ -335,7 +335,8 @@ void apps::showUserApps(bool showDisabledJson) } } else { - QString function = __func__; log(function + ": JSON is invalid", className); + QString function = __func__; log(function + ": Main user applications' JSON file is invalid", className); + QTimer::singleShot(500, this, SLOT(showFailedToParseMainUserAppsJsonFile())); ui->editUserAppsBtn->deleteLater(); ui->label_6->deleteLater(); @@ -350,3 +351,7 @@ void apps::updateJsonFileSlot(QJsonDocument jsonDocumentFunc) jsonDocument = jsonDocumentFunc; emit updateJsonFileSignal(jsonDocument); } + +void apps::showFailedToParseMainUserAppsJsonFile() { + emit showToast("Failed to parse 'apps.json'"); +} diff --git a/apps.h b/apps.h index aee4fa5..fc63e79 100644 --- a/apps.h +++ b/apps.h @@ -39,6 +39,7 @@ private slots: bool parseJson(); void showUserApps(bool showDisabledJson); void updateJsonFileSlot(QJsonDocument jsonDocument); + void showFailedToParseMainUserAppsJsonFile(); private: Ui::apps *ui; diff --git a/userapps.cpp b/userapps.cpp index 353865d..e3a4d21 100644 --- a/userapps.cpp +++ b/userapps.cpp @@ -14,6 +14,8 @@ userapps::userapps(QWidget *parent) : ui->launchBtn->setProperty("type", "borderless"); ui->iconBtn->setProperty("type", "borderless"); + ui->iconBtn->setStyleSheet("QPushButton[type='borderless']:pressed { background: white; color: white; border: none; }"); + ui->infoBtn->setProperty("type", "borderless"); ui->statusBtn->setProperty("type", "borderless"); ui->statusBtn->setStyleSheet("background: lightGrey; font-size: 9pt; padding: 8px"); diff --git a/userapps.ui b/userapps.ui index 506029a..4de0403 100644 --- a/userapps.ui +++ b/userapps.ui @@ -138,23 +138,33 @@ - - - - 0 - 0 - + + + 5 - - - 40 - 40 - + + 5 - - - - + + + + + 0 + 0 + + + + + 40 + 40 + + + + + + + +