From 3d8d27caf3edab907660da3d2f525f4173eb4507 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 5 Jan 2023 16:30:55 +0000 Subject: [PATCH] Make sure ResetGridSizes works for SCH apps. --- common/settings/app_settings.cpp | 57 ++++++++++++++++++++------------ include/settings/app_settings.h | 8 +---- 2 files changed, 36 insertions(+), 29 deletions(-) diff --git a/common/settings/app_settings.cpp b/common/settings/app_settings.cpp index e22795f7e3..711dce7911 100644 --- a/common/settings/app_settings.cpp +++ b/common/settings/app_settings.cpp @@ -378,28 +378,41 @@ void APP_SETTINGS_BASE::addParamsForWindow( WINDOW_SETTINGS* aWindow, const std: const std::vector APP_SETTINGS_BASE::DefaultGridSizeList() const { - return { "1000 mil", - "500 mil", - "250 mil", - "200 mil", - "100 mil", - "50 mil", - "25 mil", - "20 mil", - "10 mil", - "5 mil", - "2 mil", - "1 mil", - "5.0 mm", - "2.5 mm", - "1.0 mm", - "0.5 mm", - "0.25 mm", - "0.2 mm", - "0.1 mm", - "0.05 mm", - "0.025 mm", - "0.01 mm" }; + if( m_filename == "eeschema" || m_filename == "symbol_editor" ) + { + return { "100 mil", + "50 mil", + "25 mil", + "10 mil", + "5 mil", + "2 mil", + "1 mil" }; + } + else + { + return { "1000 mil", + "500 mil", + "250 mil", + "200 mil", + "100 mil", + "50 mil", + "25 mil", + "20 mil", + "10 mil", + "5 mil", + "2 mil", + "1 mil", + "5.0 mm", + "2.5 mm", + "1.0 mm", + "0.5 mm", + "0.25 mm", + "0.2 mm", + "0.1 mm", + "0.05 mm", + "0.025 mm", + "0.01 mm" }; + } } diff --git a/include/settings/app_settings.h b/include/settings/app_settings.h index 0b484ee588..197d0b9d9b 100644 --- a/include/settings/app_settings.h +++ b/include/settings/app_settings.h @@ -167,13 +167,7 @@ public: virtual bool MigrateFromLegacy( wxConfigBase* aCfg ) override; - /** - * By default, this returns the list of grids available in PcbNew-based applications. - * Eeschema does not allow customization of the grid. If it ever does, override this in - * Eeschema settings to provide a different set of defaults. - * @return a default value for the window.grid.sizes parameter - */ - virtual const std::vector DefaultGridSizeList() const; + const std::vector DefaultGridSizeList() const; public: CROSS_PROBING_SETTINGS m_CrossProbing;