From bbb76a0de09869f576c546547a40a1bda9845b74 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 19 Aug 2018 11:56:18 +0100 Subject: [PATCH] Initialize filters with current values. Fixes: lp:1787403 * https://bugs.launchpad.net/kicad/+bug/1787403 --- .../dialog_global_edit_tracks_and_vias.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp index f895187c5e..2cf500ce02 100644 --- a/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp +++ b/pcbnew/dialogs/dialog_global_edit_tracks_and_vias.cpp @@ -61,6 +61,7 @@ private: void visitItem( PICKED_ITEMS_LIST* aUndoList, TRACK* aItem ); void processItem( PICKED_ITEMS_LIST* aUndoList, TRACK* aItem ); + bool TransferDataToWindow() override; bool TransferDataFromWindow() override; void OnUpdateUI( wxUpdateUIEvent& event ) override; @@ -210,6 +211,21 @@ void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::buildNetclassesGrid() } +bool DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataToWindow() +{ + auto item = dynamic_cast( m_parent->GetCurItem() ); + + if( item ) + { + m_netFilter->SetStringSelection( item->GetNetname() ); + m_netclassFilter->SetStringSelection( item->GetNet()->GetClassName() ); + m_layerFilter->SetLayerSelection( item->GetLayer() ); + } + + return true; +} + + void DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::OnUpdateUI( wxUpdateUIEvent& ) { m_trackWidthSelectBox->Enable( m_setToSpecifiedValues->GetValue() );