16 #define GETTEXT_DOMAIN "wesnoth-lib"
32 #include <boost/filesystem/path.hpp>
47 , screenshot_(std::move(screenshot))
55 text_box& path_box = find_widget<text_box>(
"path");
60 std::placeholders::_3, std::placeholders::_5));
64 button& copy_b = find_widget<button>(
"copy");
69 button& open_b = find_widget<button>(
"open");
74 button& bdir_b = find_widget<button>(
"browse_dir");
80 button& save_b = find_widget<button>(
"save");
86 text_box& path_box = find_widget<text_box>(
"path");
96 "Try to save the screenshot as PNG instead."));
100 "Make sure there is enough space on the drive holding Wesnoth’s player resource files and that file permissions are set up correctly."));
102 throw std::logic_error(
"Unexpected error while trying to save a screenshot");
105 find_widget<button>(
"open").set_active(
true);
106 find_widget<button>(
"save").set_active(
false);
107 find_widget<button>(
"copy").set_active(
true);
111 find_widget<label>(
"filesize").set_label(sizetext);
117 if(key == SDLK_RETURN || key == SDLK_KP_ENTER) {
Abstract base class for all modal dialogs.
const std::string screenshots_dir_path_
void keypress_callback(bool &handled, const SDL_Keycode key)
virtual void pre_show() override
Actions to be taken before showing the window.
std::string path_
The display function.
std::string get_value() const
void set_selection(std::size_t start, int length)
Sets or clears the text selection.
const std::string & text() const
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.
A widget that allows the user to input text in single line.
void set_enter_disabled(const bool enter_disabled)
Disable the enter key.
void keyboard_capture(widget *widget)
Declarations for File-IO.
static std::string _(const char *str)
void copy_to_clipboard(const std::string &text)
Copies text to the clipboard.
bool open_object([[maybe_unused]] const std::string &path_or_url)
std::string base_name(const std::string &file, const bool remove_extension)
Returns the base filename of a file, with directory name stripped.
int file_size(const std::string &fname)
Returns the size of a file, or -1 if the file doesn't exist.
std::string get_screenshot_dir()
const std::string unicode_em_dash
REGISTER_DIALOG(editor_edit_unit)
void connect_signal_pre_key_press(dispatcher &dispatcher, const signal_keyboard &signal)
Connects the signal for 'snooping' on the keypress.
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.
save_result save_image(const locator &i_locator, const std::string &filename)
std::string dsgettext(const char *domainname, const char *msgid)
std::string si_string(double input, bool base2, const std::string &unit)
Convert into a string with an SI-postfix.
Desktop environment interaction functions.
std::string filename
Filename.