mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-17 03:37:54 -06:00
Suppress to save the preset with the name started/ended with space character (related to #5291)
This commit is contained in:
parent
9892394eb0
commit
bbb56e516e
1 changed files with 10 additions and 0 deletions
|
@ -143,6 +143,16 @@ void SavePresetDialog::Item::update()
|
||||||
m_valid_type = NoValid;
|
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->SetLabel(info_line);
|
||||||
m_valid_label->Show(!info_line.IsEmpty());
|
m_valid_label->Show(!info_line.IsEmpty());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue