Dismiss infobar if it's dismissable on board save
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7071
This commit is contained in:
parent
ede500f117
commit
d2d4ffe6d0
|
@ -275,6 +275,22 @@ void WX_INFOBAR::RemoveAllButtons()
|
|||
}
|
||||
|
||||
|
||||
bool WX_INFOBAR::HasCloseButton() const
|
||||
{
|
||||
wxSizer* sizer = GetSizer();
|
||||
|
||||
if( sizer->GetItemCount() == 0 )
|
||||
return false;
|
||||
|
||||
if( sizer->GetItem( sizer->GetItemCount() - 1 )->IsSpacer() )
|
||||
return false;
|
||||
|
||||
wxSizerItem* item = sizer->GetItem( sizer->GetItemCount() - 1 );
|
||||
|
||||
return ( item->GetWindow()->GetId() == ID_CLOSE_INFOBAR );
|
||||
}
|
||||
|
||||
|
||||
void WX_INFOBAR::onShowInfoBar( wxCommandEvent& aEvent )
|
||||
{
|
||||
RemoveAllButtons();
|
||||
|
|
|
@ -130,6 +130,8 @@ public:
|
|||
*/
|
||||
void RemoveAllButtons();
|
||||
|
||||
bool HasCloseButton() const;
|
||||
|
||||
/**
|
||||
* Provide a callback to be called when the infobar is dismissed (either by user action
|
||||
* or timer).
|
||||
|
|
|
@ -935,6 +935,10 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool addToHistory,
|
|||
|
||||
SetStatusText( lowerTxt, 0 );
|
||||
|
||||
// Get rid of the old version conversion warning, or any other dismissable warning :)
|
||||
if( m_infoBar->IsShown() && m_infoBar->HasCloseButton() )
|
||||
m_infoBar->Dismiss();
|
||||
|
||||
GetScreen()->ClrModify();
|
||||
GetScreen()->ClrSave();
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue