The Battle for Wesnoth  1.15.2+dev
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
gui2::dialogs::game_load Class Reference

#include <game_load.hpp>

Inheritance diagram for gui2::dialogs::game_load:
Inheritance graph

Public Member Functions

 game_load (const config &cache_config, savegame::load_game_metadata &data)
 
- Public Member Functions inherited from gui2::dialogs::modal_dialog
 modal_dialog ()
 
virtual ~modal_dialog ()
 
bool show (const unsigned auto_close_time=0)
 Shows the window. More...
 
windowget_window () const
 Returns a pointer to the dialog's window. More...
 
int get_retval () const
 
void set_always_save_fields (const bool always_save_fields)
 
void set_restore (const bool restore)
 
void set_allow_plugin_skip (const bool allow_plugin_skip)
 
void set_show_even_without_video (const bool show_even_without_video)
 

Static Public Member Functions

static bool execute (const config &cache_config, savegame::load_game_metadata &data)
 

Private Member Functions

virtual void pre_show (window &window) override
 Inherited from modal_dialog. More...
 
virtual const std::string & window_id () const override
 Inherited from modal_dialog, implemented by REGISTER_DIALOG. More...
 
void set_save_dir_list (menu_button &dir_list)
 
void populate_game_list (window &window)
 Update (both internally and visually) the list of games. More...
 
void filter_text_changed (text_box_base *textbox, const std::string &text)
 
void browse_button_callback ()
 
void delete_button_callback (window &window)
 
void handle_dir_select (window &window)
 
void display_savegame_internal (window &window)
 
void display_savegame (window &window)
 
void evaluate_summary_string (std::stringstream &str, const config &cfg_summary)
 
void key_press_callback (window &window, const SDL_Keycode key)
 

Private Attributes

std::string & filename_
 
std::shared_ptr< savegame::save_index_class > & save_index_manager_
 
field_boolchange_difficulty_
 
field_boolshow_replay_
 
field_boolcancel_orders_
 
configsummary_
 
std::vector< savegame::save_infogames_
 
const configcache_config_
 
std::vector< std::string > last_words_
 

Additional Inherited Members

- Protected Member Functions inherited from gui2::dialogs::modal_dialog
field_boolregister_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. More...
 
field_boolregister_bool (const std::string &id, const bool mandatory, bool &linked_variable, const std::function< void(widget &)> callback_change=nullptr, const bool initial_fire=false)
 Creates a new boolean field. More...
 
field_integerregister_integer (const std::string &id, const bool mandatory, const std::function< int()> callback_load_value=nullptr, const std::function< void(int)> callback_save_value=nullptr)
 Creates a new integer field. More...
 
field_integerregister_integer (const std::string &id, const bool mandatory, int &linked_variable)
 Creates a new integer field. More...
 
field_textregister_text (const std::string &id, const bool mandatory, const std::function< std::string()> callback_load_value=nullptr, const std::function< void(const std::string &)> callback_save_value=nullptr, const bool capture_focus=false)
 Creates a new text field. More...
 
field_textregister_text (const std::string &id, const bool mandatory, std::string &linked_variable, const bool capture_focus=false)
 Creates a new text field. More...
 
field_labelregister_label (const std::string &id, const bool mandatory, const std::string &text, const bool use_markup=false)
 Registers a new styled_widget as a label. More...
 
field_labelregister_image (const std::string &id, const bool mandatory, const std::string &filename)
 Registers a new styled_widget as image. More...
 
- Protected Attributes inherited from gui2::dialogs::modal_dialog
std::unique_ptr< windowwindow_
 The window object build for this dialog. More...
 

Detailed Description

Definition at line 32 of file game_load.hpp.

Constructor & Destructor Documentation

◆ game_load()

gui2::dialogs::game_load::game_load ( const config cache_config,
savegame::load_game_metadata data 
)

Definition at line 105 of file game_load.cpp.

