diff --git a/eeschema/dialogs/dialog_sim_model.cpp b/eeschema/dialogs/dialog_sim_model.cpp index 08ca27e438..05697a2aef 100644 --- a/eeschema/dialogs/dialog_sim_model.cpp +++ b/eeschema/dialogs/dialog_sim_model.cpp @@ -312,10 +312,10 @@ bool DIALOG_SIM_MODEL::TransferDataFromWindow() if( fn.MakeRelativeTo( Prj().GetProjectPath() ) && !fn.GetFullPath().StartsWith( ".." ) ) path = fn.GetFullPath(); - if( dynamic_cast( &curModel() ) ) - name = SIM_MODEL::GetFieldValue( &m_fields, SIM_LIBRARY::NAME_FIELD, false ); - else if( !m_modelNameChoice->IsEmpty() ) + if( !m_modelNameChoice->IsEmpty() ) name = m_modelNameChoice->GetStringSelection().ToStdString(); + else if( dynamic_cast( &curModel() ) ) + name = SIM_MODEL::GetFieldValue( &m_fields, SIM_LIBRARY::NAME_FIELD, false ); } SIM_MODEL::SetFieldValue( m_fields, SIM_LIBRARY::LIBRARY_FIELD, path );