mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-16 17:35:52 +08:00
SavePresetDialog: Check max path length for input preset name
+ Add default suffix for "Palette 1" for mode markers
This commit is contained in:
parent
b90e109b41
commit
dffca9c54a
@ -18,7 +18,7 @@ namespace GUI {
|
|||||||
//static ModePaletteComboBox::PalettesMap MODE_PALETTES =
|
//static ModePaletteComboBox::PalettesMap MODE_PALETTES =
|
||||||
static std::vector<std::pair<std::string, std::vector<std::string>>> MODE_PALETTES =
|
static std::vector<std::pair<std::string, std::vector<std::string>>> MODE_PALETTES =
|
||||||
{
|
{
|
||||||
{ L("Palette 1"), { "#7DF028", "#FFDC00", "#E70000" } },
|
{ L("Palette 1 (default)"), { "#7DF028", "#FFDC00", "#E70000" } },
|
||||||
{ L("Palette 2"), { "#FC766A", "#B0B8B4", "#184A45" } },
|
{ L("Palette 2"), { "#FC766A", "#B0B8B4", "#184A45" } },
|
||||||
{ L("Palette 3"), { "#567572", "#964F4C", "#696667" } },
|
{ L("Palette 3"), { "#567572", "#964F4C", "#696667" } },
|
||||||
{ L("Palette 4"), { "#DA291C", "#56A8CB", "#53A567" } },
|
{ L("Palette 4"), { "#DA291C", "#56A8CB", "#53A567" } },
|
||||||
|
@ -185,6 +185,17 @@ void SavePresetDialog::Item::update()
|
|||||||
m_valid_type = ValidationType::NoValid;
|
m_valid_type = ValidationType::NoValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
const int max_path_length = MAX_PATH;
|
||||||
|
#else
|
||||||
|
const int max_path_length = 255;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (m_valid_type == ValidationType::Valid && m_presets->path_from_name(m_preset_name).length() >= max_path_length) {
|
||||||
|
info_line = _L("The name is too long.");
|
||||||
|
m_valid_type = ValidationType::NoValid;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_valid_type == ValidationType::Valid && m_preset_name.find_first_of(' ') == 0) {
|
if (m_valid_type == ValidationType::Valid && m_preset_name.find_first_of(' ') == 0) {
|
||||||
info_line = _L("The name cannot start with space character.");
|
info_line = _L("The name cannot start with space character.");
|
||||||
m_valid_type = ValidationType::NoValid;
|
m_valid_type = ValidationType::NoValid;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user