From 94ef2781bf880cea2bf658079b20c8c3aedbe79e Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 14 Aug 2020 19:37:36 +0100 Subject: [PATCH] Allow case-insensitive filtering and filter on keystrokes. Fixes https://gitlab.com/kicad/code/kicad/issues/5177 --- pcbnew/dialogs/dialog_copper_zones.cpp | 8 ++++---- pcbnew/dialogs/dialog_copper_zones_base.cpp | 4 ++++ pcbnew/dialogs/dialog_copper_zones_base.fbp | 2 ++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pcbnew/dialogs/dialog_copper_zones.cpp b/pcbnew/dialogs/dialog_copper_zones.cpp index 6e4d12bf23..11aac57532 100644 --- a/pcbnew/dialogs/dialog_copper_zones.cpp +++ b/pcbnew/dialogs/dialog_copper_zones.cpp @@ -536,17 +536,17 @@ void DIALOG_COPPER_ZONE::buildAvailableListOfNets() if( m_NetFiltering ) { - wxString doNotShowFilter = m_DoNotShowNetNameFilter->GetValue(); - wxString ShowFilter = m_ShowNetNameFilter->GetValue(); + wxString doNotShowFilter = m_DoNotShowNetNameFilter->GetValue().Lower(); + wxString ShowFilter = m_ShowNetNameFilter->GetValue().Lower(); for( unsigned ii = 0; ii < listNetName.GetCount(); ii++ ) { - if( listNetName[ii].Matches( doNotShowFilter ) ) + if( listNetName[ii].Lower().Matches( doNotShowFilter ) ) { listNetName.RemoveAt( ii ); ii--; } - else if( !listNetName[ii].Matches( ShowFilter ) ) + else if( !listNetName[ii].Lower().Matches( ShowFilter ) ) { listNetName.RemoveAt( ii ); ii--; diff --git a/pcbnew/dialogs/dialog_copper_zones_base.cpp b/pcbnew/dialogs/dialog_copper_zones_base.cpp index b837a28a12..4dc5e35be9 100644 --- a/pcbnew/dialogs/dialog_copper_zones_base.cpp +++ b/pcbnew/dialogs/dialog_copper_zones_base.cpp @@ -410,7 +410,9 @@ DIALOG_COPPER_ZONE_BASE::DIALOG_COPPER_ZONE_BASE( wxWindow* parent, wxWindowID i this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_COPPER_ZONE_BASE::OnClose ) ); this->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_COPPER_ZONE_BASE::OnUpdateUI ) ); m_layers->Connect( wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, wxDataViewEventHandler( DIALOG_COPPER_ZONE_BASE::OnLayerSelection ), NULL, this ); + m_DoNotShowNetNameFilter->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnRunFiltersButtonClick ), NULL, this ); m_DoNotShowNetNameFilter->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnRunFiltersButtonClick ), NULL, this ); + m_ShowNetNameFilter->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnRunFiltersButtonClick ), NULL, this ); m_ShowNetNameFilter->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnRunFiltersButtonClick ), NULL, this ); m_buttonRunFilter->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnRunFiltersButtonClick ), NULL, this ); m_showAllNetsOpt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnNetSortingOptionSelected ), NULL, this ); @@ -426,7 +428,9 @@ DIALOG_COPPER_ZONE_BASE::~DIALOG_COPPER_ZONE_BASE() this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_COPPER_ZONE_BASE::OnClose ) ); this->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_COPPER_ZONE_BASE::OnUpdateUI ) ); m_layers->Disconnect( wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, wxDataViewEventHandler( DIALOG_COPPER_ZONE_BASE::OnLayerSelection ), NULL, this ); + m_DoNotShowNetNameFilter->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnRunFiltersButtonClick ), NULL, this ); m_DoNotShowNetNameFilter->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnRunFiltersButtonClick ), NULL, this ); + m_ShowNetNameFilter->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnRunFiltersButtonClick ), NULL, this ); m_ShowNetNameFilter->Disconnect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnRunFiltersButtonClick ), NULL, this ); m_buttonRunFilter->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnRunFiltersButtonClick ), NULL, this ); m_showAllNetsOpt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_COPPER_ZONE_BASE::OnNetSortingOptionSelected ), NULL, this ); diff --git a/pcbnew/dialogs/dialog_copper_zones_base.fbp b/pcbnew/dialogs/dialog_copper_zones_base.fbp index b826fd360e..306f2c2678 100644 --- a/pcbnew/dialogs/dialog_copper_zones_base.fbp +++ b/pcbnew/dialogs/dialog_copper_zones_base.fbp @@ -318,6 +318,7 @@ + OnRunFiltersButtonClick OnRunFiltersButtonClick @@ -444,6 +445,7 @@ + OnRunFiltersButtonClick OnRunFiltersButtonClick