diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index 66d27a1568..35800b1357 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -94,27 +94,12 @@ DIALOG_DRC_CONTROL::~DIALOG_DRC_CONTROL() settings->m_DrcDialog.refill_zones = m_cbRefillZones->GetValue(); settings->m_DrcDialog.test_track_to_zone = m_cbReportAllTrackErrors->GetValue(); settings->m_DrcDialog.test_footprints = m_cbTestFootprints->GetValue(); + settings->m_DrcDialog.severities = m_severities; m_markerTreeModel->DecRef(); } -void DIALOG_DRC_CONTROL::SetSettings( int aSeverities ) -{ - m_severities = aSeverities; - - m_markerTreeModel->SetSeverities( m_severities ); - m_unconnectedTreeModel->SetSeverities( m_severities ); - m_footprintWarningsTreeModel->SetSeverities( m_severities ); -} - - -void DIALOG_DRC_CONTROL::GetSettings( int* aSeverities ) -{ - *aSeverities = m_severities; -} - - void DIALOG_DRC_CONTROL::OnActivateDlg( wxActivateEvent& aEvent ) { if( m_currentBoard != m_brdEditor->GetBoard() ) @@ -162,6 +147,7 @@ void DIALOG_DRC_CONTROL::initValues() m_cbRefillZones->SetValue( cfg->m_DrcDialog.refill_zones ); m_cbReportAllTrackErrors->SetValue( cfg->m_DrcDialog.test_track_to_zone ); m_cbTestFootprints->SetValue( cfg->m_DrcDialog.test_footprints ); + m_severities = cfg->m_DrcDialog.severities; Layout(); // adding the units above expanded Clearance text, now resize. diff --git a/pcbnew/dialogs/dialog_drc.h b/pcbnew/dialogs/dialog_drc.h index 2c051e1c84..d320c0ce38 100644 --- a/pcbnew/dialogs/dialog_drc.h +++ b/pcbnew/dialogs/dialog_drc.h @@ -54,9 +54,6 @@ public: DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent ); ~DIALOG_DRC_CONTROL(); - void SetSettings( int aSeverities ); - void GetSettings( int* aSeverities ); - void SetMarkersProvider( DRC_ITEMS_PROVIDER* aProvider ); void SetUnconnectedProvider( DRC_ITEMS_PROVIDER* aProvider ); void SetFootprintsProvider( DRC_ITEMS_PROVIDER* aProvider ); diff --git a/pcbnew/drc/drc.cpp b/pcbnew/drc/drc.cpp index 2c3d5fc685..aa3c4ae975 100644 --- a/pcbnew/drc/drc.cpp +++ b/pcbnew/drc/drc.cpp @@ -74,8 +74,6 @@ DRC::DRC() : m_drcRun = false; m_footprintsTested = false; - m_severities = RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING; - m_segmAngle = 0; m_segmLength = 0; @@ -132,8 +130,6 @@ void DRC::ShowDRCDialog( wxWindow* aParent ) m_drcDialog = new DIALOG_DRC_CONTROL( this, m_pcbEditorFrame, aParent ); updatePointers(); - m_drcDialog->SetSettings( m_severities ); - if( show_dlg_modal ) m_drcDialog->ShowModal(); else @@ -166,8 +162,6 @@ void DRC::DestroyDRCDialog( int aReason ) { if( m_drcDialog ) { - m_drcDialog->GetSettings( &m_severities ); - m_drcDialog->Destroy(); m_drcDialog = nullptr; } diff --git a/pcbnew/drc/drc.h b/pcbnew/drc/drc.h index 4baa4cb4ed..b8ed63c51d 100644 --- a/pcbnew/drc/drc.h +++ b/pcbnew/drc/drc.h @@ -155,7 +155,6 @@ private: bool m_refillZones; // refill zones if requested (by user). bool m_reportAllTrackErrors; // Report all tracks errors (or only 4 first errors) bool m_testFootprints; // Test footprints against schematic - int m_severities; // Severities of DRC violations to display /* In DRC functions, many calculations are using coordinates relative * to the position of the segment under test (segm to segm DRC, segm to pad DRC diff --git a/pcbnew/pcbnew_settings.cpp b/pcbnew/pcbnew_settings.cpp index 6379be6132..91dbd27410 100644 --- a/pcbnew/pcbnew_settings.cpp +++ b/pcbnew/pcbnew_settings.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include "../3d-viewer/3d_viewer/3d_viewer_settings.h" @@ -177,6 +178,9 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS() : APP_SETTINGS_BASE( "pcbnew", pcbnewSchemaVe m_params.emplace_back( new PARAM( "drc_dialog.test_footprints", &m_DrcDialog.test_footprints, false ) ); + m_params.emplace_back( new PARAM( "drc_dialog.severities", + &m_DrcDialog.severities, RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING ) ); + m_params.emplace_back( new PARAM( "gen_drill.merge_pth_npth", &m_GenDrill.merge_pth_npth, false ) ); diff --git a/pcbnew/pcbnew_settings.h b/pcbnew/pcbnew_settings.h index 0bab45c4fc..cf7b985f73 100644 --- a/pcbnew/pcbnew_settings.h +++ b/pcbnew/pcbnew_settings.h @@ -64,6 +64,7 @@ public: bool refill_zones; bool test_track_to_zone; bool test_footprints; + int severities; }; struct DIALOG_EXPORT_IDF