GerbView: fix saving of canvas type and lingering legacy menu item

Fixes: lp:1829647
* https://bugs.launchpad.net/kicad/+bug/1829647

(cherry picked from commit b00e20b23f)
This commit is contained in:
Jon Evans 2019-05-19 14:25:01 -04:00
parent 9d56102210
commit ec39bdda77
2 changed files with 5 additions and 9 deletions

View File

@ -1255,14 +1255,14 @@ bool EDA_DRAW_FRAME::saveCanvasTypeSetting( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvas
// a parent frame)
FRAME_T allowed_frames[] =
{
FRAME_SCH, FRAME_PCB, FRAME_PCB_MODULE_EDITOR
FRAME_SCH, FRAME_PCB, FRAME_PCB_MODULE_EDITOR, FRAME_GERBER
};
bool allow_save = false;
for( int ii = 0; ii < 3; ii++ )
for( FRAME_T frame : allowed_frames )
{
if( m_Ident == allowed_frames[ii] )
if( m_Ident == frame )
{
allow_save = true;
break;

View File

@ -435,19 +435,15 @@ void GERBVIEW_FRAME::OnUpdateSwitchCanvas( wxUpdateUIEvent& aEvent )
{
wxMenuBar* menuBar = GetMenuBar();
EDA_DRAW_PANEL_GAL* gal_canvas = GetGalCanvas();
EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE;
if( IsGalCanvasActive() && gal_canvas )
canvasType = gal_canvas->GetBackend();
EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = gal_canvas->GetBackend();
struct { int menuId; int galType; } menuList[] =
{
{ ID_MENU_CANVAS_LEGACY, EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE },
{ ID_MENU_CANVAS_OPENGL, EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL },
{ ID_MENU_CANVAS_CAIRO, EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO },
};
for( auto ii: menuList )
for( auto ii : menuList )
{
wxMenuItem* item = menuBar->FindItem( ii.menuId );