mirror of
https://github.com/Quill-OS/quill.git
synced 2024-12-27 16:17:21 -08:00
32 lines
821 B
C++
32 lines
821 B
C++
#include "otamanager.h"
|
|
#include "ui_otamanager.h"
|
|
#include "functions.h"
|
|
|
|
#include <QTimer>
|
|
|
|
otaManager::otaManager(QWidget *parent) :
|
|
QWidget(parent),
|
|
ui(new Ui::otaManager)
|
|
{
|
|
ui->setupUi(this);
|
|
string_writeconfig("/opt/ibxd", "ota_update_check\n");
|
|
QTimer *otaCheckTimer = new QTimer();
|
|
otaCheckTimer->setInterval(100);
|
|
connect(otaCheckTimer, &QTimer::timeout, [&]() {
|
|
if(QFile::exists("/run/can_install_ota_update") == true) {
|
|
if(checkconfig("/run/can_install_ota_update") == true) {
|
|
emit canInstallOtaUpdate(true);
|
|
otaManager::close();
|
|
}
|
|
else {
|
|
emit canInstallOtaUpdate(false);
|
|
otaManager::close();
|
|
}
|
|
}
|
|
} );
|
|
}
|
|
|
|
otaManager::~otaManager()
|
|
{
|
|
delete ui;
|
|
}
|