16 #define GETTEXT_DOMAIN "wesnoth-lib"
45 , clean_button_(
nullptr)
46 , purge_button_(
nullptr)
47 , size_label_(
nullptr)
63 button& copy = find_widget<button>(&
window,
"copy",
false);
69 copy.
set_tooltip(
_(
"Clipboard support not found, contact your packager"));
72 button& browse = find_widget<button>(&
window,
"browse",
false);
127 _(
"The game data cache has been cleaned."));
146 _(
"The game data cache has been purged."));
bool purge_cache()
Deletes all cache files.
static config_cache & instance()
Get reference to the singleton object.
bool clean_cache()
Deletes stale cache files not in use by the game.
A Preferences subdialog including a report on the location and size of the game's WML cache,...
void copy_to_clipboard_callback()
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
void clean_cache_callback()
void purge_cache_callback()
void update_cache_size_display()
void browse_cache_callback()
std::string cache_path_
The display function.
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
Abstract base class for all modal dialogs.
Abstract base class for text items.
virtual void set_value(const std::string &text)
The set_value is virtual for the password_box class.
virtual void set_active(const bool active) override
See styled_widget::set_active.
base class of top level items, the only item which needs to store the final canvases to draw on.
Declarations for File-IO.
static std::string _(const char *str)
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
void copy_to_clipboard(const std::string &text, const bool)
Copies text to the clipboard.
bool available()
Whether wesnoth was compiled with support for a clipboard.
bool open_object([[maybe_unused]] const std::string &path_or_url)
std::string get_cache_dir()
int dir_size(const std::string &pname)
Returns the sum of the sizes of the files contained in a directory.
void connect_signal_mouse_left_click(dispatcher &dispatcher, const signal &signal)
Connects a signal handler for a left mouse button click.
void show_error_message(const std::string &msg, bool message_use_markup)
Shows an error message to the user.
void show_message(const std::string &title, const std::string &msg, const std::string &button_caption, const bool auto_close, const bool message_use_markup, const bool title_use_markup)
Shows a message to the user.
std::size_t size(const std::string &str)
Length in characters of a UTF-8 string.
std::string si_string(double input, bool base2, const std::string &unit)
Convert into a string with an SI-postfix.
Desktop environment interaction functions.
This file contains the settings handling of the widget library.