Formatting.
This commit is contained in:
parent
b3a36bd783
commit
8b56b3d999
|
@ -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,
|
// 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
|
// e.g. ${QUANTITY} so make sure we don't add them twice
|
||||||
for( int i = 0; i < m_fieldsCtrl->GetItemCount(); i++ )
|
for( int i = 0; i < m_fieldsCtrl->GetItemCount(); i++ )
|
||||||
|
{
|
||||||
if( m_fieldsCtrl->GetTextValue( i, FIELD_NAME_COLUMN ) == aFieldName )
|
if( m_fieldsCtrl->GetTextValue( i, FIELD_NAME_COLUMN ) == aFieldName )
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
m_dataModel->AddColumn( aFieldName, aLabelValue, addedByUser );
|
m_dataModel->AddColumn( aFieldName, aLabelValue, addedByUser );
|
||||||
|
|
||||||
|
@ -1416,8 +1418,10 @@ void DIALOG_SYMBOL_FIELDS_TABLE::ApplyBomPreset( const BOM_PRESET& aPreset )
|
||||||
else
|
else
|
||||||
m_currentBomPreset = nullptr;
|
m_currentBomPreset = nullptr;
|
||||||
|
|
||||||
m_lastSelectedBomPreset =
|
if( m_currentBomPreset && !m_currentBomPreset->readOnly )
|
||||||
( m_currentBomPreset && !m_currentBomPreset->readOnly ) ? m_currentBomPreset : nullptr;
|
m_lastSelectedBomPreset = m_currentBomPreset;
|
||||||
|
else
|
||||||
|
m_lastSelectedBomPreset = nullptr;
|
||||||
|
|
||||||
updateBomPresetSelection( aPreset.name );
|
updateBomPresetSelection( aPreset.name );
|
||||||
doApplyBomPreset( aPreset );
|
doApplyBomPreset( aPreset );
|
||||||
|
@ -1488,18 +1492,24 @@ void DIALOG_SYMBOL_FIELDS_TABLE::syncBomPresetSelection()
|
||||||
&& preset.filterString == current.filterString
|
&& preset.filterString == current.filterString
|
||||||
&& preset.groupSymbols == current.groupSymbols
|
&& preset.groupSymbols == current.groupSymbols
|
||||||
&& preset.excludeDNP == current.excludeDNP ) )
|
&& preset.excludeDNP == current.excludeDNP ) )
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Only compare shown or grouped fields
|
// Only compare shown or grouped fields
|
||||||
std::vector<BOM_FIELD> A, B;
|
std::vector<BOM_FIELD> A, B;
|
||||||
|
|
||||||
for( const BOM_FIELD& field : preset.fieldsOrdered )
|
for( const BOM_FIELD& field : preset.fieldsOrdered )
|
||||||
|
{
|
||||||
if( field.show || field.groupBy )
|
if( field.show || field.groupBy )
|
||||||
A.emplace_back( field );
|
A.emplace_back( field );
|
||||||
|
}
|
||||||
|
|
||||||
for( const BOM_FIELD& field : current.fieldsOrdered )
|
for( const BOM_FIELD& field : current.fieldsOrdered )
|
||||||
|
{
|
||||||
if( field.show || field.groupBy )
|
if( field.show || field.groupBy )
|
||||||
B.emplace_back( field );
|
B.emplace_back( field );
|
||||||
|
}
|
||||||
|
|
||||||
return A == B;
|
return A == B;
|
||||||
} );
|
} );
|
||||||
|
|
|
@ -43,8 +43,10 @@ void FIELDS_EDITOR_GRID_DATA_MODEL::AddColumn( const wxString& aFieldName, const
|
||||||
m_cols.push_back( { aFieldName, aLabel, aAddedByUser, false, false } );
|
m_cols.push_back( { aFieldName, aLabel, aAddedByUser, false, false } );
|
||||||
|
|
||||||
for( unsigned i = 0; i < m_symbolsList.GetCount(); ++i )
|
for( unsigned i = 0; i < m_symbolsList.GetCount(); ++i )
|
||||||
|
{
|
||||||
if( SCH_SYMBOL* symbol = m_symbolsList[i].GetSymbol() )
|
if( SCH_SYMBOL* symbol = m_symbolsList[i].GetSymbol() )
|
||||||
updateDataStoreSymbolField( *symbol, aFieldName );
|
updateDataStoreSymbolField( *symbol, aFieldName );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1051,14 +1051,20 @@ wxString SCH_FIELD::GetCanonicalName() const
|
||||||
{
|
{
|
||||||
// These should be stored in canonical format, but just in case:
|
// These should be stored in canonical format, but just in case:
|
||||||
if( m_name == _( "Net Class" ) || m_name == wxT( "Net Class" ) )
|
if( m_name == _( "Net Class" ) || m_name == wxT( "Net Class" ) )
|
||||||
|
{
|
||||||
return wxT( "Netclass" );
|
return wxT( "Netclass" );
|
||||||
|
}
|
||||||
else if( m_name == _( "Sheet References" )
|
else if( m_name == _( "Sheet References" )
|
||||||
|| m_name == wxT( "Sheet References" )
|
|| m_name == wxT( "Sheet References" )
|
||||||
|| m_name == wxT( "Intersheet References" ) )
|
|| m_name == wxT( "Intersheet References" ) )
|
||||||
|
{
|
||||||
return wxT( "Intersheetrefs" );
|
return wxT( "Intersheetrefs" );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
return m_name;
|
return m_name;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( m_parent )
|
if( m_parent )
|
||||||
|
|
Loading…
Reference in New Issue