diff --git a/main.cpp b/main.cpp index 1e2aabc..747acb3 100644 --- a/main.cpp +++ b/main.cpp @@ -30,6 +30,9 @@ int main(int argc, char *argv[]) { + // Tell scripts that we're currently running + string_writeconfig("/tmp/inkbox_running", "true"); + // Checking if battery level is critical; if true (and if it is not charging), then display a "Please charge your eReader" splash and power off. if(isBatteryCritical() == true) { string_checkconfig_ro("/sys/devices/platform/pmic_battery.1/power_supply/mc13892_bat/status"); diff --git a/mainwindow.cpp b/mainwindow.cpp index e800e7c..4a19b31 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -275,8 +275,14 @@ MainWindow::MainWindow(QWidget *parent) } else { if(isBatteryCritical() == true) { - qDebug() << "Warning! Battery is at a critical charge level!"; - openCriticalBatteryAlertWindow(); + string_checkconfig_ro("/sys/devices/platform/pmic_battery.1/power_supply/mc13892_bat/status"); + if(checkconfig_str_val == "Charging\n") { + ; + } + else { + qDebug() << "Warning! Battery is at a critical charge level!"; + openCriticalBatteryAlertWindow(); + } } }