17 #include "ui/view_selection.h" 18 #include "ui/view_info.h" 19 #include "ui/view_monitor.h" 20 #include "ui/view_promt.h" 22 volatile int win_changed_cooldown = 0;
23 volatile bool t_refresh_active =
false;
25 void signal_handler(
int signal)
27 if(signal == SIGWINCH)
29 win_changed_cooldown = 10;
31 if (!t_refresh_active)
33 if(t_refresh.joinable())
35 t_refresh_active =
true;
36 t_refresh = std::thread([](){
38 while(win_changed_cooldown--)
39 std::this_thread::sleep_for(std::chrono::milliseconds(10));
41 t_refresh_active =
false;
44 win_stack.back()->repaint();
50 else if(signal == SIGINT)
53 std::cout <<
"SIGINT - Abbruch." << std::endl;
58 void abort_handler(std::exception& ex)
61 view->setTitle(
"Fehler");
62 std::string msg(ex.what());
63 msg +=
"\n\nBeende in 5 Sekunden.";
64 view->setText(msg.c_str());
65 view->setLabelClose(
"");
68 std::this_thread::sleep_for(std::chrono::milliseconds(5000));
71 std::cerr << std::endl <<
"*** EXCEPTION ***" << std::endl << ex.what() << std::endl;
79 #ifndef B15F_CLI_DEBUG 80 std::cout << std::endl <<
"Starte in 3s ..." << std::endl;
92 mousemask(ALL_MOUSE_EVENTS, NULL);
95 signal(SIGWINCH, signal_handler);
96 signal(SIGINT, signal_handler);
99 View::setWinContext(newwin(25, 85, 0, 0));
107 int exit_code = EXIT_SUCCESS;