16 #define GETTEXT_DOMAIN "wesnoth-lib" 44 , clean_button_(
nullptr)
45 , purge_button_(
nullptr)
46 , size_label_(
nullptr)
52 clean_button_ = find_widget<button>(&window,
"clean",
false,
true);
53 purge_button_ = find_widget<button>(&window,
"purge",
false,
true);
54 size_label_ = find_widget<label>(&window,
"size",
false,
true);
58 text_box_base& path_box = find_widget<text_box_base>(&window,
"path",
false);
62 button& copy = find_widget<button>(&window,
"copy",
false);
68 copy.
set_tooltip(
_(
"Clipboard support not found, contact your packager"));
71 button& browse = find_widget<button>(&window,
"browse",
false);
126 _(
"The game data cache has been cleaned."));
145 _(
"The game data cache has been purged."));
#define REGISTER_DIALOG(window_id)
Wrapper for REGISTER_DIALOG2.
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
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.
static config_cache & instance()
Get reference to the singleton object.
Abstract base class for text items.
bool available()
Whether wesnoth was compiled with support for a clipboard.
std::string cache_path_
The display function.
void connect_signal_mouse_left_click(dispatcher &dispatcher, const signal &signal)
Connects a signal handler for a left mouse button click.
void copy_to_clipboard_callback()
static std::string _(const char *str)
Desktop environment interaction functions.
void purge_cache_callback()
std::size_t size(const std::string &str)
Length in characters of a UTF-8 string.
void clean_cache_callback()
void update_cache_size_display()
This file contains the settings handling of the widget library.
std::string si_string(double input, bool base2, const std::string &unit)
Convert into a string with an SI-postfix.
bool clean_cache()
Deletes stale cache files not in use by the game.
void browse_cache_callback()
A Preferences subdialog including a report on the location and size of the game's WML cache...
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.
Declarations for File-IO.
virtual void set_value(const std::string &text)
The set_value is virtual for the password_box class.
void copy_to_clipboard(const std::string &text, const bool)
Copies text to the clipboard.
void show_error_message(const std::string &msg, bool message_use_markup)
Shows an error message to the user.
base class of top level items, the only item which needs to store the final canvases to draw on...
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
virtual void set_active(const bool active) override
See styled_widget::set_active.
bool purge_cache()
Deletes all cache files.