pcbnew: Disabled UI update for pcbnew console menu item

UI update event handler updates toolbar button state for the scripting
console, but for the associated menu item it displays an assert saying that
the menu item that cannot be checked. To avoid that, the UI update event
handler returns early if event does not come from the toolbar.
This commit is contained in:
Maciej Suminski 2018-07-22 16:02:19 +02:00
parent 7f64f41242
commit 45c1742a3f
1 changed files with 4 additions and 1 deletions

View File

@ -78,7 +78,10 @@ void PCB_EDIT_FRAME::OnUpdateLayerSelectBox( wxUpdateUIEvent& aEvent )
// Used only when the DKICAD_SCRIPTING_WXPYTHON option is on
void PCB_EDIT_FRAME::OnUpdateScriptingConsoleState( wxUpdateUIEvent& aEvent )
{
wxMiniFrame * pythonPanelFrame = (wxMiniFrame *) findPythonConsole();
if( aEvent.GetEventObject() != m_mainToolBar )
return;
wxMiniFrame* pythonPanelFrame = (wxMiniFrame *) findPythonConsole();
bool pythonPanelShown = pythonPanelFrame ? pythonPanelFrame->IsShown() : false;
aEvent.Check( pythonPanelShown );
}