diff --git a/main.cpp b/main.cpp index 6c69edf..fe4dae8 100644 --- a/main.cpp +++ b/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(); + } } } diff --git a/mainwindow.cpp b/mainwindow.cpp index 5bbd8f7..7d5a4dc 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -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); diff --git a/reader.cpp b/reader.cpp index 5ad4b04..e17f53a 100644 --- a/reader.cpp +++ b/reader.cpp @@ -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