Improve robustness of infobar button handling.
This commit is contained in:
parent
ebc8e2c921
commit
1ee3df61c9
|
@ -666,18 +666,21 @@ void EDA_BASE_FRAME::PrintMsg( const wxString& text )
|
||||||
|
|
||||||
void EDA_BASE_FRAME::ShowInfoBarError( const wxString& aErrorMsg )
|
void EDA_BASE_FRAME::ShowInfoBarError( const wxString& aErrorMsg )
|
||||||
{
|
{
|
||||||
|
m_infoBar->RemoveAllButtons();
|
||||||
GetInfoBar()->ShowMessageFor( aErrorMsg, 5000, wxICON_ERROR );
|
GetInfoBar()->ShowMessageFor( aErrorMsg, 5000, wxICON_ERROR );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void EDA_BASE_FRAME::ShowInfoBarWarning( const wxString& aWarningMsg )
|
void EDA_BASE_FRAME::ShowInfoBarWarning( const wxString& aWarningMsg )
|
||||||
{
|
{
|
||||||
|
m_infoBar->RemoveAllButtons();
|
||||||
GetInfoBar()->ShowMessageFor( aWarningMsg, 5000, wxICON_WARNING );
|
GetInfoBar()->ShowMessageFor( aWarningMsg, 5000, wxICON_WARNING );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void EDA_BASE_FRAME::ShowInfoBarMsg( const wxString& aMsg )
|
void EDA_BASE_FRAME::ShowInfoBarMsg( const wxString& aMsg )
|
||||||
{
|
{
|
||||||
|
m_infoBar->RemoveAllButtons();
|
||||||
GetInfoBar()->ShowMessageFor( aMsg, 10000, wxICON_INFORMATION );
|
GetInfoBar()->ShowMessageFor( aMsg, 10000, wxICON_INFORMATION );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,6 +68,7 @@ int AUTOPLACE_TOOL::autoplace( std::vector<MODULE*>& aModules, bool aPlaceOffboa
|
||||||
wxString msg = wxString::Format( _( "Board edges must be defined on the %s layer." ),
|
wxString msg = wxString::Format( _( "Board edges must be defined on the %s layer." ),
|
||||||
LayerName( Edge_Cuts ) );
|
LayerName( Edge_Cuts ) );
|
||||||
|
|
||||||
|
frame()->GetInfoBar()->RemoveAllButtons();
|
||||||
frame()->GetInfoBar()->ShowMessageFor( msg, 5000, wxICON_ERROR );
|
frame()->GetInfoBar()->ShowMessageFor( msg, 5000, wxICON_ERROR );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -728,10 +728,12 @@ int ROUTER_TOOL::onViaCommand( const TOOL_EVENT& aEvent )
|
||||||
getEditFrame<PCB_EDIT_FRAME>()->ShowBoardSetupDialog( _( "Constraints" ) );
|
getEditFrame<PCB_EDIT_FRAME>()->ShowBoardSetupDialog( _( "Constraints" ) );
|
||||||
} ) );
|
} ) );
|
||||||
|
|
||||||
|
infobar->RemoveAllButtons();
|
||||||
|
infobar->AddButton( button );
|
||||||
|
|
||||||
infobar->ShowMessageFor( _( "Blind/buried vias have to be enabled in "
|
infobar->ShowMessageFor( _( "Blind/buried vias have to be enabled in "
|
||||||
"Board Setup > Design Rules > Constraints." ),
|
"Board Setup > Design Rules > Constraints." ),
|
||||||
10000, wxICON_ERROR );
|
10000, wxICON_ERROR );
|
||||||
infobar->AddButton( button );
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -747,10 +749,12 @@ int ROUTER_TOOL::onViaCommand( const TOOL_EVENT& aEvent )
|
||||||
getEditFrame<PCB_EDIT_FRAME>()->ShowBoardSetupDialog( _( "Constraints" ) );
|
getEditFrame<PCB_EDIT_FRAME>()->ShowBoardSetupDialog( _( "Constraints" ) );
|
||||||
} ) );
|
} ) );
|
||||||
|
|
||||||
|
infobar->RemoveAllButtons();
|
||||||
|
infobar->AddButton( button );
|
||||||
|
|
||||||
infobar->ShowMessageFor( _( "Microvias have to be enabled in "
|
infobar->ShowMessageFor( _( "Microvias have to be enabled in "
|
||||||
"Board Setup > Design Rules > Constraints." ),
|
"Board Setup > Design Rules > Constraints." ),
|
||||||
10000, wxICON_ERROR );
|
10000, wxICON_ERROR );
|
||||||
infobar->AddButton( button );
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,9 +116,11 @@ void ZONE_FILLER_TOOL::FillAllZones( wxWindow* aCaller, PROGRESS_REPORTER* aRepo
|
||||||
getEditFrame<PCB_EDIT_FRAME>()->ShowBoardSetupDialog( _( "Rules" ) );
|
getEditFrame<PCB_EDIT_FRAME>()->ShowBoardSetupDialog( _( "Rules" ) );
|
||||||
} ) );
|
} ) );
|
||||||
|
|
||||||
|
infobar->RemoveAllButtons();
|
||||||
|
infobar->AddButton( button );
|
||||||
|
|
||||||
infobar->ShowMessageFor( _( "Zone fills may be inaccurate. DRC rules contain errors." ),
|
infobar->ShowMessageFor( _( "Zone fills may be inaccurate. DRC rules contain errors." ),
|
||||||
10000, wxICON_WARNING );
|
10000, wxICON_WARNING );
|
||||||
infobar->AddButton( button );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( aReporter )
|
if( aReporter )
|
||||||
|
|
Loading…
Reference in New Issue