16 #define GETTEXT_DOMAIN "wesnoth-lib" 39 listbox& list = find_widget<listbox>(&window,
"language_list",
false);
40 window.keyboard_capture(&list);
44 for(
const auto & lang : languages)
48 data[
"language"][
"label"] = lang.language;
51 if(lang == current_language) {
60 const int res = find_widget<listbox>(&
window,
"language_list",
false)
window(const builder_window::window_resolution &definition)
< Needs to be initialized in show.
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
void set_language(const std::string &language, const std::vector< std::string > *)
grid & add_row(const widget_item &item, const int index=-1)
When an item in the list is selected by the user we need to update the state.
bool select_last_row(const bool select=true)
Does exactly as advertised: selects the list's last row.
This file contains the settings handling of the widget library.
language_list get_languages(bool all)
Return a list of available translations.
This shows the dialog to select the language to use.
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
const language_def & get_language()
void set_language(const std::string &s)
int get_retval() const
Returns the cached window exit code.
std::map< std::string, widget_item > widget_data
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...