diff --git a/common/advanced_config.cpp b/common/advanced_config.cpp index b62aed6a64..2241283805 100644 --- a/common/advanced_config.cpp +++ b/common/advanced_config.cpp @@ -138,6 +138,7 @@ static const wxChar MaxPastedTextLength[] = wxT( "MaxPastedTextLength" ); static const wxChar PNSProcessClusterTimeout[] = wxT( "PNSProcessClusterTimeout" ); static const wxChar FollowBranchTimeout[] = wxT( "FollowBranchTimeoutMs" ); static const wxChar ImportSkipComponentBodies[] = wxT( "ImportSkipComponentBodies" ); +static const wxChar ImportSkipLayerMapping[] = wxT( "ImportSkipLayerMapping" ); static const wxChar ScreenDPI[] = wxT( "ScreenDPI" ); static const wxChar EnableUseAuiPerspective[] = wxT( "EnableUseAuiPerspective" ); static const wxChar HistoryLockStaleTimeout[] = wxT( "HistoryLockStaleTimeout" ); @@ -331,6 +332,7 @@ ADVANCED_CFG::ADVANCED_CFG() m_FollowBranchTimeout = 500; // Default: 500 ms m_ImportSkipComponentBodies = false; + m_ImportSkipLayerMapping = false; m_ScreenDPI = 91; @@ -643,6 +645,9 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg ) m_entries.push_back( std::make_unique( true, AC_KEYS::ImportSkipComponentBodies, &m_ImportSkipComponentBodies, m_ImportSkipComponentBodies ) ); + m_entries.push_back( std::make_unique( true, AC_KEYS::ImportSkipLayerMapping, + &m_ImportSkipLayerMapping, m_ImportSkipLayerMapping ) ); + m_entries.push_back( std::make_unique( true, AC_KEYS::ScreenDPI, &m_ScreenDPI, m_ScreenDPI, 50, 500 ) ); m_entries.push_back( std::make_unique( true, AC_KEYS::EnableUseAuiPerspective, diff --git a/include/advanced_config.h b/include/advanced_config.h index 31dcd8a25d..fc059ad173 100644 --- a/include/advanced_config.h +++ b/include/advanced_config.h @@ -866,6 +866,18 @@ public: */ bool m_ImportSkipComponentBodies; + /** + * Skip the layer mapping step when importing. + * + * This can be convenient to speed up imports when testing other aspects of the import, + * as you don't need to interact with the layer mapping dialog. + * + * Setting name: "ImportSkipLayerMapping" + * Valid values: 0 or 1 + * Default value: 0 + */ + bool m_ImportSkipLayerMapping; + /** * Screen DPI setting for display calculations. * diff --git a/pcbnew/files.cpp b/pcbnew/files.cpp index 60f52a4d35..d282fd6214 100644 --- a/pcbnew/files.cpp +++ b/pcbnew/files.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -625,8 +626,11 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in if( LAYER_MAPPABLE_PLUGIN* mappable_pi = dynamic_cast( pi.get() ) ) { - mappable_pi->RegisterCallback( std::bind( DIALOG_MAP_LAYERS::RunModal, - this, std::placeholders::_1 ) ); + if( !ADVANCED_CFG::GetCfg().m_ImportSkipLayerMapping ) + { + mappable_pi->RegisterCallback( std::bind( DIALOG_MAP_LAYERS::RunModal, + this, std::placeholders::_1 ) ); + } } if( PROJECT_CHOOSER_PLUGIN* chooser_pi = dynamic_cast( pi.get() ) )