20 #define GETTEXT_DOMAIN "wesnoth-lib" 40 #define ERR_LS LOG_STREAM(err, log_loadscreen) 41 #define WRN_LS LOG_STREAM(warn, log_loadscreen) 43 static const std::map<loading_stage, std::string>
stage_names {
79 , progress_stage_label_(nullptr)
84 , current_visible_stage_()
86 for(
const auto& [stage, description] :
stage_names) {
105 }
catch(
const std::system_error&
e) {
106 ERR_LS <<
"Failed to create worker thread: " << e.what() <<
"\n";
112 animation_ = find_widget<drawing>(&window,
"animation",
false,
true);
153 WRN_LS <<
"Stage missing description." << std::endl;
161 using namespace std::chrono;
162 const auto now = steady_clock::now();
182 #if defined(_LIBCPP_VERSION) || defined(__MINGW32__) virtual void pre_show(window &window) override
Actions to be taken before showing the window.
static lg::log_domain log_loadscreen("loadscreen")
void close()
Requests to close the window.
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
stage_map::const_iterator current_visible_stage_
void set_variable(const std::string &key, wfl::variant &&value)
std::atomic< loading_stage > current_stage_
static void progress(loading_stage stage=loading_stage::none)
static CVideo & get_singleton()
void set_escape_disabled(const bool escape_disabled)
Disable the escape key.
window * get_window() const
Returns a pointer to the dialog's window.
loading_stage
Loading screen stage IDs.
label * progress_stage_label_
static const std::map< loading_stage, std::string > stage_names
This file contains the settings handling of the widget library.
canvas & get_drawing_canvas()
std::future< void > worker_result_
stage_map visible_stages_
virtual void process(events::pump_info &) override
Inherited from events::pump_monitor.
std::optional< decltype(std::chrono::steady_clock::now())> animation_start_
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
void connect_signal(const F &func, const queue_position position=back_child)
Adds a callback to the appropriate queue based on event type.
Contains the gui2 timer routines.
void draw_callback()
Callback to handle drawing the progress animation.
std::unique_ptr< cursor::setter > cursor_setter_
static loading_screen * singleton_
static void display(std::function< void()> f)
std::function< void()> load_func_
Standard logging facilities (interface).
loading_screen(std::function< void()> f)
base class of top level items, the only item which needs to store the final canvases to draw on...
void set_enter_disabled(const bool enter_disabled)
Disable the enter key.