The Battle for Wesnoth  1.17.0-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::dialogs
21 {
22 
23 REGISTER_DIALOG(game_delete)
24 
25 /**
26  * Helper to invert @ref preferences::ask_delete_saves.
27  *
28  * The value stored and the way shown is inverted.
29  */
30 static bool get_dont_ask_again()
31 {
33 }
34 
35 /**
36  * Helper to invert @ref preferences::set_ask_delete_saves.
37  *
38  * The value stored and the way shown is inverted.
39  */
40 static void set_dont_ask_again(const bool ask_again)
41 {
43 }
44 
46 {
47  set_restore(true);
48 
50  "dont_ask_again", true, &get_dont_ask_again, &set_dont_ask_again);
51 }
52 
53 } // namespace dialogs
static bool get_dont_ask_again()
Helper to invert preferences::ask_delete_saves.
Definition: game_delete.cpp:30
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.
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:40
bool ask_delete_saves()
Definition: game.cpp:789
void set_ask_delete_saves(bool value)
Definition: game.cpp:784
void set_restore(const bool restore)