Don't rely on HasConversion() for Symbol Properties in Symbol Editor.
Fixes https://gitlab.com/kicad/code/kicad/issues/11200
This commit is contained in:
parent
7659f3c81b
commit
2681ad6cfc
|
@ -88,10 +88,10 @@ bool DIALOG_LIB_SHAPE_PROPERTIES::TransferDataToWindow()
|
|||
|
||||
bool enblConvOptStyle = symbol && symbol->HasConversion();
|
||||
|
||||
// if a symbol contains no graphic items, symbol->HasConversion() returns false.
|
||||
// but when creating a new symbol, with DeMorgan option set, the ApplyToAllConversions
|
||||
// must be enabled even if symbol->HasConversion() returns false in order to be able
|
||||
// to create graphic items shared by all body styles
|
||||
// If a symbol contains no conversion-specific pins or graphic items, symbol->HasConversion()
|
||||
// will return false.
|
||||
// But when creating a new symbol, with DeMorgan option set, the ApplyToAllConversions
|
||||
// must be enabled in order to be able to create graphic items shared by all body styles.
|
||||
if( m_frame->GetShowDeMorgan() )
|
||||
enblConvOptStyle = true;
|
||||
|
||||
|
|
|
@ -172,7 +172,13 @@ bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataToWindow()
|
|||
m_SelNumberOfUnits->SetValue( m_libEntry->GetUnitCount() );
|
||||
m_OptionPartsInterchangeable->SetValue( !m_libEntry->UnitsLocked() ||
|
||||
m_libEntry->GetUnitCount() == 1 );
|
||||
m_AsConvertButt->SetValue( m_libEntry->HasConversion() );
|
||||
|
||||
// If a symbol contains no conversion-specific pins or graphic items, symbol->HasConversion()
|
||||
// will return false. But when editing a symbol with DeMorgan option set, we don't want to
|
||||
// keep turning it off just because there aren't any conversion-specific items yet, so we force
|
||||
// it to on if the parent frame has it enabled.
|
||||
m_AsConvertButt->SetValue( m_Parent->GetShowDeMorgan() );
|
||||
|
||||
m_OptionPower->SetValue( m_libEntry->IsPower() );
|
||||
m_excludeFromBomCheckBox->SetValue( !m_libEntry->GetIncludeInBom() );
|
||||
m_excludeFromBoardCheckBox->SetValue( !m_libEntry->GetIncludeOnBoard() );
|
||||
|
@ -365,6 +371,7 @@ bool DIALOG_LIB_SYMBOL_PROPERTIES::TransferDataFromWindow()
|
|||
m_libEntry->LockUnits( m_libEntry->GetUnitCount() > 1 &&
|
||||
!m_OptionPartsInterchangeable->GetValue() );
|
||||
m_libEntry->SetConversion( m_AsConvertButt->GetValue() );
|
||||
m_Parent->SetShowDeMorgan( m_AsConvertButt->GetValue() );
|
||||
|
||||
if( m_OptionPower->GetValue() )
|
||||
m_libEntry->SetPower();
|
||||
|
|
Loading…
Reference in New Issue