Update process enhancements

This commit is contained in:
Nicolas Mailloux 2021-04-25 11:27:51 -04:00
parent 7e799d999a
commit d319e1c70b
3 changed files with 30 additions and 2 deletions

View file

@ -246,6 +246,13 @@ MainWindow::MainWindow(QWidget *parent)
rootfs_proc->start(rootfs_prog, rootfs_args); rootfs_proc->start(rootfs_prog, rootfs_args);
rootfs_proc->waitForFinished(); rootfs_proc->waitForFinished();
// Removing update directory contents
QDir dir("/mnt/onboard/onboard/.inkbox");
dir.removeRecursively();
// Re-creating update directory
QString path("/mnt/onboard/onboard/.inkbox");
dir.mkpath(path);
// Rebooting if needed // Rebooting if needed
if(reboot_after_update == true) { if(reboot_after_update == true) {
reboot(false); reboot(false);

View file

@ -46,11 +46,18 @@ quit::~quit()
void quit::on_pushButton_clicked() void quit::on_pushButton_clicked()
{ {
// Prevent strange "appearing from nowhere" low battery or critical battery alerts due to sysfs unmount
global::battery::showCriticalBatteryAlert = false;
global::battery::showLowBatteryDialog = false;
poweroff(true); poweroff(true);
} }
void quit::on_pushButton_2_clicked() void quit::on_pushButton_2_clicked()
{ {
global::battery::showCriticalBatteryAlert = false;
global::battery::showLowBatteryDialog = false;
reboot(true); reboot(true);
} }

View file

@ -17,6 +17,12 @@ settingsChooser::settingsChooser(QWidget *parent) :
this->setStyleSheet(stylesheetFile.readAll()); this->setStyleSheet(stylesheetFile.readAll());
stylesheetFile.close(); stylesheetFile.close();
// UI tweaks
if(checkconfig("/opt/inkbox_kobox_support") != true) {
ui->koboxSettingsBtn->hide();
ui->line_3->hide();
}
// Getting the screen's size // Getting the screen's size
sW = QGuiApplication::screens()[0]->size().width(); sW = QGuiApplication::screens()[0]->size().width();
sH = QGuiApplication::screens()[0]->size().height(); sH = QGuiApplication::screens()[0]->size().height();
@ -35,8 +41,16 @@ settingsChooser::settingsChooser(QWidget *parent) :
ui->inkboxSettingsBtn->setProperty("type", "borderless"); ui->inkboxSettingsBtn->setProperty("type", "borderless");
ui->koboxSettingsBtn->setProperty("type", "borderless"); ui->koboxSettingsBtn->setProperty("type", "borderless");
string_checkconfig("/opt/inkbox_device");
if(checkconfig_str_val == "n705\n" or checkconfig_str_val == "n905\n") {
ui->inkboxSettingsBtn->setStyleSheet("padding: 20px; Text-align: left");
ui->koboxSettingsBtn->setStyleSheet("padding: 20px; Text-align: left");
}
else {
ui->inkboxSettingsBtn->setStyleSheet("padding: 40px; Text-align: left"); ui->inkboxSettingsBtn->setStyleSheet("padding: 40px; Text-align: left");
ui->koboxSettingsBtn->setStyleSheet("padding: 40px; Text-align: left"); ui->koboxSettingsBtn->setStyleSheet("padding: 40px; Text-align: left");
}
ui->inkboxSettingsBtn->setText("\t\t\tInkBox settings"); ui->inkboxSettingsBtn->setText("\t\t\tInkBox settings");
ui->koboxSettingsBtn->setText("\t\t\tKoBox settings"); ui->koboxSettingsBtn->setText("\t\t\tKoBox settings");