00001 /* $Id: game_delete.cpp 52533 2012-01-07 02:35:17Z shadowmaster $ */ 00002 /* 00003 Copyright (C) 2008 - 2012 by Jörg Hinrichs <joerg.hinrichs@alice-dsl.de> 00004 Part of the Battle for Wesnoth Project http://www.wesnoth.org/ 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY. 00012 00013 See the COPYING file for more details. 00014 */ 00015 00016 #include "gui/dialogs/game_delete.hpp" 00017 00018 #include "game_preferences.hpp" 00019 #include "gui/widgets/settings.hpp" 00020 00021 namespace gui2 { 00022 00023 /*WIKI 00024 * @page = GUIWindowDefinitionWML 00025 * @order = 2_game_delete 00026 * 00027 * == Delete a savegame == 00028 * 00029 * This shows the dialog to confirm deleting a savegame file. 00030 * 00031 * @begin{table}{dialog_widgets} 00032 * 00033 * dont_ask_again & & boolean_selector & m & 00034 * A checkbox to not show this dialog again. $ 00035 * 00036 * @end{table} 00037 */ 00038 00039 REGISTER_DIALOG(game_delete) 00040 00041 /** 00042 * Helper to invert @ref preferences::ask_delete_saves. 00043 * 00044 * The value stored and the way shown is inverted. 00045 */ 00046 static bool get_dont_ask_again() 00047 { 00048 return !preferences::ask_delete_saves(); 00049 } 00050 00051 /** 00052 * Helper to invert @ref preferences::set_ask_delete_saves. 00053 * 00054 * The value stored and the way shown is inverted. 00055 */ 00056 static void set_dont_ask_again(const bool ask_again) 00057 { 00058 preferences::set_ask_delete_saves(!ask_again); 00059 } 00060 00061 tgame_delete::tgame_delete() 00062 { 00063 register_bool("dont_ask_again" 00064 , true 00065 , &get_dont_ask_again 00066 , &set_dont_ask_again); 00067 } 00068 00069 } // namespace gui2 00070
| Generated by doxygen 1.7.1 on Fri May 25 2012 01:02:58 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |