Re-connect switch canvas on startup

This commit is contained in:
Seth Hillbrand 2019-05-29 07:29:36 -07:00
parent 87d997704f
commit eb0fc7bae2
2 changed files with 8 additions and 14 deletions

View File

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

View File

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