mirror of
https://github.com/Quill-OS/quill.git
synced 2024-12-28 08:37:22 -08:00
Added failed software update splash
This commit is contained in:
parent
dd65339e6c
commit
8e9cdaac5a
3 changed files with 178 additions and 96 deletions
20
alert.cpp
20
alert.cpp
|
@ -28,6 +28,13 @@ alert::alert(QWidget *parent) :
|
||||||
this->setStyleSheet(stylesheetFile.readAll());
|
this->setStyleSheet(stylesheetFile.readAll());
|
||||||
stylesheetFile.close();
|
stylesheetFile.close();
|
||||||
|
|
||||||
|
// Checking if the update signature was bad
|
||||||
|
if(checkconfig("/external_root/boot/flags/ALERT_SIGN") == true) {
|
||||||
|
ui->securityLabel->setText("Failed to install update.");
|
||||||
|
ui->messageLabel->setText("The update's digital signature is untrusted. For security reasons, it is not possible to install it.");
|
||||||
|
ui->stackedWidget->setCurrentIndex(1);
|
||||||
|
}
|
||||||
|
|
||||||
ui->warningLabel->setStyleSheet("QLabel { background-color : black; color : white; font-size: 16pt}");
|
ui->warningLabel->setStyleSheet("QLabel { background-color : black; color : white; font-size: 16pt}");
|
||||||
ui->messageLabel->setStyleSheet("QLabel { background-color : black; color : white; font-size: 9pt}");
|
ui->messageLabel->setStyleSheet("QLabel { background-color : black; color : white; font-size: 9pt}");
|
||||||
ui->securityLabel->setStyleSheet("QLabel { background-color : black; color : white; font-size: 11pt}");
|
ui->securityLabel->setStyleSheet("QLabel { background-color : black; color : white; font-size: 11pt}");
|
||||||
|
@ -35,6 +42,8 @@ alert::alert(QWidget *parent) :
|
||||||
ui->resetBtn->setProperty("type", "borderless");
|
ui->resetBtn->setProperty("type", "borderless");
|
||||||
ui->continueBtn->setStyleSheet("padding: 20px");
|
ui->continueBtn->setStyleSheet("padding: 20px");
|
||||||
ui->resetBtn->setStyleSheet("padding: 20px");
|
ui->resetBtn->setStyleSheet("padding: 20px");
|
||||||
|
ui->continue2Btn->setProperty("type", "borderless");
|
||||||
|
ui->continue2Btn->setStyleSheet("padding: 20px");
|
||||||
}
|
}
|
||||||
|
|
||||||
alert::~alert()
|
alert::~alert()
|
||||||
|
@ -46,6 +55,7 @@ void alert::on_continueBtn_clicked()
|
||||||
{
|
{
|
||||||
// We continue anyway and re-set the ALERT flag
|
// We continue anyway and re-set the ALERT flag
|
||||||
string_writeconfig("/external_root/boot/flags/ALERT", "false");
|
string_writeconfig("/external_root/boot/flags/ALERT", "false");
|
||||||
|
string_writeconfig("/external_root/boot/flags/ALERT_SIGN", "false");
|
||||||
QProcess process;
|
QProcess process;
|
||||||
process.startDetached("inkbox", QStringList());
|
process.startDetached("inkbox", QStringList());
|
||||||
qApp->quit();
|
qApp->quit();
|
||||||
|
@ -63,3 +73,13 @@ void alert::on_resetBtn_clicked()
|
||||||
reboot_proc->start(reboot_prog, reboot_args);
|
reboot_proc->start(reboot_prog, reboot_args);
|
||||||
reboot_proc->waitForFinished();
|
reboot_proc->waitForFinished();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void alert::on_continue2Btn_clicked()
|
||||||
|
{
|
||||||
|
// We continue anyway and re-set the ALERT flag
|
||||||
|
string_writeconfig("/external_root/boot/flags/ALERT", "false");
|
||||||
|
string_writeconfig("/external_root/boot/flags/ALERT_SIGN", "false");
|
||||||
|
QProcess process;
|
||||||
|
process.startDetached("inkbox", QStringList());
|
||||||
|
qApp->quit();
|
||||||
|
}
|
||||||
|
|
18
alert.h
18
alert.h
|
@ -4,6 +4,8 @@
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <QFile>
|
||||||
|
#include <QTextStream>
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class alert;
|
class alert;
|
||||||
|
@ -24,12 +26,28 @@ public:
|
||||||
fhandler << config_option;
|
fhandler << config_option;
|
||||||
fhandler.close();
|
fhandler.close();
|
||||||
}
|
}
|
||||||
|
bool checkconfig(QString file) {
|
||||||
|
QFile config(file);
|
||||||
|
config.open(QIODevice::ReadOnly);
|
||||||
|
QTextStream in (&config);
|
||||||
|
const QString content = in.readAll();
|
||||||
|
string contentstr = content.toStdString();
|
||||||
|
if(contentstr.find("true") != std::string::npos) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
config.close();
|
||||||
|
};
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_continueBtn_clicked();
|
void on_continueBtn_clicked();
|
||||||
|
|
||||||
void on_resetBtn_clicked();
|
void on_resetBtn_clicked();
|
||||||
|
|
||||||
|
void on_continue2Btn_clicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::alert *ui;
|
Ui::alert *ui;
|
||||||
};
|
};
|
||||||
|
|
170
alert.ui
170
alert.ui
|
@ -16,19 +16,6 @@
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="2" column="0">
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="warningLabel">
|
<widget class="QLabel" name="warningLabel">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
|
@ -45,6 +32,55 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="alertIconLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Alert Icon</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<spacer name="verticalSpacer_3">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="0">
|
||||||
|
<spacer name="verticalSpacer_4">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="4" column="0">
|
||||||
<spacer name="verticalSpacer_2">
|
<spacer name="verticalSpacer_2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -58,23 +94,16 @@
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="9" column="0">
|
<item row="5" column="0">
|
||||||
<spacer name="verticalSpacer_5">
|
<widget class="QLabel" name="securityLabel">
|
||||||
<property name="orientation">
|
<property name="font">
|
||||||
<enum>Qt::Vertical</enum>
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QLabel" name="alertIconLabel">
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Alert Icon</string>
|
<string>The security policy was violated.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignCenter</set>
|
<set>Qt::AlignCenter</set>
|
||||||
|
@ -82,6 +111,25 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="0">
|
<item row="8" column="0">
|
||||||
|
<widget class="QStackedWidget" name="stackedWidget">
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="page">
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
|
@ -114,31 +162,30 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="7" column="0">
|
</layout>
|
||||||
<spacer name="verticalSpacer_4">
|
</widget>
|
||||||
<property name="orientation">
|
<widget class="QWidget" name="page_2">
|
||||||
<enum>Qt::Vertical</enum>
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
</property>
|
<item>
|
||||||
<property name="sizeHint" stdset="0">
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<spacer name="verticalSpacer_3">
|
<widget class="QPushButton" name="continue2Btn">
|
||||||
<property name="orientation">
|
<property name="font">
|
||||||
<enum>Qt::Vertical</enum>
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" stdset="0">
|
<property name="text">
|
||||||
<size>
|
<string>Continue</string>
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
<item row="6" column="0">
|
||||||
<widget class="QLabel" name="messageLabel">
|
<widget class="QLabel" name="messageLabel">
|
||||||
|
@ -155,21 +202,18 @@ A factory reset is recommended.</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="9" column="0">
|
||||||
<widget class="QLabel" name="securityLabel">
|
<spacer name="verticalSpacer_5">
|
||||||
<property name="font">
|
<property name="orientation">
|
||||||
<font>
|
<enum>Qt::Vertical</enum>
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="sizeHint" stdset="0">
|
||||||
<string>The security policy was violated.</string>
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
</spacer>
|
||||||
<set>Qt::AlignCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
|
Loading…
Reference in a new issue