The Battle for Wesnoth  1.19.0-dev
edit_pbl_translation.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2023 - 2024
3  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #define GETTEXT_DOMAIN "wesnoth-lib"
16 
18 
20 #include "gui/widgets/text_box.hpp"
21 
22 namespace gui2::dialogs
23 {
24 
25 REGISTER_DIALOG(editor_edit_pbl_translation)
26 
28  std::string& language, std::string& title, std::string& description)
29  : modal_dialog(window_id())
30  , language_(language)
31  , title_(title)
32  , description_(description)
33 {
34 }
35 
37 {
38  text_box* language = find_widget<text_box>(&win, "language", false, true);
40 }
41 
43 {
44  language_ = find_widget<text_box>(&win, "language", false).get_value();
45  title_ = find_widget<text_box>(&win, "lang_title", false).get_value();
46  description_ = find_widget<text_box>(&win, "description", false).get_value();
47 }
48 
49 } // namespace gui2::dialogs
Dialog for adding a translation while editing an add-on's _server.pbl.
virtual void pre_show(window &window) override
The execute function.
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
Abstract base class for all modal dialogs.
Class for a single line text area.
Definition: text_box.hpp:142
base class of top level items, the only item which needs to store the final canvases to draw on.
Definition: window.hpp:63
void keyboard_capture(widget *widget)
Definition: window.cpp:1221
REGISTER_DIALOG(editor_edit_unit)
std::string language()
Definition: general.cpp:535