mirror of
https://github.com/Quill-OS/quill.git
synced 2024-12-26 23:57:22 -08:00
Ignore false battery readings if running in emulator
This commit is contained in:
parent
c24d73bf0b
commit
a020f1c093
3 changed files with 24 additions and 15 deletions
29
main.cpp
29
main.cpp
|
@ -58,20 +58,23 @@ int main(int argc, char *argv[])
|
|||
global::reader::startUsbmsPrompt = false;
|
||||
|
||||
// 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");
|
||||
if(checkconfig_str_val == "Charging\n") {
|
||||
;
|
||||
}
|
||||
else {
|
||||
global::battery::showCriticalBatteryAlert = true;
|
||||
QApplication a(argc, argv);
|
||||
alert w;
|
||||
string_checkconfig_ro("/opt/inkbox_device");
|
||||
if(checkconfig_str_val != "emu\n") {
|
||||
if(isBatteryCritical() == true) {
|
||||
string_checkconfig_ro("/sys/devices/platform/pmic_battery.1/power_supply/mc13892_bat/status");
|
||||
if(checkconfig_str_val == "Charging\n") {
|
||||
;
|
||||
}
|
||||
else {
|
||||
global::battery::showCriticalBatteryAlert = true;
|
||||
QApplication a(argc, argv);
|
||||
alert w;
|
||||
|
||||
const QScreen* screen = qApp->primaryScreen();
|
||||
w.setGeometry(QRect(QPoint(0,0), screen->geometry().size()));
|
||||
w.show();
|
||||
return a.exec();
|
||||
const QScreen* screen = qApp->primaryScreen();
|
||||
w.setGeometry(QRect(QPoint(0,0), screen->geometry().size()));
|
||||
w.show();
|
||||
return a.exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -328,7 +328,10 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
}
|
||||
}
|
||||
} );
|
||||
batteryWatchdog->start();
|
||||
string_checkconfig_ro("/opt/inkbox_device");
|
||||
if(checkconfig_str_val != "emu\n") {
|
||||
batteryWatchdog->start();
|
||||
}
|
||||
|
||||
// USB mass storage prompt
|
||||
QTimer *usbmsPrompt = new QTimer(this);
|
||||
|
|
|
@ -675,7 +675,10 @@ reader::reader(QWidget *parent) :
|
|||
}
|
||||
}
|
||||
} );
|
||||
t->start();
|
||||
string_checkconfig_ro("/opt/inkbox_device");
|
||||
if(checkconfig_str_val != "emu\n") {
|
||||
t->start();
|
||||
}
|
||||
}
|
||||
|
||||
// Pages number info label
|
||||
|
|
Loading…
Reference in a new issue