Disallow cross-probing when not on Symbol Fields Table Edit tab.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17531
This commit is contained in:
dsa-t 2024-03-21 19:08:23 +00:00
parent b285545aee
commit db12f2af49
2 changed files with 18 additions and 4 deletions

View File

@ -1039,6 +1039,10 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnTableCellClick( wxGridEvent& event )
void DIALOG_SYMBOL_FIELDS_TABLE::OnTableRangeSelected( wxGridRangeSelectEvent& aEvent )
{
// Cross-probing should only work in Edit page
if( m_nbPages->GetSelection() != 0 )
return;
// Multi-select can grab the rows that are expanded child refs, and also the row
// containing the list of all child refs. Make sure we add refs/symbols uniquely
std::set<SCH_REFERENCE> refs;
@ -1063,10 +1067,10 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnTableRangeSelected( wxGridRangeSelectEvent& a
if( refs.size() > 0 )
{
// Use of full path based on UUID allows select of not yet annotated or duplicaded symbols
// Use of full path based on UUID allows select of not yet annotated or duplicated symbols
wxString symbol_path = refs.begin()->GetFullPath();
// Focus only handles on item at this time
// Focus only handles one item at this time
editor->FindSymbolAndItem( &symbol_path, nullptr, true, HIGHLIGHT_SYMBOL,
wxEmptyString );
}

View File

@ -2339,8 +2339,18 @@ int SCH_EDITOR_CONTROL::ExportNetlist( const TOOL_EVENT& aEvent )
int SCH_EDITOR_CONTROL::GenerateBOM( const TOOL_EVENT& aEvent )
{
EditSymbolFields( aEvent );
m_frame->GetSymbolFieldsTableDialog()->ShowExportTab();
DIALOG_SYMBOL_FIELDS_TABLE* dlg = m_frame->GetSymbolFieldsTableDialog();
wxCHECK( dlg, 0 );
// Needed at least on Windows. Raise() is not enough
dlg->Show( true );
// Bring it to the top if already open. Dual monitor users need this.
dlg->Raise();
dlg->ShowExportTab();
return 0;
}