2021-03-25 05:00:19 -07:00
|
|
|
#include "mainwindow.h"
|
|
|
|
#include "alert.h"
|
|
|
|
#include <QApplication>
|
|
|
|
#include <QFile>
|
|
|
|
#include <QTextStream>
|
2021-03-26 15:53:02 -07:00
|
|
|
#include <QDebug>
|
|
|
|
#include <QRect>
|
|
|
|
#include <QScreen>
|
2021-03-25 05:00:19 -07:00
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
// Checking if there has been an ALERT flag set up, and if there is, show a big warning
|
|
|
|
QFile config("/external_root/boot/flags/ALERT");
|
|
|
|
config.open(QIODevice::ReadOnly);
|
|
|
|
QTextStream in (&config);
|
|
|
|
const QString content = in.readAll();
|
|
|
|
string contentstr = content.toStdString();
|
|
|
|
config.close();
|
|
|
|
if(contentstr.find("true") != std::string::npos) {
|
|
|
|
QApplication a(argc, argv);
|
|
|
|
alert w;
|
|
|
|
|
2021-03-26 15:53:02 -07:00
|
|
|
const QScreen* screen = qApp->primaryScreen();
|
|
|
|
w.setGeometry(QRect(QPoint(0,0), screen->geometry ().size()));
|
2021-03-25 05:00:19 -07:00
|
|
|
w.show();
|
|
|
|
return a.exec();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
QApplication a(argc, argv);
|
|
|
|
MainWindow w;
|
|
|
|
|
|
|
|
QApplication::setStyle("windows");
|
|
|
|
QFile stylesheetFile(":/resources/eink.qss");
|
|
|
|
stylesheetFile.open(QFile::ReadOnly);
|
|
|
|
w.setStyleSheet(stylesheetFile.readAll());
|
|
|
|
stylesheetFile.close();
|
|
|
|
|
2021-03-26 15:53:02 -07:00
|
|
|
const QScreen* screen = qApp->primaryScreen();
|
|
|
|
w.setGeometry(QRect(QPoint(0,0), screen->geometry ().size()));
|
2021-03-25 05:00:19 -07:00
|
|
|
w.show();
|
|
|
|
return a.exec();
|
|
|
|
}
|
|
|
|
}
|