From 45c1742a3f54e035ecea35d0d5970ab70cc266ec Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Sun, 22 Jul 2018 16:02:19 +0200 Subject: [PATCH] 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. --- pcbnew/toolbars_update_user_interface.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pcbnew/toolbars_update_user_interface.cpp b/pcbnew/toolbars_update_user_interface.cpp index 51c8b7eabd..6161cbaa85 100644 --- a/pcbnew/toolbars_update_user_interface.cpp +++ b/pcbnew/toolbars_update_user_interface.cpp @@ -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 ); }