The Battle for Wesnoth  1.19.0-dev
game_save.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 - 2024
3  by Jörg Hinrichs <joerg.hinrichs@alice-dsl.de>
4  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 #define GETTEXT_DOMAIN "wesnoth-lib"
17 
19 
20 #include "gettext.hpp"
21 
22 namespace gui2::dialogs
23 {
24 
25 REGISTER_DIALOG(game_save)
26 
27 game_save::game_save(std::string& filename, const std::string& title)
28  : modal_dialog(window_id())
29 {
30  register_text("txtFilename", false, filename, true);
31  register_label("lblTitle", true, title);
32 }
33 
35 
36 game_save_message::game_save_message(std::string& filename,
37  const std::string& title,
38  const std::string& message)
39  : modal_dialog(window_id())
40 {
41  register_label("lblTitle", true, title);
42  register_text("txtFilename", false, filename, true);
43  register_label("lblMessage", true, message);
44 }
45 
47 
48 game_save_oos::game_save_oos(bool& ignore_all,
49  std::string& filename,
50  const std::string& title,
51  const std::string& message)
52  : modal_dialog(window_id())
53 {
54  register_label("lblTitle", true, title);
55  register_text("txtFilename", false, filename, true);
56  register_label("lblMessage", true, message);
57  register_bool("ignore_all", true, ignore_all);
58 
59  /* Always need the ignore_all flag. */
60  set_always_save_fields(true);
61 }
62 
63 } // namespace dialogs
This shows the dialog to create a savegame file.
Definition: game_save.hpp:33
Main class to show messages to the user.
Definition: message.hpp:36
Abstract base class for all modal dialogs.
REGISTER_DIALOG(tod_new_schedule)