The Battle for Wesnoth  1.15.13+dev
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
gui2::dialogs::game_version Class Reference

Dialog displaying the various paths used by the game to locate resource and configuration files. More...

#include <game_version_dialog.hpp>

Inheritance diagram for gui2::dialogs::game_version:

Public Member Functions

 game_version ()
 Constructor. More...
 
- 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
 Returns the cached window exit code. More...
 
void set_retval (int retval)
 Convenience wrapper to set the window's exit code. More...
 
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)
 

Private Types

typedef std::array< std::string, 4 > deplist_entry
 

Private Member Functions

void generate_plain_text_report ()
 
virtual const std::string & window_id () const override
 The id of the window to build. More...
 
virtual void pre_show (window &window) override
 Actions to be taken before showing the window. More...
 
void tab_switch_callback ()
 Callback function called when switching tabs. More...
 
void report_copy_callback ()
 Callback function for the dialog-wide copy-to-clipboard button. More...
 
void copy_to_clipboard_callback (const std::string &path)
 Callback function for copy-to-clipboard action buttons. More...
 
void browse_directory_callback (const std::string &path)
 Callback function for browse-directory action buttons. More...
 

Private Attributes

const std::string path_wid_stem_
 The display function. More...
 
const std::string copy_wid_stem_
 
const std::string browse_wid_stem_
 
std::map< std::string, std::string > path_map_
 
std::vector< deplist_entrydeps_
 
std::vector< game_config::optional_featureopts_
 
std::string report_
 

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

Dialog displaying the various paths used by the game to locate resource and configuration files.

There are several item types used to build widget ids in this dialog. All references to TYPE below refer to the following suffixes: datadir, config, userdata, saves, addons, cache.

Key Type MandatoryDescription
path_TYPE text_box yes Textbox containing the filesystem path for the given item.
copy_TYPE button yes Copies the given item's path to clipboard.
browse_TYPE button yes Launches the default file browser on the given item's path.

Definition at line 45 of file game_version_dialog.hpp.

Member Typedef Documentation

◆ deplist_entry

typedef std::array<std::string, 4> gui2::dialogs::game_version::deplist_entry
private

Definition at line 71 of file game_version_dialog.hpp.

Constructor & Destructor Documentation

◆ game_version()

gui2::dialogs::game_version::game_version ( )

Member Function Documentation

◆ browse_directory_callback()

void gui2::dialogs::game_version::browse_directory_callback ( const std::string &  path)
private

Callback function for browse-directory action buttons.

Parameters
pathFilesystem path associated with the widget.

Definition at line 256 of file game_version_dialog.cpp.

References desktop::open_object().

Referenced by pre_show().

◆ copy_to_clipboard_callback()

void gui2::dialogs::game_version::copy_to_clipboard_callback ( const std::string &  path)
private

Callback function for copy-to-clipboard action buttons.

Parameters
pathFilesystem path associated with the widget.

Definition at line 261 of file game_version_dialog.cpp.

References desktop::clipboard::copy_to_clipboard().

Referenced by pre_show().

◆ generate_plain_text_report()

void gui2::dialogs::game_version::generate_plain_text_report ( )
private

Definition at line 271 of file game_version_dialog.cpp.

References game_config::full_build_report(), and report_.

◆ pre_show()

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

◆ report_copy_callback()

void gui2::dialogs::game_version::report_copy_callback ( )
private

Callback function for the dialog-wide copy-to-clipboard button.

Definition at line 266 of file game_version_dialog.cpp.

References desktop::clipboard::copy_to_clipboard(), and report_.

Referenced by pre_show().

◆ tab_switch_callback()

void gui2::dialogs::game_version::tab_switch_callback ( )
private

Callback function called when switching tabs.

Definition at line 246 of file game_version_dialog.cpp.

References gui2::dialogs::modal_dialog::get_window(), and gui2::stacked_widget::select_layer().

Referenced by pre_show().

◆ window_id()

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

The id of the window to build.

Implements gui2::dialogs::modal_dialog.

Member Data Documentation

◆ browse_wid_stem_

const std::string gui2::dialogs::game_version::browse_wid_stem_
private

Definition at line 63 of file game_version_dialog.hpp.

Referenced by pre_show().

◆ copy_wid_stem_

const std::string gui2::dialogs::game_version::copy_wid_stem_
private

Definition at line 62 of file game_version_dialog.hpp.

Referenced by pre_show().

◆ deps_

std::vector<deplist_entry> gui2::dialogs::game_version::deps_
private

Definition at line 72 of file game_version_dialog.hpp.

Referenced by pre_show().

◆ opts_

std::vector<game_config::optional_feature> gui2::dialogs::game_version::opts_
private

Definition at line 74 of file game_version_dialog.hpp.

Referenced by pre_show().

◆ path_map_

std::map<std::string, std::string> gui2::dialogs::game_version::path_map_
private

Definition at line 65 of file game_version_dialog.hpp.

Referenced by pre_show().

◆ path_wid_stem_

const std::string gui2::dialogs::game_version::path_wid_stem_
private

The display function.

See modal_dialog for more information.

Definition at line 61 of file game_version_dialog.hpp.

Referenced by pre_show().

◆ report_

std::string gui2::dialogs::game_version::report_
private

Definition at line 76 of file game_version_dialog.hpp.

Referenced by generate_plain_text_report(), and report_copy_callback().


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