Cleanup to make implementation names consistent with what they now do.
Fixes: lp:1842477 * https://bugs.launchpad.net/kicad/+bug/1842477
This commit is contained in:
parent
54a85cfaa2
commit
54255cffeb
|
@ -68,7 +68,7 @@ void FOOTPRINT_FILTER_IT::increment()
|
|||
continue;
|
||||
}
|
||||
|
||||
if( filter_type & FOOTPRINT_FILTER::FILTERING_BY_COMPONENT_KEYWORD )
|
||||
if( filter_type & FOOTPRINT_FILTER::FILTERING_BY_COMPONENT_FP_FILTER )
|
||||
{
|
||||
if( !FootprintFilterMatch( candidate ) )
|
||||
continue;
|
||||
|
@ -80,7 +80,7 @@ void FOOTPRINT_FILTER_IT::increment()
|
|||
continue;
|
||||
}
|
||||
|
||||
if( ( filter_type & FOOTPRINT_FILTER::FILTERING_BY_NAME ) )
|
||||
if( ( filter_type & FOOTPRINT_FILTER::FILTERING_BY_TEXT_PATTERN ) )
|
||||
{
|
||||
wxString searchStr = wxString::Format( wxT( "%s:%s %s" ),
|
||||
candidate.GetLibNickname(),
|
||||
|
@ -209,11 +209,11 @@ void FOOTPRINT_FILTER::FilterByFootprintFilters( const wxArrayString& aFilters )
|
|||
m_footprint_filters.back()->SetPattern( each_pattern.Lower() );
|
||||
}
|
||||
|
||||
m_filter_type |= FILTERING_BY_COMPONENT_KEYWORD;
|
||||
m_filter_type |= FILTERING_BY_COMPONENT_FP_FILTER;
|
||||
}
|
||||
|
||||
|
||||
void FOOTPRINT_FILTER::FilterByPattern( wxString const& aPattern )
|
||||
void FOOTPRINT_FILTER::FilterByTextPattern( wxString const& aPattern )
|
||||
{
|
||||
m_filter_pattern = aPattern;
|
||||
|
||||
|
@ -225,7 +225,7 @@ void FOOTPRINT_FILTER::FilterByPattern( wxString const& aPattern )
|
|||
m_pattern_filters.push_back( std::make_unique<EDA_COMBINED_MATCHER>( term ) );
|
||||
}
|
||||
|
||||
m_filter_type |= FILTERING_BY_NAME;
|
||||
m_filter_type |= FILTERING_BY_TEXT_PATTERN;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -326,12 +326,12 @@ void CVPCB_MAINFRAME::OnCloseWindow( wxCloseEvent& Event )
|
|||
void CVPCB_MAINFRAME::OnEnterFilteringText( wxCommandEvent& aEvent )
|
||||
{
|
||||
// Called when changing the filter string in main toolbar.
|
||||
// If the option FOOTPRINTS_LISTBOX::FILTERING_BY_NAME is set, update the list of
|
||||
// available footprints which match the filter
|
||||
// If the option FOOTPRINTS_LISTBOX::FILTERING_BY_TEXT_PATTERN is set, update the list
|
||||
// of available footprints which match the filter
|
||||
|
||||
m_currentSearchPattern = m_tcFilterString->GetValue();
|
||||
|
||||
if( ( m_filteringOptions & FOOTPRINTS_LISTBOX::FILTERING_BY_NAME ) == 0 )
|
||||
if(( m_filteringOptions & FOOTPRINTS_LISTBOX::FILTERING_BY_TEXT_PATTERN ) == 0 )
|
||||
return;
|
||||
|
||||
wxListEvent l_event;
|
||||
|
@ -545,14 +545,14 @@ void CVPCB_MAINFRAME::SetFootprintFilter(
|
|||
// Extract the needed information about the filter
|
||||
switch( aFilter )
|
||||
{
|
||||
case FOOTPRINTS_LISTBOX::FILTERING_BY_NAME:
|
||||
case FOOTPRINTS_LISTBOX::FILTERING_BY_TEXT_PATTERN:
|
||||
// Extract the current search patten when needed
|
||||
m_currentSearchPattern = m_tcFilterString->GetValue();
|
||||
|
||||
case FOOTPRINTS_LISTBOX::UNFILTERED_FP_LIST:
|
||||
case FOOTPRINTS_LISTBOX::FILTERING_BY_PIN_COUNT:
|
||||
case FOOTPRINTS_LISTBOX::FILTERING_BY_LIBRARY:
|
||||
case FOOTPRINTS_LISTBOX::FILTERING_BY_COMPONENT_KEYWORD:
|
||||
case FOOTPRINTS_LISTBOX::FILTERING_BY_COMPONENT_FP_FILTERS:
|
||||
option = aFilter;
|
||||
}
|
||||
|
||||
|
@ -585,7 +585,7 @@ void CVPCB_MAINFRAME::DisplayStatus()
|
|||
wxString filters, msg;
|
||||
COMPONENT* component = GetSelectedComponent();
|
||||
|
||||
if( ( m_filteringOptions & FOOTPRINTS_LISTBOX::FILTERING_BY_COMPONENT_KEYWORD ) )
|
||||
if( ( m_filteringOptions & FOOTPRINTS_LISTBOX::FILTERING_BY_COMPONENT_FP_FILTERS ) )
|
||||
{
|
||||
msg.Empty();
|
||||
|
||||
|
@ -626,7 +626,7 @@ void CVPCB_MAINFRAME::DisplayStatus()
|
|||
filters += _( "library" ) + wxString::Format( wxT( " (%s)" ), msg );
|
||||
}
|
||||
|
||||
if( ( m_filteringOptions & FOOTPRINTS_LISTBOX::FILTERING_BY_NAME ) )
|
||||
if( ( m_filteringOptions & FOOTPRINTS_LISTBOX::FILTERING_BY_TEXT_PATTERN ) )
|
||||
{
|
||||
if( !filters.IsEmpty() )
|
||||
filters += wxT( ", " );
|
||||
|
|
|
@ -148,7 +148,7 @@ void FOOTPRINTS_LISTBOX::SetFootprints( FOOTPRINT_LIST& aList, const wxString& a
|
|||
|
||||
FOOTPRINT_FILTER filter( aList );
|
||||
|
||||
if( aFilterType & FILTERING_BY_COMPONENT_KEYWORD && aComponent )
|
||||
if( aFilterType & FILTERING_BY_COMPONENT_FP_FILTERS && aComponent )
|
||||
filter.FilterByFootprintFilters( aComponent->GetFootprintFilters() );
|
||||
|
||||
if( aFilterType & FILTERING_BY_PIN_COUNT && aComponent )
|
||||
|
@ -157,8 +157,8 @@ void FOOTPRINTS_LISTBOX::SetFootprints( FOOTPRINT_LIST& aList, const wxString& a
|
|||
if( aFilterType & FILTERING_BY_LIBRARY )
|
||||
filter.FilterByLibrary( aLibName );
|
||||
|
||||
if( aFilterType & FILTERING_BY_NAME )
|
||||
filter.FilterByPattern( aFootPrintFilterPattern );
|
||||
if( aFilterType & FILTERING_BY_TEXT_PATTERN )
|
||||
filter.FilterByTextPattern( aFootPrintFilterPattern );
|
||||
|
||||
if( GetSelection() >= 0 && GetSelection() < (int)m_footprintList.GetCount() )
|
||||
oldSelection = m_footprintList[ GetSelection() ];
|
||||
|
|
|
@ -97,11 +97,11 @@ public:
|
|||
*/
|
||||
enum FP_FILTER_T: int
|
||||
{
|
||||
UNFILTERED_FP_LIST = 0,
|
||||
FILTERING_BY_COMPONENT_KEYWORD = 0x0001,
|
||||
FILTERING_BY_PIN_COUNT = 0x0002,
|
||||
FILTERING_BY_LIBRARY = 0x0004,
|
||||
FILTERING_BY_NAME = 0x0008
|
||||
UNFILTERED_FP_LIST = 0,
|
||||
FILTERING_BY_COMPONENT_FP_FILTERS = 0x0001,
|
||||
FILTERING_BY_PIN_COUNT = 0x0002,
|
||||
FILTERING_BY_LIBRARY = 0x0004,
|
||||
FILTERING_BY_TEXT_PATTERN = 0x0008
|
||||
};
|
||||
|
||||
FOOTPRINTS_LISTBOX( CVPCB_MAINFRAME* parent, wxWindowID id,
|
||||
|
|
|
@ -83,18 +83,18 @@ void CVPCB_MAINFRAME::ReCreateHToolbar()
|
|||
|
||||
void CVPCB_MAINFRAME::SyncToolbars()
|
||||
{
|
||||
#define filterActive( filt ) ( m_filteringOptions & filt )
|
||||
#define filterActive( filter ) ( m_filteringOptions & filter )
|
||||
|
||||
m_mainToolBar->Toggle( ACTIONS::undo, m_undoList.size() > 0 );
|
||||
m_mainToolBar->Toggle( ACTIONS::redo, m_redoList.size() > 0 );
|
||||
|
||||
m_mainToolBar->Toggle( CVPCB_ACTIONS::filterFPbyKeywords,
|
||||
filterActive( FOOTPRINTS_LISTBOX::FILTERING_BY_COMPONENT_KEYWORD ) );
|
||||
filterActive( FOOTPRINTS_LISTBOX::FILTERING_BY_COMPONENT_FP_FILTERS ) );
|
||||
m_mainToolBar->Toggle( CVPCB_ACTIONS::filterFPbyLibrary,
|
||||
filterActive( FOOTPRINTS_LISTBOX::FILTERING_BY_LIBRARY ) );
|
||||
filterActive( FOOTPRINTS_LISTBOX::FILTERING_BY_LIBRARY ) );
|
||||
m_mainToolBar->Toggle( CVPCB_ACTIONS::filterFPbyPin,
|
||||
filterActive( FOOTPRINTS_LISTBOX::FILTERING_BY_PIN_COUNT ) );
|
||||
filterActive( FOOTPRINTS_LISTBOX::FILTERING_BY_PIN_COUNT ) );
|
||||
m_mainToolBar->Toggle( CVPCB_ACTIONS::filterFPbyDisplayName,
|
||||
filterActive( FOOTPRINTS_LISTBOX::FILTERING_BY_NAME ) );
|
||||
filterActive( FOOTPRINTS_LISTBOX::FILTERING_BY_TEXT_PATTERN ) );
|
||||
m_mainToolBar->Refresh();
|
||||
}
|
||||
|
|
|
@ -131,7 +131,7 @@ TOOL_ACTION CVPCB_ACTIONS::filterFPbyKeywords( "cvpcb.Control.FilterFPByKeyword"
|
|||
_( "Filter by keyword" ),
|
||||
_( "Filter footprint list by schematic symbol keywords" ),
|
||||
module_filtered_list_xpm, AF_NONE,
|
||||
(void*) FOOTPRINTS_LISTBOX::FILTERING_BY_COMPONENT_KEYWORD );
|
||||
(void*) FOOTPRINTS_LISTBOX::FILTERING_BY_COMPONENT_FP_FILTERS );
|
||||
|
||||
TOOL_ACTION CVPCB_ACTIONS::filterFPbyPin( "cvpcb.Control.FilterFPByPin", AS_GLOBAL,
|
||||
0, "",
|
||||
|
@ -152,4 +152,4 @@ TOOL_ACTION CVPCB_ACTIONS::filterFPbyDisplayName( "cvpcb.Control.FilterFPByDispl
|
|||
_( "Filter by display name" ),
|
||||
_( "Filter footprint list using a partial name or a pattern" ),
|
||||
module_name_filtered_list_xpm, AF_NONE,
|
||||
(void*) FOOTPRINTS_LISTBOX::FILTERING_BY_NAME );
|
||||
(void*) FOOTPRINTS_LISTBOX::FILTERING_BY_TEXT_PATTERN );
|
||||
|
|
|
@ -74,7 +74,7 @@ public:
|
|||
* Add a pattern to filter by name, including wildcards and optionally a colon-delimited
|
||||
* library name.
|
||||
*/
|
||||
void FilterByPattern( wxString const& aPattern );
|
||||
void FilterByTextPattern( wxString const& aPattern );
|
||||
|
||||
/**
|
||||
* Inner iterator class returned by begin() and end().
|
||||
|
@ -127,11 +127,11 @@ private:
|
|||
*/
|
||||
enum FP_FILTER_T : int
|
||||
{
|
||||
UNFILTERED_FP_LIST = 0,
|
||||
FILTERING_BY_COMPONENT_KEYWORD = 0x0001,
|
||||
FILTERING_BY_PIN_COUNT = 0x0002,
|
||||
FILTERING_BY_LIBRARY = 0x0004,
|
||||
FILTERING_BY_NAME = 0x0008
|
||||
UNFILTERED_FP_LIST = 0,
|
||||
FILTERING_BY_COMPONENT_FP_FILTER = 0x0001,
|
||||
FILTERING_BY_PIN_COUNT = 0x0002,
|
||||
FILTERING_BY_LIBRARY = 0x0004,
|
||||
FILTERING_BY_TEXT_PATTERN = 0x0008
|
||||
};
|
||||
|
||||
FOOTPRINT_LIST* m_list;
|
||||
|
|
Loading…
Reference in New Issue