From 7075aece3a40b57866b5ec088d7042e7c0f8a1bd Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Thu, 12 Aug 2021 21:19:27 -0400 Subject: [PATCH] Hint to user when pin scope control has no effect Fixes https://gitlab.com/kicad/code/kicad/-/issues/8907 --- eeschema/dialogs/dialog_pin_properties.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/eeschema/dialogs/dialog_pin_properties.cpp b/eeschema/dialogs/dialog_pin_properties.cpp index 415b37605c..576bf10fe4 100644 --- a/eeschema/dialogs/dialog_pin_properties.cpp +++ b/eeschema/dialogs/dialog_pin_properties.cpp @@ -254,6 +254,22 @@ bool DIALOG_PIN_PROPERTIES::TransferDataToWindow() m_dummyPin->SetVisible( m_pin->IsVisible() ); + bool hasMultiUnit = m_pin->GetParent()->GetUnitCount() > 1; + bool enableUnitScope = m_pin->GetParent()->UnitsLocked(); + + m_checkApplyToAllParts->Enable( !m_frame->m_SyncPinEdit && enableUnitScope && hasMultiUnit ); + + wxString toolTip; + + if( !hasMultiUnit ) + toolTip = _( "This symbol only has one unit. This control has no effect." ); + else if( m_frame->m_SyncPinEdit ) + toolTip = _( "Synchronized pin edit mode is enabled. This control has no effect." ); + else if( !enableUnitScope ) + toolTip = _( "All units in this symbol are interchangeable. This control has no effect." ); + + m_checkApplyToAllParts->SetToolTip( toolTip ); + for( const std::pair& alt : m_pin->GetAlternates() ) m_alternatesDataModel->AppendRow( alt.second );