15 #define GETTEXT_DOMAIN "wesnoth-lib" 39 , report_text_(report_text)
40 , reportee_empty_(true)
41 , report_reason_empty_(true)
47 std::vector<config> occurrence_location_entries;
48 occurrence_location_entries.emplace_back(
"label",
_(
"Lobby"));
49 occurrence_location_entries.emplace_back(
"label",
_(
"Whisper"));
50 occurrence_location_entries.emplace_back(
"label",
_(
"Game"));
52 find_widget<menu_button>(&win,
"occurrence_location",
false).set_values(occurrence_location_entries);
54 button& ok = find_widget<button>(&win,
"ok",
false);
57 text_box& reportee = find_widget<text_box>(&win,
"reportee",
false);
60 text_box& report_reason = find_widget<text_box>(&win,
"report_reason",
false);
70 const text_box& reportee = find_widget<const text_box>(&
window,
"reportee",
false);
71 const text_box& report_reason = find_widget<const text_box>(&
window,
"report_reason",
false);
72 const menu_button& occurrence_location = find_widget<const menu_button>(&
window,
"occurrence_location",
false);
73 const std::string additional_information = find_widget<const text_box>(&
window,
"additional_information",
false).get_value();
75 std::ostringstream report;
76 report <<
"Reporting player '" << reportee.
get_value() <<
"' for reason '" << report_reason.get_value() <<
"'." 77 <<
" Location of occurrence is '" <<
occurrence_locations[occurrence_location.get_value()] <<
"'.";
78 if(additional_information.size() > 0)
80 report <<
" Additional information provided: '" << additional_information <<
"'.";
window(const builder_window::window_resolution &definition)
< Needs to be initialized in show.
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
void set_text_changed_callback(std::function< void(text_box_base *textbox, const std::string text)> cb)
Set the text_changed callback.
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
std::string & report_text_
std::string get_value() const
static const std::array< std::string, 3 > occurrence_locations
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
static std::string _(const char *str)
Class for a single line text area.
void reportee_changed(const std::string &text)
Run hook only if result is OK.
window * get_window()
Returns a pointer to the dialog's window.
bool report_reason_empty_
mp_report(std::string &report_text_)
void report_reason_changed(const std::string &text)
int get_retval() const
Returns the cached window exit code.
Abstract base class for all modal dialogs.
Dialog was closed with the OK button.
base class of top level items, the only item which needs to store the final canvases to draw on...