From 605fe4ce9902d8e19912de7db79bfc96e14cbf72 Mon Sep 17 00:00:00 2001 From: dsa-t Date: Thu, 21 Mar 2024 19:08:23 +0000 Subject: [PATCH] Disallow cross-probing when not on Symbol Fields Table Edit tab. Fixes https://gitlab.com/kicad/code/kicad/-/issues/17531 (cherry picked from commit db12f2af49eccfea4fbdb21ce914f6db4319c19c) ce625541 Disallow cross-probing when not on Symbol Fields Table Edit tab. --- eeschema/dialogs/dialog_symbol_fields_table.cpp | 8 ++++++-- eeschema/tools/sch_editor_control.cpp | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/eeschema/dialogs/dialog_symbol_fields_table.cpp b/eeschema/dialogs/dialog_symbol_fields_table.cpp index 59840f233e..7cf70051a6 100644 --- a/eeschema/dialogs/dialog_symbol_fields_table.cpp +++ b/eeschema/dialogs/dialog_symbol_fields_table.cpp @@ -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 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 ); } diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 34b4b7ae6a..ac901646fc 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -2348,8 +2348,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; }