Referenced by execute().

Member Function Documentation

◆ browse_button_callback()

void gui2::dialogs::game_load::browse_button_callback ( )
private

Definition at line 481 of file game_load.cpp.

References desktop::open_object(), and save_index_manager_.

Referenced by execute(), and pre_show().

◆ delete_button_callback()

void gui2::dialogs::game_load::delete_button_callback ( window window)
private

◆ display_savegame()

void gui2::dialogs::game_load::display_savegame ( window window)
private

◆ display_savegame_internal()

void gui2::dialogs::game_load::display_savegame_internal ( window window)
private

◆ evaluate_summary_string()

void gui2::dialogs::game_load::evaluate_summary_string ( std::stringstream &  str,
const config cfg_summary 
)
private

◆ execute()

static bool gui2::dialogs::game_load::execute ( const config cache_config,
savegame::load_game_metadata data 
)
inlinestatic

◆ filter_text_changed()

void gui2::dialogs::game_load::filter_text_changed ( text_box_base textbox,
const std::string &  text 
)
private

◆ handle_dir_select()

void gui2::dialogs::game_load::handle_dir_select ( window window)
private

◆ key_press_callback()

void gui2::dialogs::game_load::key_press_callback ( window window,
const SDL_Keycode  key 
)
private

Definition at line 517 of file game_load.cpp.

References delete_button_callback(), and gui2::text_box_base::FOCUSED.

Referenced by execute(), and pre_show().

◆ populate_game_list()

void gui2::dialogs::game_load::populate_game_list ( window window)
private

Update (both internally and visually) the list of games.

Definition at line 182 of file game_load.cpp.

References gui2::listbox::add_row(), gui2::listbox::clear(), utils::ellipsis_truncate(), games_, and save_index_manager_.

Referenced by execute(), handle_dir_select(), and pre_show().

◆ pre_show()

void gui2::dialogs::game_load::pre_show ( window window)
overrideprivatevirtual

◆ set_save_dir_list()

void gui2::dialogs::game_load::set_save_dir_list ( menu_button dir_list)
private

◆ window_id()

virtual const std::string& gui2::dialogs::game_load::window_id ( ) const
overrideprivatevirtual

Inherited from modal_dialog, implemented by REGISTER_DIALOG.

Implements gui2::dialogs::modal_dialog.

Referenced by execute().

Member Data Documentation

◆ cache_config_

const config& gui2::dialogs::game_load::cache_config_
private

Definition at line 75 of file game_load.hpp.

Referenced by evaluate_summary_string(), and pre_show().

◆ cancel_orders_

field_bool* gui2::dialogs::game_load::cancel_orders_
private

Definition at line 70 of file game_load.hpp.

Referenced by display_savegame(), and display_savegame_internal().

◆ change_difficulty_

field_bool* gui2::dialogs::game_load::change_difficulty_
private

Definition at line 68 of file game_load.hpp.

Referenced by display_savegame(), and display_savegame_internal().

◆ filename_

std::string& gui2::dialogs::game_load::filename_
private

Definition at line 65 of file game_load.hpp.

Referenced by display_savegame_internal().

◆ games_

std::vector<savegame::save_info> gui2::dialogs::game_load::games_
private

◆ last_words_

std::vector<std::string> gui2::dialogs::game_load::last_words_
private

Definition at line 77 of file game_load.hpp.

Referenced by filter_text_changed().

◆ save_index_manager_

std::shared_ptr<savegame::save_index_class>& gui2::dialogs::game_load::save_index_manager_
private

◆ show_replay_

field_bool* gui2::dialogs::game_load::show_replay_
private

Definition at line 69 of file game_load.hpp.

Referenced by display_savegame(), and display_savegame_internal().

◆ summary_

config& gui2::dialogs::game_load::summary_
private

Definition at line 72 of file game_load.hpp.

Referenced by display_savegame_internal().


The documentation for this class was generated from the following files: