The Battle for Wesnoth  1.17.0-dev
game_delete.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 - 2021
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 
17 
18 #include "preferences/game.hpp"
19 #include "gui/widgets/settings.hpp"
20 
21 namespace gui2::dialogs
22 {
23 
24 REGISTER_DIALOG(game_delete)
25 
26 /**
27  * Helper to invert @ref preferences::ask_delete_saves.
28  *
29  * The value stored and the way shown is inverted.
30  */
31 static bool get_dont_ask_again()
32 {
34 }
35 
36 /**
37  * Helper to invert @ref preferences::set_ask_delete_saves.
38  *
39  * The value stored and the way shown is inverted.
40  */
41 static void set_dont_ask_again(const bool ask_again)
42 {
44 }
45 
47 {
48  set_restore(true);
49 
51  "dont_ask_again", true, &get_dont_ask_again, &set_dont_ask_again);
52 }
53 
54 } // namespace dialogs
static bool get_dont_ask_again()
Helper to invert preferences::ask_delete_saves.
Definition: game_delete.cpp:31
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:41
bool ask_delete_saves()
Definition: game.cpp:790
void set_ask_delete_saves(bool value)
Definition: game.cpp:785
void set_restore(const bool restore)