16 #define GETTEXT_DOMAIN "wesnoth-lib"
38 std::size_t completed = connection_->current();
39 std::size_t total = connection_->total();
43 .set_percentage(std::round((completed * 100.) / total));
49 window_->find_widget<
label>(
"numeric_progress")
53 if(connection_->finished()) {
60 const std::string& title,
61 const std::string& subtitle)
63 , connection_(&connection)
64 , pump_monitor_(connection_)
74 label& subtitle_label = find_widget<label>(
"subtitle");
81 find_widget<label>(
"numeric_progress").set_label(
" ");
Abstract base class for all modal dialogs.
field_label * register_label(const std::string &id, const bool mandatory, const std::string &text, const bool use_markup=false)
Registers a new styled_widget as a label.
A wrapper of either a wesnothd_connection or a network_asio::connection.
Dialog that tracks network transmissions.
std::string subtitle_
The subtitle for the dialog.
network_transmission(connection_data &connection, const std::string &title, const std::string &subtitle)
gui2::dialogs::network_transmission::pump_monitor pump_monitor_
virtual void pre_show() override
Actions to be taken before showing the window.
connection_data * connection_
virtual void post_show() override
Actions to be taken after the window has been shown.
static std::string _(const char *str)
REGISTER_DIALOG(editor_edit_unit)
@ OK
Dialog was closed with the OK button.
@ CANCEL
Dialog was closed with the CANCEL button.
std::string si_string(double input, bool base2, const std::string &unit)
Convert into a string with an SI-postfix.