From eb0fc7bae25a9e671ac1597d9163dc6e8465dac6 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Wed, 29 May 2019 07:29:36 -0700 Subject: [PATCH] Re-connect switch canvas on startup --- gerbview/gerbview_frame.cpp | 13 +++++-------- pcbnew/pcb_edit_frame.cpp | 9 +++------ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index e52b613333..e35534bda1 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -190,21 +190,18 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ): saveCanvasTypeSetting( EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO ); // Switch to OpenGL, which will save the new setting if successful - wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_OPENGL ); - GetEventHandler()->ProcessEvent( evt ); + GetToolManager()->RunAction( ACTIONS::acceleratedGraphics, true ); // Switch back to Cairo if OpenGL is not supported if( GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE ) { - wxCommandEvent cairoEvt( wxEVT_MENU, ID_MENU_CANVAS_CAIRO ); - GetEventHandler()->ProcessEvent( cairoEvt ); + GetToolManager()->RunAction( ACTIONS::standardGraphics, true ); } } - else if( canvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE ) + else { - // If they were on legacy, switch them to Cairo - wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_CAIRO ); - GetEventHandler()->ProcessEvent( evt ); + // If they were on legacy, switch to Cairo + GetToolManager()->RunAction( ACTIONS::standardGraphics, true ); } } diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index b47d404a6b..0846afcc10 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -378,21 +378,18 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : saveCanvasTypeSetting( EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO ); // Switch to OpenGL, which will save the new setting if successful - wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_OPENGL ); - GetEventHandler()->ProcessEvent( evt ); + GetToolManager()->RunAction( ACTIONS::acceleratedGraphics, true ); // Switch back to Cairo if OpenGL is not supported if( GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE ) { - wxCommandEvent cairoEvt( wxEVT_MENU, ID_MENU_CANVAS_CAIRO ); - GetEventHandler()->ProcessEvent( cairoEvt ); + GetToolManager()->RunAction( ACTIONS::standardGraphics, true ); } } else { // If they were on legacy, switch to Cairo - wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_CAIRO ); - GetEventHandler()->ProcessEvent( evt ); + GetToolManager()->RunAction( ACTIONS::standardGraphics, true ); } }