From a742e131db4412e18b9d3fa68f99d64d43e114db Mon Sep 17 00:00:00 2001 From: Nicolas Mailloux Date: Wed, 23 Feb 2022 00:22:57 -0500 Subject: [PATCH] Add "Generate system report" function in Settings --- settings.cpp | 19 ++ settings.h | 2 + settings.ui | 504 +++++++++++++++++++++++++++------------------------ 3 files changed, 293 insertions(+), 232 deletions(-) diff --git a/settings.cpp b/settings.cpp index 149f12d..e45274a 100644 --- a/settings.cpp +++ b/settings.cpp @@ -31,6 +31,7 @@ settings::settings(QWidget *parent) : ui->updateBtn->setProperty("type", "borderless"); ui->resetBtn->setProperty("type", "borderless"); ui->showSystemInfoBtn->setProperty("type", "borderless"); + ui->generateSystemReportBtn->setProperty("type", "borderless"); ui->checkOtaUpdateBtn->setProperty("type", "borderless"); ui->previousBtn->setProperty("type", "borderless"); ui->nextBtn->setProperty("type", "borderless"); @@ -41,6 +42,7 @@ settings::settings(QWidget *parent) : ui->updateBtn->setStyleSheet("font-size: 9pt"); ui->resetBtn->setStyleSheet("font-size: 9pt"); ui->showSystemInfoBtn->setStyleSheet("font-size: 9pt"); + ui->generateSystemReportBtn->setStyleSheet("font-size: 9pt"); ui->checkOtaUpdateBtn->setStyleSheet("font-size: 9pt"); ui->comboBox->setStyleSheet("font-size: 9pt"); ui->sleepTimeoutComboBox->setStyleSheet("font-size: 9pt"); @@ -978,3 +980,20 @@ void settings::on_repackBtn_clicked() quit_restart(); } } + +void settings::on_generateSystemReportBtn_clicked() +{ + string_writeconfig("/opt/ibxd", "generate_system_report\n"); + while(true) { + if(QFile::exists("/inkbox/systemReportDone")) { + if(checkconfig("/inkbox/systemReportDone") == true) { + emit showToast("System report generated successfully"); + break; + } + else { + emit showToast("Error in generating system report"); + break; + } + } + } +} diff --git a/settings.h b/settings.h index d426fbd..9acc77c 100644 --- a/settings.h +++ b/settings.h @@ -69,6 +69,8 @@ private slots: void cancelDisableStorageEncryption(); void on_repackBtn_clicked(); + void on_generateSystemReportBtn_clicked(); + signals: void showToast(QString messageToDisplay); void closeIndefiniteToast(); diff --git a/settings.ui b/settings.ui index 6591f8d..8cf3887 100644 --- a/settings.ui +++ b/settings.ui @@ -48,8 +48,8 @@ 0 0 - 463 - 556 + 442 + 580 @@ -526,6 +526,124 @@ + + + + Enable + + + + + + + Enable night mode + + + + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Repack + + + + + + + + 75 + true + + + + Repack + + + + + + + + + Enable lock screen and passcode + + + + + + + 0 + + + + + + + QFrame::Plain + + + Qt::Horizontal + + + + + + + 0 + + + + + Reset this device + + + + + + + + 75 + true + + + + Reset + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + @@ -539,7 +657,7 @@ - + Qt::Vertical @@ -552,82 +670,6 @@ - - - - QFrame::Plain - - - Qt::Horizontal - - - - - - - - Chivo - true - - - - Security - - - - - - - QFrame::Plain - - - Qt::Horizontal - - - - - - - 0 - - - 0 - - - - - System info - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 75 - true - - - - Show - - - - - @@ -635,20 +677,13 @@ - - + + 0 - - - - Check for updates - - - - + Qt::Horizontal @@ -661,7 +696,7 @@ - + 75 @@ -669,7 +704,14 @@ - Check + Set + + + + + + + Set a passcode @@ -685,10 +727,16 @@ - - + + + + + Chivo + true + + - Enable night mode + Security @@ -744,13 +792,20 @@ - - + + 0 + + + + Check for updates + + + - + Qt::Horizontal @@ -763,7 +818,7 @@ - + 75 @@ -771,73 +826,111 @@ - Set - - - - - - - Set a passcode + Check - - - - 0 + + + + + Chivo + true + - - - - - - 0 - - - - - Reset this device - - - - - - - - 75 - true - - - - Reset - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - Enable lock screen and passcode + Storage encryption + + + + 0 + + + 0 + + + + + System info + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 75 + true + + + + Show + + + + + + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Update InkBox + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 75 + true + + + + Update + + + + + @@ -907,33 +1000,36 @@ - - - - - Chivo - true - - - - Storage encryption - - - - - - Enable + + + QFrame::Plain + + + Qt::Horizontal - - + + 0 + + + + + 75 + true + + + + Generate + + + - + Qt::Horizontal @@ -946,65 +1042,9 @@ - + - Update InkBox - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - - 75 - true - - - - Update - - - - - - - - - 0 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Repack - - - - - - - - 75 - true - - - - Repack + Generate system report