diff --git a/include/core/settings.h b/include/core/settings.h index 7afcbed8ce..e302bcb22c 100644 --- a/include/core/settings.h +++ b/include/core/settings.h @@ -90,24 +90,24 @@ class SETTINGS #endif - void Add ( const wxString& name, int* aPtr, int aDefaultValue ) + void Add( const wxString& name, int* aPtr, int aDefaultValue ) { - m_params.push_back ( new PARAM_CFG_INT ( m_prefix+name, aPtr, aDefaultValue ) ); + m_params.push_back( new PARAM_CFG_INT ( m_prefix+name, aPtr, aDefaultValue ) ); } - void Add ( const wxString& name, bool* aPtr, bool aDefaultValue ) + void Add( const wxString& name, bool* aPtr, bool aDefaultValue ) { - m_params.push_back ( new PARAM_CFG_BOOL ( m_prefix+name, aPtr, aDefaultValue ) ); + m_params.push_back( new PARAM_CFG_BOOL ( m_prefix+name, aPtr, aDefaultValue ) ); } - void Add ( const wxString& name, KIGFX::COLOR4D* aPtr, KIGFX::COLOR4D aDefaultValue ) + void Add( const wxString& name, KIGFX::COLOR4D* aPtr, KIGFX::COLOR4D aDefaultValue ) { - m_params.push_back ( new PARAM_CFG_SETCOLOR ( m_prefix+name, aPtr, aDefaultValue ) ); + m_params.push_back( new PARAM_CFG_SETCOLOR ( m_prefix+name, aPtr, aDefaultValue ) ); } - void Add ( const wxString& name, KIGFX::COLOR4D* aPtr, EDA_COLOR_T aDefaultValue ) + void Add( const wxString& name, KIGFX::COLOR4D* aPtr, EDA_COLOR_T aDefaultValue ) { - m_params.push_back ( new PARAM_CFG_SETCOLOR ( m_prefix+name, aPtr, aDefaultValue ) ); + m_params.push_back( new PARAM_CFG_SETCOLOR ( m_prefix+name, aPtr, aDefaultValue ) ); } diff --git a/pcbnew/pcb_general_settings.cpp b/pcbnew/pcb_general_settings.cpp index 59dd3d12c7..d24b0b9543 100644 --- a/pcbnew/pcb_general_settings.cpp +++ b/pcbnew/pcb_general_settings.cpp @@ -24,10 +24,8 @@ #include PCB_GENERAL_SETTINGS::PCB_GENERAL_SETTINGS( FRAME_T aFrameType ) - : m_colorsSettings( aFrameType ) + : m_frameType( aFrameType ), m_colorsSettings( aFrameType ) { - m_frameType = aFrameType; - if( m_frameType == FRAME_PCB ) { Add( "LegacyAutoDeleteOldTrack", &m_legacyAutoDeleteOldTrack, true ); @@ -41,6 +39,7 @@ PCB_GENERAL_SETTINGS::PCB_GENERAL_SETTINGS( FRAME_T aFrameType ) } } + void PCB_GENERAL_SETTINGS::Load( wxConfigBase* aCfg ) { m_colorsSettings.Load( aCfg ); diff --git a/pcbnew/pcb_general_settings.h b/pcbnew/pcb_general_settings.h index d1f13d99db..62535045ac 100644 --- a/pcbnew/pcb_general_settings.h +++ b/pcbnew/pcb_general_settings.h @@ -41,18 +41,14 @@ class PCB_GENERAL_SETTINGS : public SETTINGS public: PCB_GENERAL_SETTINGS( FRAME_T aFrameType ); - void Load ( wxConfigBase* aCfg ) override; + void Load( wxConfigBase* aCfg ) override; void Save( wxConfigBase* aCfg ) override; - COLORS_DESIGN_SETTINGS m_colorsSettings; - COLORS_DESIGN_SETTINGS& Colors() { return m_colorsSettings; } - FRAME_T m_frameType; - bool m_legacyDrcOn = true; // Not stored, always true when starting pcbnew, // false only on request during routing, and // always for temporary use @@ -67,6 +63,10 @@ public: MAGNETIC_PAD_OPTION_VALUES m_magneticPads = CAPTURE_CURSOR_IN_TRACK_TOOL; MAGNETIC_PAD_OPTION_VALUES m_magneticTracks = CAPTURE_CURSOR_IN_TRACK_TOOL; + +protected: + const FRAME_T m_frameType; + COLORS_DESIGN_SETTINGS m_colorsSettings; }; #endif