Fix show/hide of default netclass
This commit is contained in:
parent
4b7c883095
commit
249de20c6b
|
@ -1908,6 +1908,7 @@ void APPEARANCE_CONTROLS::onNetclassContextMenu( wxCommandEvent& aEvent )
|
|||
m_netclassSettingsMap.at( m_contextMenuNetclass ) : nullptr;
|
||||
|
||||
NETCLASSPTR defaultClass = classes.GetDefault();
|
||||
wxString defaultClassName = defaultClass->GetName();
|
||||
|
||||
auto runOnNetsOfClass =
|
||||
[&]( NETCLASSPTR aClass, std::function<void( NETINFO_ITEM* )> aFunction )
|
||||
|
@ -1996,6 +1997,10 @@ void APPEARANCE_CONTROLS::onNetclassContextMenu( wxCommandEvent& aEvent )
|
|||
|
||||
case ID_SHOW_ALL_NETS:
|
||||
{
|
||||
showNetclass( defaultClassName );
|
||||
wxASSERT( m_netclassSettingsMap.count( defaultClassName ) );
|
||||
m_netclassSettingsMap.at( defaultClassName )->ctl_visibility->SetValue( true );
|
||||
|
||||
for( const auto& pair : classes.NetClasses() )
|
||||
{
|
||||
showNetclass( pair.first );
|
||||
|
@ -2009,6 +2014,11 @@ void APPEARANCE_CONTROLS::onNetclassContextMenu( wxCommandEvent& aEvent )
|
|||
|
||||
case ID_HIDE_OTHER_NETS:
|
||||
{
|
||||
bool showDefault = m_contextMenuNetclass == defaultClassName;
|
||||
showNetclass( defaultClassName, showDefault );
|
||||
wxASSERT( m_netclassSettingsMap.count( defaultClassName ) );
|
||||
m_netclassSettingsMap.at( defaultClassName )->ctl_visibility->SetValue( showDefault );
|
||||
|
||||
for( const auto& pair : classes.NetClasses() )
|
||||
{
|
||||
bool show = pair.first == m_contextMenuNetclass;
|
||||
|
|
Loading…
Reference in New Issue