The Battle for Wesnoth  1.15.1+dev
game_delete.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 
16 
17 #include "preferences/game.hpp"
18 #include "gui/widgets/settings.hpp"
19 
20 namespace gui2
21 {
22 namespace dialogs
23 {
24 
25 /*WIKI
26  * @page = GUIWindowDefinitionWML
27  * @order = 2_game_delete
28  *
29  * == Delete a savegame ==
30  *
31  * This shows the dialog to confirm deleting a savegame file.
32  *
33  * @begin{table}{dialog_widgets}
34  *
35  * dont_ask_again & & boolean_selector & m &
36  * A checkbox to not show this dialog again. $
37  *
38  * @end{table}
39  */
40 
41 REGISTER_DIALOG(game_delete)
42 
43 /**
44  * Helper to invert @ref preferences::ask_delete_saves.
45  *
46  * The value stored and the way shown is inverted.
47  */
48 static bool get_dont_ask_again()
49 {
51 }
52 
53 /**
54  * Helper to invert @ref preferences::set_ask_delete_saves.
55  *
56  * The value stored and the way shown is inverted.
57  */
58 static void set_dont_ask_again(const bool ask_again)
59 {
61 }
62 
64 {
65  set_restore(true);
66 
68  "dont_ask_again", true, &get_dont_ask_again, &set_dont_ask_again);
69 }
70 
71 } // namespace dialogs
72 } // namespace gui2
static bool get_dont_ask_again()
Helper to invert preferences::ask_delete_saves.
Definition: game_delete.cpp:48
field_bool * register_bool(const std::string &id, const bool mandatory, const std::function< bool()> callback_load_value=nullptr, const std::function< void(bool)> callback_save_value=nullptr, const std::function< void(widget &)> callback_change=nullptr, const bool initial_fire=false)
Creates a new boolean field.
Generic file dialog.
Definition: field-fwd.hpp:22
This file contains the settings handling of the widget library.
static void set_dont_ask_again(const bool ask_again)
Helper to invert preferences::set_ask_delete_saves.
Definition: game_delete.cpp:58
Various uncategorised dialogs.
bool ask_delete_saves()
Definition: game.cpp:807
void set_ask_delete_saves(bool value)
Definition: game.cpp:802
void set_restore(const bool restore)