Add new files for the delete-game-confirmation dialog.
This commit is contained in:
parent
efc75a7d39
commit
1b93fd102e
5 changed files with 232 additions and 0 deletions
138
data/gui/default/window/game_delete.cfg
Normal file
138
data/gui/default/window/game_delete.cfg
Normal file
|
@ -0,0 +1,138 @@
|
|||
#textdomain wesnoth-lib
|
||||
###
|
||||
### Definition of the window to ask for deleting a savegame file
|
||||
###
|
||||
|
||||
[window]
|
||||
id = "game_delete"
|
||||
description = "Confirmation for deleting a savegame."
|
||||
|
||||
[resolution]
|
||||
definition = "default"
|
||||
|
||||
automatic_placement = "true"
|
||||
vertical_placement = "center"
|
||||
horizontal_placement = "center"
|
||||
|
||||
[grid]
|
||||
|
||||
[row]
|
||||
grow_factor = 0
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "left"
|
||||
[label]
|
||||
id = "lblTitle"
|
||||
definition = "title"
|
||||
|
||||
label = _ "Delete Save"
|
||||
[/label]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[row]
|
||||
grow_factor = 0
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "left"
|
||||
[label]
|
||||
id = "lblMessage"
|
||||
definition = "default"
|
||||
|
||||
label = _ "Do you really want to delete this game?"
|
||||
[/label]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[row]
|
||||
grow_factor = 1
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
horizontal_grow = "true"
|
||||
|
||||
[toggle_button]
|
||||
id = "dont_ask_again"
|
||||
definition = "default"
|
||||
|
||||
label = _ "Don't ask me again!"
|
||||
[/toggle_button]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[row]
|
||||
grow_factor = 0
|
||||
|
||||
[column]
|
||||
grow_factor = 1
|
||||
horizontal_grow = "true"
|
||||
|
||||
[grid]
|
||||
|
||||
[row]
|
||||
grow_factor = 0
|
||||
|
||||
[column]
|
||||
|
||||
[spacer]
|
||||
definition = "default"
|
||||
[/spacer]
|
||||
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "right"
|
||||
|
||||
[button]
|
||||
id = "ok"
|
||||
definition = "default"
|
||||
|
||||
size_text = _ "Yes"
|
||||
label = _ "Yes"
|
||||
[/button]
|
||||
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
border = "all"
|
||||
border_size = 5
|
||||
horizontal_alignment = "right"
|
||||
|
||||
[button]
|
||||
id = "cancel"
|
||||
definition = "default"
|
||||
|
||||
label = _ "No"
|
||||
[/button]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[/grid]
|
||||
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
||||
[/grid]
|
||||
|
||||
[/resolution]
|
||||
|
||||
[/window]
|
50
src/gui/dialogs/game_delete.cpp
Normal file
50
src/gui/dialogs/game_delete.cpp
Normal file
|
@ -0,0 +1,50 @@
|
|||
/* $Id$ */
|
||||
/*
|
||||
Copyright (C) 2008 - 2009 by Jörg Hinrichs <joerg.hinrichs@alice-dsl.de>
|
||||
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2
|
||||
or at your option any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY.
|
||||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
//#define GETTEXT_DOMAIN "wesnoth-lib"
|
||||
|
||||
#include "gui/dialogs/game_delete.hpp"
|
||||
#include "gui/widgets/settings.hpp"
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
/*WIKI
|
||||
* @page = GUIWindowDefinitionWML
|
||||
* @order = 2_game_delete
|
||||
*
|
||||
* == Delete a savegame ==
|
||||
*
|
||||
* This shows the dialog to confirm deleting a savegame file.
|
||||
*
|
||||
* @start_table = container
|
||||
* @end_table
|
||||
*/
|
||||
|
||||
tgame_delete::tgame_delete() {}
|
||||
|
||||
twindow* tgame_delete::build_window(CVideo& video)
|
||||
{
|
||||
return build(video, get_id(GAME_DELETE));
|
||||
}
|
||||
|
||||
void tgame_delete::pre_show(CVideo& /*video*/, twindow& window)
|
||||
{
|
||||
}
|
||||
|
||||
void tgame_delete::post_show(twindow& window)
|
||||
{
|
||||
}
|
||||
|
||||
} // namespace gui2
|
||||
|
42
src/gui/dialogs/game_delete.hpp
Normal file
42
src/gui/dialogs/game_delete.hpp
Normal file
|
@ -0,0 +1,42 @@
|
|||
/* $Id$ */
|
||||
/*
|
||||
Copyright (C) 2008 - 2009 by Jörg Hinrichs <joerg.hinrichs@alice-dsl.de>
|
||||
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2
|
||||
or at your option any later version.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY.
|
||||
|
||||
See the COPYING file for more details.
|
||||
*/
|
||||
|
||||
#ifndef GUI_DIALOGS_DELETE_GAME_HPP_INCLUDED
|
||||
#define GUI_DIALOGS_DELETE_GAME_HPP_INCLUDED
|
||||
|
||||
#include "gui/dialogs/dialog.hpp"
|
||||
|
||||
namespace gui2 {
|
||||
|
||||
class tgame_delete : public tdialog
|
||||
{
|
||||
public:
|
||||
tgame_delete();
|
||||
|
||||
protected:
|
||||
/** Inherited from tdialog. */
|
||||
void pre_show(CVideo& video, twindow& window);
|
||||
|
||||
/** Inherited from tdialog. */
|
||||
void post_show(twindow& window);
|
||||
|
||||
private:
|
||||
/** Inherited from tdialog. */
|
||||
twindow* build_window(CVideo& video);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -89,6 +89,7 @@ static void fill_window_types()
|
|||
window_type_list[MP_CREATE_GAME] = "mp_create_game";
|
||||
window_type_list[TITLE_SCREEN] = "title_screen";
|
||||
window_type_list[GAME_LOAD] = "game_load";
|
||||
window_type_list[GAME_DELETE] = "game_delete";
|
||||
window_type_list[GAME_SAVE] = "game_save";
|
||||
window_type_list[GAME_SAVE_MESSAGE] = "game_save_message";
|
||||
window_type_list[GAME_SAVE_OOS] = "game_save_oos";
|
||||
|
|
|
@ -68,6 +68,7 @@ enum twindow_type {
|
|||
EDITOR_SETTINGS, /**< Editor settings dialog. */
|
||||
#endif
|
||||
GAME_LOAD, /**< Load game dialog. */
|
||||
GAME_DELETE, /**< Confirm delete dialog. */
|
||||
GAME_SAVE, /**< Save game dialog. */
|
||||
GAME_SAVE_MESSAGE, /**< Save game dialog with additional message. */
|
||||
GAME_SAVE_OOS, /**< Save game dialog for processing OOS. */
|
||||
|
|
Loading…
Add table
Reference in a new issue