Formatting.

This commit is contained in:
Jeff Young 2024-01-23 12:37:02 +00:00
parent b3a36bd783
commit 8b56b3d999
3 changed files with 20 additions and 2 deletions

View File

@ -562,8 +562,10 @@ void DIALOG_SYMBOL_FIELDS_TABLE::AddField( const wxString& aFieldName, const wxS
// Users can add fields with variable names that match the special names in the grid,
// e.g. ${QUANTITY} so make sure we don't add them twice
for( int i = 0; i < m_fieldsCtrl->GetItemCount(); i++ )
{
if( m_fieldsCtrl->GetTextValue( i, FIELD_NAME_COLUMN ) == aFieldName )
return;
}
m_dataModel->AddColumn( aFieldName, aLabelValue, addedByUser );
@ -1416,8 +1418,10 @@ void DIALOG_SYMBOL_FIELDS_TABLE::ApplyBomPreset( const BOM_PRESET& aPreset )
else
m_currentBomPreset = nullptr;
m_lastSelectedBomPreset =
( m_currentBomPreset && !m_currentBomPreset->readOnly ) ? m_currentBomPreset : nullptr;
if( m_currentBomPreset && !m_currentBomPreset->readOnly )
m_lastSelectedBomPreset = m_currentBomPreset;
else
m_lastSelectedBomPreset = nullptr;
updateBomPresetSelection( aPreset.name );
doApplyBomPreset( aPreset );
@ -1488,18 +1492,24 @@ void DIALOG_SYMBOL_FIELDS_TABLE::syncBomPresetSelection()
&& preset.filterString == current.filterString
&& preset.groupSymbols == current.groupSymbols
&& preset.excludeDNP == current.excludeDNP ) )
{
return false;
}
// Only compare shown or grouped fields
std::vector<BOM_FIELD> A, B;
for( const BOM_FIELD& field : preset.fieldsOrdered )
{
if( field.show || field.groupBy )
A.emplace_back( field );
}
for( const BOM_FIELD& field : current.fieldsOrdered )
{
if( field.show || field.groupBy )
B.emplace_back( field );
}
return A == B;
} );

View File

@ -43,8 +43,10 @@ void FIELDS_EDITOR_GRID_DATA_MODEL::AddColumn( const wxString& aFieldName, const
m_cols.push_back( { aFieldName, aLabel, aAddedByUser, false, false } );
for( unsigned i = 0; i < m_symbolsList.GetCount(); ++i )
{
if( SCH_SYMBOL* symbol = m_symbolsList[i].GetSymbol() )
updateDataStoreSymbolField( *symbol, aFieldName );
}
}

View File

@ -1051,14 +1051,20 @@ wxString SCH_FIELD::GetCanonicalName() const
{
// These should be stored in canonical format, but just in case:
if( m_name == _( "Net Class" ) || m_name == wxT( "Net Class" ) )
{
return wxT( "Netclass" );
}
else if( m_name == _( "Sheet References" )
|| m_name == wxT( "Sheet References" )
|| m_name == wxT( "Intersheet References" ) )
{
return wxT( "Intersheetrefs" );
}
else
{
return m_name;
}
}
else
{
if( m_parent )