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.

(cherry picked from commit 45c1742a)
This commit is contained in:
Maciej Suminski 2018-07-22 16:02:19 +02:00
parent 3dcf04fdb8
commit 30da1a3b02
1 changed files with 4 additions and 1 deletions

View File

@ -109,7 +109,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 );
}