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([]()
39 while(win_changed_cooldown--)
40 std::this_thread::sleep_for(std::chrono::milliseconds(10));
42 t_refresh_active =
false;
45 win_stack.back()->repaint();
51 else if(signal == SIGINT)
54 std::cout <<
"SIGINT - Abbruch." << std::endl;
59 void abort_handler(std::exception& ex)
62 view->setTitle(
"Fehler");
63 std::string msg(ex.what());
64 msg +=
"\n\nBeende in 5 Sekunden.";
65 view->setText(msg.c_str());
66 view->setLabelClose(
"");
69 std::this_thread::sleep_for(std::chrono::milliseconds(5000));
72 std::cerr << std::endl <<
"*** EXCEPTION ***" << std::endl << ex.what() << std::endl;
80 #ifndef B15F_CLI_DEBUG 81 std::cout << std::endl <<
"Starte in 3s ..." << std::endl;
93 mousemask(ALL_MOUSE_EVENTS, NULL);
96 signal(SIGWINCH, signal_handler);
97 signal(SIGINT, signal_handler);
100 View::setWinContext(newwin(25, 85, 0, 0));
108 int exit_code = EXIT_SUCCESS;