GerbView: fix saving of canvas type and lingering legacy menu item
Fixes: lp:1829647 * https://bugs.launchpad.net/kicad/+bug/1829647
This commit is contained in:
parent
e99a2181ff
commit
b00e20b23f
|
@ -1342,14 +1342,14 @@ bool EDA_DRAW_FRAME::saveCanvasTypeSetting( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvas
|
||||||
// a parent frame)
|
// a parent frame)
|
||||||
FRAME_T allowed_frames[] =
|
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;
|
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;
|
allow_save = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -553,19 +553,15 @@ void GERBVIEW_FRAME::OnUpdateSwitchCanvas( wxUpdateUIEvent& aEvent )
|
||||||
{
|
{
|
||||||
wxMenuBar* menuBar = GetMenuBar();
|
wxMenuBar* menuBar = GetMenuBar();
|
||||||
EDA_DRAW_PANEL_GAL* gal_canvas = GetGalCanvas();
|
EDA_DRAW_PANEL_GAL* gal_canvas = GetGalCanvas();
|
||||||
EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE;
|
EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = gal_canvas->GetBackend();
|
||||||
|
|
||||||
if( IsGalCanvasActive() && gal_canvas )
|
|
||||||
canvasType = gal_canvas->GetBackend();
|
|
||||||
|
|
||||||
struct { int menuId; int galType; } menuList[] =
|
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_OPENGL, EDA_DRAW_PANEL_GAL::GAL_TYPE_OPENGL },
|
||||||
{ ID_MENU_CANVAS_CAIRO, EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO },
|
{ 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 );
|
wxMenuItem* item = menuBar->FindItem( ii.menuId );
|
||||||
if( ii.galType == canvasType )
|
if( ii.galType == canvasType )
|
||||||
|
|
Loading…
Reference in New Issue