Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuSanka <yusanka@gmail.com>2020-12-09 15:16:03 +0300
committerYuSanka <yusanka@gmail.com>2020-12-09 15:16:03 +0300
commitbbb56e516e89eb31d7ff3b80ee21230406087e1c (patch)
treebace053f08c61f4b1a6570fe7642fc952a4ff605
parent9892394eb036efd57400751a1e495b7e60f40554 (diff)
Suppress to save the preset with the name started/ended with space character (related to #5291)
-rw-r--r--src/slic3r/GUI/SavePresetDialog.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/slic3r/GUI/SavePresetDialog.cpp b/src/slic3r/GUI/SavePresetDialog.cpp
index 52af0591c..65bd3acb9 100644
--- a/src/slic3r/GUI/SavePresetDialog.cpp
+++ b/src/slic3r/GUI/SavePresetDialog.cpp
@@ -143,6 +143,16 @@ void SavePresetDialog::Item::update()
m_valid_type = NoValid;
}
+ if (m_valid_type == Valid && m_preset_name.find_first_of(' ') == 0) {
+ info_line = _L("The name cannot start with space character.");
+ m_valid_type = NoValid;
+ }
+
+ if (m_valid_type == Valid && m_preset_name.find_last_of(' ') == m_preset_name.length()-1) {
+ info_line = _L("The name cannot end with space character.");
+ m_valid_type = NoValid;
+ }
+
m_valid_label->SetLabel(info_line);
m_valid_label->Show(!info_line.IsEmpty());