Unsaved Changes : implemented "move" and improved "save"

UnsavedChangesDialog : some code refactoring

SavePresetDialog : processed empty name for the preset
This commit is contained in:
YuSanka 2020-08-13 15:45:16 +02:00
parent 491e7b16f9
commit d7176c64bd
5 changed files with 90 additions and 84 deletions

View file

@ -1123,10 +1123,12 @@ void SavePresetDialog::Item::update()
info_line = _L("Cannot overwrite a system profile.");
m_valid_type = NoValid;
}
if (m_valid_type == Valid && existing && (existing->is_external)) {
info_line = _L("Cannot overwrite an external profile.");
m_valid_type = NoValid;
}
if (m_valid_type == Valid && existing && m_preset_name != m_presets->get_selected_preset_name())
{
info_line = from_u8((boost::format(_u8L("Preset with name \"%1%\" already exists.")) % m_preset_name).str()) + "\n" +
@ -1134,6 +1136,11 @@ void SavePresetDialog::Item::update()
m_valid_type = Warning;
}
if (m_valid_type == Valid && m_preset_name.empty()) {
info_line = _L("The empty name is not available.");
m_valid_type = NoValid;
}
m_valid_label->SetLabel(info_line);
m_valid_label->Show(!info_line.IsEmpty());