Add "Generate system report" function in Settings

This commit is contained in:
Nicolas Mailloux 2022-02-23 00:22:57 -05:00
parent b4c9abb8a2
commit a742e131db
3 changed files with 293 additions and 232 deletions

View file

@ -31,6 +31,7 @@ settings::settings(QWidget *parent) :
ui->updateBtn->setProperty("type", "borderless"); ui->updateBtn->setProperty("type", "borderless");
ui->resetBtn->setProperty("type", "borderless"); ui->resetBtn->setProperty("type", "borderless");
ui->showSystemInfoBtn->setProperty("type", "borderless"); ui->showSystemInfoBtn->setProperty("type", "borderless");
ui->generateSystemReportBtn->setProperty("type", "borderless");
ui->checkOtaUpdateBtn->setProperty("type", "borderless"); ui->checkOtaUpdateBtn->setProperty("type", "borderless");
ui->previousBtn->setProperty("type", "borderless"); ui->previousBtn->setProperty("type", "borderless");
ui->nextBtn->setProperty("type", "borderless"); ui->nextBtn->setProperty("type", "borderless");
@ -41,6 +42,7 @@ settings::settings(QWidget *parent) :
ui->updateBtn->setStyleSheet("font-size: 9pt"); ui->updateBtn->setStyleSheet("font-size: 9pt");
ui->resetBtn->setStyleSheet("font-size: 9pt"); ui->resetBtn->setStyleSheet("font-size: 9pt");
ui->showSystemInfoBtn->setStyleSheet("font-size: 9pt"); ui->showSystemInfoBtn->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->sleepTimeoutComboBox->setStyleSheet("font-size: 9pt"); ui->sleepTimeoutComboBox->setStyleSheet("font-size: 9pt");
@ -978,3 +980,20 @@ void settings::on_repackBtn_clicked()
quit_restart(); 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;
}
}
}
}

View file

@ -69,6 +69,8 @@ private slots:
void cancelDisableStorageEncryption(); void cancelDisableStorageEncryption();
void on_repackBtn_clicked(); void on_repackBtn_clicked();
void on_generateSystemReportBtn_clicked();
signals: signals:
void showToast(QString messageToDisplay); void showToast(QString messageToDisplay);
void closeIndefiniteToast(); void closeIndefiniteToast();

View file

