Fix a ternary op type error in Tab

Fix #2668
Fix #2676
This commit is contained in:
Vojtech Kral 2019-07-26 13:52:51 +02:00
parent 26c2b16f61
commit ba21d606af

View File

@ -915,12 +915,18 @@ void Tab::update_preset_description_line()
const Preset* parent = m_presets->get_selected_preset_parent(); const Preset* parent = m_presets->get_selected_preset_parent();
const Preset& preset = m_presets->get_edited_preset(); const Preset& preset = m_presets->get_edited_preset();
wxString description_line = preset.is_default ? wxString description_line;
_(L("It's a default preset.")) : preset.is_system ?
_(L("It's a system preset.")) : if (preset.is_default) {
wxString::Format(_(L("Current preset is inherited from %s")), (parent == nullptr ? description_line = _(L("This is a default preset."));
_(L("default preset"))+"." : } else if (preset.is_system) {
":\n\t" + parent->name)); description_line = _(L("This is a system preset."));
} else if (parent == nullptr) {
description_line = _(L("Current preset is inherited from the default preset."));
} else {
description_line = wxString::Format(
_(L("Current preset is inherited from:\n\t%s")), GUI::from_u8(parent->name));
}
if (preset.is_default || preset.is_system) if (preset.is_default || preset.is_system)
description_line += "\n\t" + _(L("It can't be deleted or modified.")) + description_line += "\n\t" + _(L("It can't be deleted or modified.")) +