The Battle for Wesnoth  1.17.17+dev
game_delete.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 - 2023
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  : modal_dialog(window_id())
48 {
50  "dont_ask_again", true, &get_dont_ask_again, &set_dont_ask_again);
51 }
52 
53 } // namespace dialogs
Abstract base class for all modal dialogs.
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.
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
static void set_dont_ask_again(const bool ask_again)
Helper to invert preferences::set_ask_delete_saves.
Definition: game_delete.cpp:41
static bool get_dont_ask_again()
Helper to invert preferences::ask_delete_saves.
Definition: game_delete.cpp:31
bool ask_delete_saves()
Definition: game.cpp:776
void set_ask_delete_saves(bool value)
Definition: game.cpp:771
This file contains the settings handling of the widget library.