@ -48,8 +48,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>463</width> <width>442</width>
<height>556</height> <height>580</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="verticalLayout_4">
@ -526,6 +526,124 @@
</property> </property>
<item> <item>
<layout class="QGridLayout" name="gridLayout_10"> <layout class="QGridLayout" name="gridLayout_10">
<item row="25" column="0">
<widget class="QCheckBox" name="enableEncryptedStorageCheckBox">
<property name="text">
<string>Enable</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QCheckBox" name="darkModeCheckBox">
<property name="text">
<string>Enable night mode</string>
</property>
</widget>
</item>
<item row="26" column="0">
<layout class="QGridLayout" name="gridLayout_17">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="1">
<spacer name="horizontalSpacer_14">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="repackLabel">
<property name="text">
<string>Repack</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="repackBtn">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Repack</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="21" column="0">
<widget class="QCheckBox" name="enableLockscreenCheckBox">
<property name="text">
<string>Enable lock screen and passcode</string>
</property>
</widget>
</item>
<item row="28" column="0">
<layout class="QGridLayout" name="gridLayout_18">
<property name="bottomMargin">
<number>0</number>
</property>
</layout>
</item>
<item row="20" column="0">
<widget class="Line" name="line_2">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="12" column="0">
<layout class="QGridLayout" name="gridLayout_12">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Reset this device</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="resetBtn">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Reset</string>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="6" column="0"> <item row="6" column="0">
<widget class="QLabel" name="softwareLabel"> <widget class="QLabel" name="softwareLabel">
<property name="font"> <property name="font">
@ -539,7 +657,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="28" column="0"> <item row="29" column="0">
<spacer name="verticalSpacer_3"> <spacer name="verticalSpacer_3">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
@ -552,82 +670,6 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="23" column="0">
<widget class="Line" name="line_10">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="18" column="0">
<widget class="QLabel" name="securityLabel">
<property name="font">
<font>
<family>Chivo</family>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Security</string>
</property>
</widget>
</item>
<item row="19" column="0">
<widget class="Line" name="line_2">
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="13" column="0">
<layout class="QGridLayout" name="gridLayout_7">
<property name="bottomMargin">
<number>0</number>
</property>
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>System info</string>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="showSystemInfoBtn">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Show</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="8" column="0"> <item row="8" column="0">
<widget class="QCheckBox" name="enableUiScalingCheckBox"> <widget class="QCheckBox" name="enableUiScalingCheckBox">
<property name="text"> <property name="text">
@ -635,20 +677,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="14" column="0"> <item row="22" column="0">
<layout class="QGridLayout" name="checkOtaUpdateGridLayout"> <layout class="QGridLayout" name="gridLayout_13">
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item row="0" column="0">
<widget class="QLabel" name="checkOtaUpdateLabel">
<property name="text">
<string>Check for updates</string>
</property>
</widget>
</item>
<item row="0" column="1"> <item row="0" column="1">
<spacer name="horizontalSpacer_13"> <spacer name="horizontalSpacer_9">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -661,7 +696,7 @@
</spacer> </spacer>
</item> </item>
<item row="0" column="2"> <item row="0" column="2">
<widget class="QPushButton" name="checkOtaUpdateBtn"> <widget class="QPushButton" name="setPasscodeBtn">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>
@ -669,7 +704,14 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Check</string> <string>Set</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="setPasscodeLabel">
<property name="text">
<string>Set a passcode</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -685,10 +727,16 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="10" column="0"> <item row="19" column="0">
<widget class="QCheckBox" name="darkModeCheckBox"> <widget class="QLabel" name="securityLabel">
<property name="font">
<font>
<family>Chivo</family>
<italic>true</italic>
</font>
</property>
<property name="text"> <property name="text">
<string>Enable night mode</string> <string>Security</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -744,13 +792,20 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="21" column="0"> <item row="15" column="0">
<layout class="QGridLayout" name="gridLayout_13"> <layout class="QGridLayout" name="checkOtaUpdateGridLayout">
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item row="0" column="0">
<widget class="QLabel" name="checkOtaUpdateLabel">
<property name="text">
<string>Check for updates</string>
</property>
</widget>
</item>
<item row="0" column="1"> <item row="0" column="1">
<spacer name="horizontalSpacer_9"> <spacer name="horizontalSpacer_13">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -763,7 +818,7 @@
</spacer> </spacer>
</item> </item>
<item row="0" column="2"> <item row="0" column="2">
<widget class="QPushButton" name="setPasscodeBtn"> <widget class="QPushButton" name="checkOtaUpdateBtn">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <weight>75</weight>
@ -771,53 +826,42 @@
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Set</string> <string>Check</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="setPasscodeLabel">
<property name="text">
<string>Set a passcode</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
<item row="27" column="0"> <item row="23" column="0">
<layout class="QGridLayout" name="gridLayout_18"> <widget class="QLabel" name="storageEncryptionLabel">
<property name="bottomMargin">
<number>0</number>
</property>
</layout>
</item>
<item row="12" column="0">
<layout class="QGridLayout" name="gridLayout_12">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Reset this device</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="resetBtn">
<property name="font"> <property name="font">
<font> <font>
<weight>75</weight> <family>Chivo</family>
<bold>true</bold> <italic>true</italic>
</font> </font>
</property> </property>
<property name="text"> <property name="text">
<string>Reset</string> <string>Storage encryption</string>
</property>
</widget>
</item>
<item row="13" column="0">
<layout class="QGridLayout" name="gridLayout_7">
<property name="bottomMargin">
<number>0</number>
</property>
<property name="verticalSpacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>System info</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<spacer name="horizontalSpacer_8"> <spacer name="horizontalSpacer_6">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -829,15 +873,64 @@
</property> </property>
</spacer> </spacer>
</item> </item>
</layout> <item row="0" column="2">
</item> <widget class="QPushButton" name="showSystemInfoBtn">
<item row="20" column="0"> <property name="font">
<widget class="QCheckBox" name="enableLockscreenCheckBox"> <font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text"> <property name="text">
<string>Enable lock screen and passcode</string> <string>Show</string>
</property> </property>
</widget> </widget>
</item> </item>
</layout>
</item>
<item row="18" column="0">
<layout class="QGridLayout" name="gridLayout_14">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="1">
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="updateLabel">
<property name="text">
<string>Update InkBox</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="updateBtn">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Update</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="11" column="0"> <item row="11" column="0">
<layout class="QGridLayout" name="gridLayout_16"> <layout class="QGridLayout" name="gridLayout_16">
<property name="bottomMargin"> <property name="bottomMargin">
@ -907,33 +1000,36 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="22" column="0">
<widget class="QLabel" name="storageEncryptionLabel">
<property name="font">
<font>
<family>Chivo</family>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Storage encryption</string>
</property>
</widget>
</item>
<item row="24" column="0"> <item row="24" column="0">
<widget class="QCheckBox" name="enableEncryptedStorageCheckBox"> <widget class="Line" name="line_10">
<property name="text"> <property name="frameShadow">
<string>Enable</string> <enum>QFrame::Plain</enum>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property> </property>
</widget> </widget>
</item> </item>
<item row="17" column="0"> <item row="14" column="0">
<layout class="QGridLayout" name="gridLayout_14"> <layout class="QGridLayout" name="gridLayout_19">
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item row="0" column="2">
<widget class="QPushButton" name="generateSystemReportBtn">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Generate</string>
</property>
</widget>
</item>
<item row="0" column="1"> <item row="0" column="1">
<spacer name="horizontalSpacer_10"> <spacer name="horizontalSpacer_15">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
@ -946,65 +1042,9 @@
</spacer> </spacer>
</item> </item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="updateLabel"> <widget class="QLabel" name="label_10">
<property name="text"> <property name="text">
<string>Update InkBox</string> <string>Generate system report</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="updateBtn">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Update</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="25" column="0">
<layout class="QGridLayout" name="gridLayout_17">
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="1">
<spacer name="horizontalSpacer_14">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="repackLabel">
<property name="text">
<string>Repack</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="repackBtn">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Repack</string>
</property> </property>
</widget> </widget>
</item> </item>