The Battle for Wesnoth  1.15.13+dev
game_save.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 - 2018 by Jörg Hinrichs <joerg.hinrichs@alice-dsl.de>
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 
19 #include "gettext.hpp"
20 #include "gui/auxiliary/field.hpp"
21 #include "gui/widgets/button.hpp"
22 #include "gui/widgets/label.hpp"
23 #include "gui/widgets/settings.hpp"
24 
25 namespace gui2::dialogs
26 {
27 
28 REGISTER_DIALOG(game_save)
29 
30 game_save::game_save(std::string& filename, const std::string& title)
31 {
32  set_restore(true);
33 
34  register_text("txtFilename", false, filename, true);
35  register_label("lblTitle", true, title);
36 }
37 
39 
41  const std::string& title,
42  const std::string& message)
43 {
44  set_restore(true);
45 
46  register_label("lblTitle", true, title);
47  register_text("txtFilename", false, filename, true);
48  register_label("lblMessage", true, message);
49 }
50 
52 
53 game_save_oos::game_save_oos(bool& ignore_all,
54  std::string& filename,
55  const std::string& title,
56  const std::string& message)
57 {
58  register_label("lblTitle", true, title);
59  register_text("txtFilename", false, filename, true);
60  register_label("lblMessage", true, message);
61  register_bool("ignore_all", true, ignore_all);
62 
63  /* Always need the ignore_all flag. */
64  set_always_save_fields(true);
65 }
66 
67 } // namespace dialogs
Main class to show messages to the user.
Definition: message.hpp:34
STL namespace.
Implements some helper classes to ease adding fields to a dialog and hide the synchronization needed...
This file contains the settings handling of the widget library.
This shows the dialog to create a savegame file.
Definition: game_save.hpp:31