Fixed crash when pcbnew was set to start with GAL canvas.
This commit is contained in:
parent
2330b13864
commit
8b46c4eb8f
|
@ -695,7 +695,7 @@ public:
|
||||||
bool SaveCanvasTypeSetting( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType );
|
bool SaveCanvasTypeSetting( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvasType );
|
||||||
|
|
||||||
///> Key in KifaceSettings to store the canvas type.
|
///> Key in KifaceSettings to store the canvas type.
|
||||||
static const wxString CANVAS_TYPE_KEY;
|
static const wxChar CANVAS_TYPE_KEY[];
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
|
@ -61,6 +61,8 @@
|
||||||
#include <tool/tool_manager.h>
|
#include <tool/tool_manager.h>
|
||||||
#include <tool/tool_dispatcher.h>
|
#include <tool/tool_dispatcher.h>
|
||||||
|
|
||||||
|
const wxChar PCB_BASE_FRAME::CANVAS_TYPE_KEY[] = wxT( "canvas_type" );
|
||||||
|
|
||||||
// Configuration entry names.
|
// Configuration entry names.
|
||||||
static const wxChar UserGridSizeXEntry[] = wxT( "PcbUserGrid_X" );
|
static const wxChar UserGridSizeXEntry[] = wxT( "PcbUserGrid_X" );
|
||||||
static const wxChar UserGridSizeYEntry[] = wxT( "PcbUserGrid_Y" );
|
static const wxChar UserGridSizeYEntry[] = wxT( "PcbUserGrid_Y" );
|
||||||
|
@ -983,11 +985,11 @@ void PCB_BASE_FRAME::UseGalCanvas( bool aEnable )
|
||||||
EDA_DRAW_PANEL_GAL::GAL_TYPE PCB_BASE_FRAME::LoadCanvasTypeSetting() const
|
EDA_DRAW_PANEL_GAL::GAL_TYPE PCB_BASE_FRAME::LoadCanvasTypeSetting() const
|
||||||
{
|
{
|
||||||
EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE;
|
EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE;
|
||||||
|
|
||||||
wxConfigBase* cfg = Kiface().KifaceSettings();
|
wxConfigBase* cfg = Kiface().KifaceSettings();
|
||||||
|
|
||||||
if( cfg )
|
if( cfg )
|
||||||
cfg->Read( CANVAS_TYPE_KEY, (long*) &canvasType );
|
canvasType = (EDA_DRAW_PANEL_GAL::GAL_TYPE) cfg->ReadLong( CANVAS_TYPE_KEY,
|
||||||
|
EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE );
|
||||||
|
|
||||||
if( canvasType < EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE
|
if( canvasType < EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE
|
||||||
|| canvasType >= EDA_DRAW_PANEL_GAL::GAL_TYPE_LAST )
|
|| canvasType >= EDA_DRAW_PANEL_GAL::GAL_TYPE_LAST )
|
||||||
|
@ -1016,6 +1018,3 @@ bool PCB_BASE_FRAME::SaveCanvasTypeSetting( EDA_DRAW_PANEL_GAL::GAL_TYPE aCanvas
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const wxString PCB_BASE_FRAME::CANVAS_TYPE_KEY = wxT( "canvas_type" );
|
|
||||||
|
|
|
@ -460,7 +460,6 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
GetGalCanvas()->SwitchBackend( canvasType );
|
GetGalCanvas()->SwitchBackend( canvasType );
|
||||||
UseGalCanvas( true );
|
UseGalCanvas( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue