X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/059c9a03c8cc02b0c595e3a5599be04dc157f725..56da7b1c456ed1cbd8a09a9c6bc7c312e51ca037:/main/enigma.cpp?ds=sidebyside diff --git a/main/enigma.cpp b/main/enigma.cpp index 3ea4afb7..91645d89 100644 --- a/main/enigma.cpp +++ b/main/enigma.cpp @@ -28,6 +28,7 @@ #include #include "bsod.h" +#include "version_info.h" #include @@ -250,8 +251,9 @@ int main(int argc, char **argv) { gPainter p(my_lcd_dc); - p.resetClip(eRect(0, 0, 132, 64)); + p.resetClip(eRect(ePoint(0, 0), my_lcd_dc->size())); p.clear(); + p.flush(); } return exit_code; @@ -267,11 +269,6 @@ eApplication *getApplication() return eApp; } -void runMainloop() -{ - eApp->runLoop(); -} - void quitMainloop(int exitCode) { FILE *f = fopen("/proc/stb/fp/was_timer_wakeup", "w"); @@ -296,22 +293,30 @@ void quitMainloop(int exitCode) eApp->quit(0); } -#include "version.h" +static void sigterm_handler(int num) +{ + quitMainloop(128 + num); +} + +void runMainloop() +{ + struct sigaction act; + + act.sa_handler = sigterm_handler; + act.sa_flags = SA_RESTART; + + if (sigemptyset(&act.sa_mask) == -1) + perror("sigemptyset"); + if (sigaction(SIGTERM, &act, 0) == -1) + perror("SIGTERM"); + + eApp->runLoop(); +} const char *getEnigmaVersionString() { - std::string date = -#ifdef ENIGMA2_LAST_CHANGE_DATE - ENIGMA2_LAST_CHANGE_DATE; -#else - __DATE__; -#endif - std::string branch = -#ifdef ENIGMA2_BRANCH - ENIGMA2_BRANCH; -#else - "HEAD"; -#endif + std::string date = enigma2_date; + std::string branch = enigma2_branch; return std::string(date + '-' + branch).c_str(); }