From 621610da754e23771a83db455c2d182e6242ccf1 Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Sat, 12 Dec 2020 08:34:43 +0100 Subject: [PATCH] Follow up on 569200eb992975fff3f41b115a73da7326758105 Improved formatting of the vector of dimensions, improved wordings of error messages and tooltips. --- src/libslic3r/PrintConfig.cpp | 2 +- src/slic3r/GUI/Field.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 49e1d416e..8511c87e4 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -64,7 +64,7 @@ void PrintConfigDef::init_common_params() def = this->add("thumbnails", coPoints); def->label = L("G-code thumbnails"); - def->tooltip = L("Picture sizes to be stored into a .gcode and .sl1 files"); + def->tooltip = L("Picture sizes to be stored into a .gcode and .sl1 files, in the following format: \"XxY, XxY, ...\""); def->mode = comExpert; def->gui_type = "one_string"; def->set_default_value(new ConfigOptionPoints()); diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index c6f6babae..e65d87b31 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -57,9 +57,10 @@ wxString double_to_string(double const value, const int max_precision /*= 4*/) wxString get_thumbnails_string(const std::vector& values) { wxString ret_str; - if (!values.empty()) - for (auto el : values) - ret_str += wxString::Format("%ix%i, ", int(el[0]), int(el[1])); + for (size_t i = 0; i < values.size(); ++ i) { + const Vec2d& el = values[i]; + ret_str += wxString::Format((i == 0) ? "%ix%i" : ", %ix%i", int(el[0]), int(el[1])); + } return ret_str; } @@ -359,7 +360,7 @@ void Field::get_value_by_opt_type(wxString& str, const bool check_value/* = true if (!m_value.empty()) text_value = get_thumbnails_string(boost::any_cast>(m_value)); set_value(text_value, true); - show_error(m_parent, format_wxstr(_L("Invalid input format. It must be represented like \"%1%\""),"XxY, XxY, ..." )); + show_error(m_parent, format_wxstr(_L("Invalid input format. Expected vector of dimensions in the following format: \"%1%\""),"XxY, XxY, ..." )); } }