The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
game_delete.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 - 2016 by Jörg Hinrichs <[email protected]>
3  Part of the Battle for Wesnoth Project http://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 "game_preferences.hpp"
18 #include "gui/widgets/settings.hpp"
19 
20 namespace gui2
21 {
22 
23 /*WIKI
24  * @page = GUIWindowDefinitionWML
25  * @order = 2_game_delete
26  *
27  * == Delete a savegame ==
28  *
29  * This shows the dialog to confirm deleting a savegame file.
30  *
31  * @begin{table}{dialog_widgets}
32  *
33  * dont_ask_again & & boolean_selector & m &
34  * A checkbox to not show this dialog again. $
35  *
36  * @end{table}
37  */
38 
39 REGISTER_DIALOG(game_delete)
40 
41 /**
42  * Helper to invert @ref preferences::ask_delete_saves.
43  *
44  * The value stored and the way shown is inverted.
45  */
46 static bool get_dont_ask_again()
47 {
49 }
50 
51 /**
52  * Helper to invert @ref preferences::set_ask_delete_saves.
53  *
54  * The value stored and the way shown is inverted.
55  */
56 static void set_dont_ask_again(const bool ask_again)
57 {
59 }
60 
62 {
63  set_restore(true);
64 
66  "dont_ask_again", true, &get_dont_ask_again, &set_dont_ask_again);
67 }
68 
69 } // namespace gui2
REGISTER_DIALOG(label_settings)
A class inherited from ttext_box that displays its input as stars.
Definition: field-fwd.hpp:23
This file contains the settings handling of the widget library.
void set_restore(const bool restore)
Definition: dialog.hpp:171
static bool get_dont_ask_again()
Helper to invert preferences::ask_delete_saves.
Definition: game_delete.cpp:46
tfield_bool * register_bool(const std::string &id, const bool mandatory, const std::function< bool()> &callback_load_value=std::function< bool()>(), const std::function< void(const bool)> &callback_save_value=std::function< void(const bool)>(), const std::function< void(twidget &)> &callback_change=std::function< void(twidget &)>())
Creates a new boolean field.
Definition: dialog.cpp:74
void set_ask_delete_saves(bool value)
static void set_dont_ask_again(const bool ask_again)
Helper to invert preferences::set_ask_delete_saves.
Definition: game_delete.cpp:56