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