16 #define GETTEXT_DOMAIN "wesnoth-lib"
32 #include <boost/filesystem/path.hpp>
46 , screenshot_(screenshot)
54 text_box& path_box = find_widget<text_box>(
"path");
59 std::placeholders::_3, std::placeholders::_5));
63 button& copy_b = find_widget<button>(
"copy");
68 button& open_b = find_widget<button>(
"open");
73 button& bdir_b = find_widget<button>(
"browse_dir");
79 button& save_b = find_widget<button>(
"save");
85 text_box& path_box = find_widget<text_box>(
"path");
95 "Try to save the screenshot as PNG instead."));
99 "Make sure there is enough space on the drive holding Wesnoth’s player resource files and that file permissions are set up correctly."));
101 throw std::logic_error(
"Unexpected error while trying to save a screenshot");
104 find_widget<button>(
"open").set_active(
true);
105 find_widget<button>(
"save").set_active(
false);
106 find_widget<button>(
"copy").set_active(
true);
110 find_widget<label>(
"filesize").set_label(sizetext);
116 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.