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

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17531


(cherry picked from commit db12f2af49)

ce625541 Disallow cross-probing when not on Symbol Fields Table Edit tab.
This commit is contained in:
dsa-t 2024-03-21 19:08:23 +00:00
parent a3ee317277
commit 605fe4ce99
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 ) 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 // 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 // containing the list of all child refs. Make sure we add refs/symbols uniquely
std::set<SCH_REFERENCE> refs; std::set<SCH_REFERENCE> refs;
@ -1063,10 +1067,10 @@ void DIALOG_SYMBOL_FIELDS_TABLE::OnTableRangeSelected( wxGridRangeSelectEvent& a
if( refs.size() > 0 ) 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(); 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, editor->FindSymbolAndItem( &symbol_path, nullptr, true, HIGHLIGHT_SYMBOL,
wxEmptyString ); wxEmptyString );
} }

View File

@ -2348,8 +2348,18 @@ int SCH_EDITOR_CONTROL::ExportNetlist( const TOOL_EVENT& aEvent )
int SCH_EDITOR_CONTROL::GenerateBOM( const TOOL_EVENT& aEvent ) int SCH_EDITOR_CONTROL::GenerateBOM( const TOOL_EVENT& aEvent )
{ {
EditSymbolFields( aEvent ); DIALOG_SYMBOL_FIELDS_TABLE* dlg = m_frame->GetSymbolFieldsTableDialog();
m_frame->GetSymbolFieldsTableDialog()->ShowExportTab();
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; return 0;
} }