diff --git a/3d-viewer/3d_viewer/eda_3d_viewer.cpp b/3d-viewer/3d_viewer/eda_3d_viewer.cpp index f618ffa526..a1c0f023ba 100644 --- a/3d-viewer/3d_viewer/eda_3d_viewer.cpp +++ b/3d-viewer/3d_viewer/eda_3d_viewer.cpp @@ -625,12 +625,12 @@ void EDA_3D_VIEWER::SynchroniseColoursWithBoard() } -void EDA_3D_VIEWER::CommonSettingsChanged( bool aEnvVarsChanged ) +void EDA_3D_VIEWER::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) { wxLogTrace( m_logTrace, "EDA_3D_VIEWER::CommonSettingsChanged" ); // Regen menu bars, etc - EDA_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged ); + EDA_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged ); // There is no base class that handles toolbars for this frame ReCreateMainToolbar(); diff --git a/3d-viewer/3d_viewer/eda_3d_viewer.h b/3d-viewer/3d_viewer/eda_3d_viewer.h index 097fc6421a..474168c336 100644 --- a/3d-viewer/3d_viewer/eda_3d_viewer.h +++ b/3d-viewer/3d_viewer/eda_3d_viewer.h @@ -152,7 +152,7 @@ class EDA_3D_VIEWER : public EDA_3D_BOARD_HOLDER, public KIWAY_PLAYER * This would be private (and only called by the Kiway), but we need to do this manually * from the PCB frame because the 3D viewer isn't updated via the #KIWAY. */ - void CommonSettingsChanged( bool aEnvVarsChanged ) override; + void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override; void SynchroniseColoursWithBoard(); diff --git a/common/eda_base_frame.cpp b/common/eda_base_frame.cpp index 52a7a000f1..cbbbcc9ce6 100644 --- a/common/eda_base_frame.cpp +++ b/common/eda_base_frame.cpp @@ -325,9 +325,9 @@ void EDA_BASE_FRAME::ShowChangedLanguage() } -void EDA_BASE_FRAME::CommonSettingsChanged( bool aEnvVarsChanged ) +void EDA_BASE_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) { - TOOLS_HOLDER::CommonSettingsChanged( aEnvVarsChanged ); + TOOLS_HOLDER::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged ); COMMON_SETTINGS* settings = Pgm().GetCommonSettings(); @@ -469,7 +469,7 @@ void EDA_BASE_FRAME::LoadWindowSettings( WINDOW_SETTINGS* aCfg ) m_perspective = aCfg->perspective; m_mruPath = aCfg->mru_path; - TOOLS_HOLDER::CommonSettingsChanged( false ); + TOOLS_HOLDER::CommonSettingsChanged( false, false ); } @@ -693,7 +693,7 @@ void EDA_BASE_FRAME::OnPreferences( wxCommandEvent& event ) book->GetPage( i )->Layout(); if( dlg.ShowModal() == wxID_OK ) - dlg.Kiway().CommonSettingsChanged( false ); + dlg.Kiway().CommonSettingsChanged( false, false ); } diff --git a/common/eda_draw_frame.cpp b/common/eda_draw_frame.cpp index 5af0ad2618..0f6d55b245 100644 --- a/common/eda_draw_frame.cpp +++ b/common/eda_draw_frame.cpp @@ -205,9 +205,9 @@ void EDA_DRAW_FRAME::ToggleUserUnits() } -void EDA_DRAW_FRAME::CommonSettingsChanged( bool aEnvVarsChanged ) +void EDA_DRAW_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) { - EDA_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged ); + EDA_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged ); COMMON_SETTINGS* settings = Pgm().GetCommonSettings(); KIGFX::VIEW_CONTROLS* viewControls = GetCanvas()->GetViewControls(); diff --git a/common/kiway.cpp b/common/kiway.cpp index 4823c00985..e6cbbbdce8 100644 --- a/common/kiway.cpp +++ b/common/kiway.cpp @@ -473,7 +473,7 @@ void KIWAY::SetLanguage( int aLanguage ) } } -void KIWAY::CommonSettingsChanged( bool aEnvVarsChanged ) +void KIWAY::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) { #if 1 if( m_ctl & KFCTL_CPP_PROJECT_SUITE ) @@ -484,7 +484,7 @@ void KIWAY::CommonSettingsChanged( bool aEnvVarsChanged ) EDA_BASE_FRAME* top = static_cast( m_top ); if( top ) - top->CommonSettingsChanged( aEnvVarsChanged ); + top->CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged ); } #endif @@ -493,7 +493,7 @@ void KIWAY::CommonSettingsChanged( bool aEnvVarsChanged ) KIWAY_PLAYER* frame = GetPlayerFrame( ( FRAME_T )i ); if( frame ) - frame->CommonSettingsChanged( aEnvVarsChanged ); + frame->CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged ); } } diff --git a/common/tool/common_control.cpp b/common/tool/common_control.cpp index f0b4114d17..b017445fd0 100644 --- a/common/tool/common_control.cpp +++ b/common/tool/common_control.cpp @@ -98,7 +98,7 @@ int COMMON_CONTROL::ConfigurePaths( const TOOL_EVENT& aEvent ) DIALOG_CONFIGURE_PATHS dlg( m_frame, nullptr ); if( dlg.ShowModal() == wxID_OK ) - m_frame->Kiway().CommonSettingsChanged( true ); + m_frame->Kiway().CommonSettingsChanged( true, false ); } return 0; diff --git a/common/tool/tools_holder.cpp b/common/tool/tools_holder.cpp index 0873763913..2658ab5791 100644 --- a/common/tool/tools_holder.cpp +++ b/common/tool/tools_holder.cpp @@ -114,7 +114,7 @@ bool TOOLS_HOLDER::IsCurrentTool( const TOOL_ACTION& aAction ) const } -void TOOLS_HOLDER::CommonSettingsChanged( bool aEnvVarsChanged ) +void TOOLS_HOLDER::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) { if( GetToolManager() ) GetToolManager()->GetActionManager()->UpdateHotKeys( false ); diff --git a/eeschema/dialogs/dialog_schematic_setup.h b/eeschema/dialogs/dialog_schematic_setup.h index 2835ae99df..1e258e304d 100644 --- a/eeschema/dialogs/dialog_schematic_setup.h +++ b/eeschema/dialogs/dialog_schematic_setup.h @@ -30,6 +30,7 @@ class PANEL_SETUP_FORMATTING; class PANEL_SETUP_PINMAP; class PANEL_TEXT_VARIABLES; class PANEL_SETUP_NETCLASSES; +class ERC_ITEM; class DIALOG_SCHEMATIC_SETUP : public PAGED_DIALOG diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index c83d173b2b..c3e0693c28 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -29,8 +29,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -38,7 +40,6 @@ #include #include #include -#include #include #include #include @@ -47,8 +48,6 @@ #include #include #include -#include -#include "erc.h" #define FieldNameTemplatesKey wxT( "FieldNameTemplates" ) @@ -272,6 +271,7 @@ void SCH_EDIT_FRAME::ShowSchematicSetupDialog( const wxString& aInitialPage ) Prj().GetProjectFile().NetSettings().ResolveNetClassAssignments(); SaveProjectSettings(); + Kiway().CommonSettingsChanged( false, true ); GetCanvas()->Refresh(); } } diff --git a/eeschema/lib_view_frame.cpp b/eeschema/lib_view_frame.cpp index bb1673c88e..c92d387504 100644 --- a/eeschema/lib_view_frame.cpp +++ b/eeschema/lib_view_frame.cpp @@ -656,9 +656,9 @@ WINDOW_SETTINGS* LIB_VIEW_FRAME::GetWindowSettings( APP_SETTINGS_BASE* aCfg ) } -void LIB_VIEW_FRAME::CommonSettingsChanged( bool aEnvVarsChanged ) +void LIB_VIEW_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) { - SCH_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged ); + SCH_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged ); if( aEnvVarsChanged ) ReCreateListLib(); diff --git a/eeschema/lib_view_frame.h b/eeschema/lib_view_frame.h index cac2899d03..05ff5b62aa 100644 --- a/eeschema/lib_view_frame.h +++ b/eeschema/lib_view_frame.h @@ -104,7 +104,7 @@ public: WINDOW_SETTINGS* GetWindowSettings( APP_SETTINGS_BASE* aCfg ) override; - void CommonSettingsChanged( bool aEnvVarsChanged ) override; + void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override; /** * Set a filter to display only libraries and/or components which match the filter. diff --git a/eeschema/libedit/lib_edit_frame.cpp b/eeschema/libedit/lib_edit_frame.cpp index 00425f615e..bb02afe26b 100644 --- a/eeschema/libedit/lib_edit_frame.cpp +++ b/eeschema/libedit/lib_edit_frame.cpp @@ -731,9 +731,9 @@ void LIB_EDIT_FRAME::emptyScreen() } -void LIB_EDIT_FRAME::CommonSettingsChanged( bool aEnvVarsChanged ) +void LIB_EDIT_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) { - SCH_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged ); + SCH_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged ); GetCanvas()->GetGAL()->SetAxesColor( m_colorSettings->GetColor( LAYER_SCHEMATIC_GRID_AXES ) ); diff --git a/eeschema/libedit/lib_edit_frame.h b/eeschema/libedit/lib_edit_frame.h index 65a1d89e69..75a54fa728 100644 --- a/eeschema/libedit/lib_edit_frame.h +++ b/eeschema/libedit/lib_edit_frame.h @@ -417,7 +417,7 @@ public: /** * Called after the preferences dialog is run. */ - void CommonSettingsChanged( bool aEnvVarsChanged ) override; + void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override; void ShowChangedLanguage() override; diff --git a/eeschema/sch_base_frame.cpp b/eeschema/sch_base_frame.cpp index 5924422987..03bca0bab1 100644 --- a/eeschema/sch_base_frame.cpp +++ b/eeschema/sch_base_frame.cpp @@ -418,9 +418,9 @@ COLOR4D SCH_BASE_FRAME::GetLayerColor( SCH_LAYER_ID aLayer ) } -void SCH_BASE_FRAME::CommonSettingsChanged( bool aEnvVarsChanged ) +void SCH_BASE_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) { - EDA_DRAW_FRAME::CommonSettingsChanged( aEnvVarsChanged ); + EDA_DRAW_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged ); EESCHEMA_SETTINGS* cfg = Pgm().GetSettingsManager().GetAppSettings(); m_colorSettings = Pgm().GetSettingsManager().GetColorSettings( cfg->m_ColorTheme ); diff --git a/eeschema/sch_base_frame.h b/eeschema/sch_base_frame.h index 9712c7a13a..c85952ce09 100644 --- a/eeschema/sch_base_frame.h +++ b/eeschema/sch_base_frame.h @@ -278,7 +278,7 @@ public: */ virtual void OnModify() {} - void CommonSettingsChanged( bool aEnvVarsChanged ) override; + void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override; /** * Helper to retrieve a layer color from the global color settings diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 81e41a9f61..e3437a988d 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -1031,9 +1031,12 @@ void SCH_EDIT_FRAME::RecalculateConnections( SCH_CLEANUP_FLAGS aCleanupFlags ) } -void SCH_EDIT_FRAME::CommonSettingsChanged( bool aEnvVarsChanged ) +void SCH_EDIT_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) { - SCH_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged ); + SCH_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged ); + + if( aTextVarsChanged ) + GetCanvas()->GetView()->UpdateAllItems( KIGFX::ALL ); RecreateToolbars(); Layout(); diff --git a/eeschema/sch_edit_frame.h b/eeschema/sch_edit_frame.h index 28934b9c08..176021742f 100644 --- a/eeschema/sch_edit_frame.h +++ b/eeschema/sch_edit_frame.h @@ -937,7 +937,7 @@ public: /** * Called after the preferences dialog is run. */ - void CommonSettingsChanged( bool aEnvVarsChanged ) override; + void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override; void ShowChangedLanguage() override; diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index 5973e001b6..f1c4e3e846 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -1170,9 +1170,9 @@ void GERBVIEW_FRAME::setupTools() } -void GERBVIEW_FRAME::CommonSettingsChanged( bool aEnvVarsChanged ) +void GERBVIEW_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) { - EDA_DRAW_FRAME::CommonSettingsChanged( aEnvVarsChanged ); + EDA_DRAW_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged ); RecreateToolbars(); Layout(); diff --git a/gerbview/gerbview_frame.h b/gerbview/gerbview_frame.h index 26ecf1c404..ec5fa426e9 100644 --- a/gerbview/gerbview_frame.h +++ b/gerbview/gerbview_frame.h @@ -562,7 +562,7 @@ public: /** * Called after the preferences dialog is run. */ - void CommonSettingsChanged( bool aEnvVarsChanged ) override; + void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override; void SyncToolbars() override; diff --git a/include/eda_base_frame.h b/include/eda_base_frame.h index faa6e41da7..8233056491 100644 --- a/include/eda_base_frame.h +++ b/include/eda_base_frame.h @@ -494,7 +494,7 @@ public: * Notification event that some of the common (suite-wide) settings have changed. * Update menus, toolbars, local variables, etc. */ - void CommonSettingsChanged( bool aEnvVarsChanged ) override; + void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override; const wxString& GetAboutTitle() const { return m_AboutTitle; } diff --git a/include/eda_draw_frame.h b/include/eda_draw_frame.h index eabc8ea9b5..b875288612 100644 --- a/include/eda_draw_frame.h +++ b/include/eda_draw_frame.h @@ -113,7 +113,7 @@ protected: void unitsChangeRefresh() override; - void CommonSettingsChanged( bool aEnvVarsChanged ) override; + void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override; /** * Sets the common key-pair for exiting the application (Ctrl-Q) and ties it diff --git a/include/kiway.h b/include/kiway.h index d590b234c5..57bf52fa60 100644 --- a/include/kiway.h +++ b/include/kiway.h @@ -380,7 +380,7 @@ public: * Calls CommonSettingsChanged() on all KIWAY_PLAYERs. * Used after changing suite-wide options such as panning, autosave interval, etc. */ - VTBL_ENTRY void CommonSettingsChanged( bool aEnvVarsChanged ); + VTBL_ENTRY void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ); KIWAY( PGM_BASE* aProgram, int aCtlBits, wxFrame* aTop = NULL ); diff --git a/include/pcb_base_frame.h b/include/pcb_base_frame.h index 5717538148..174b7fccbf 100644 --- a/include/pcb_base_frame.h +++ b/include/pcb_base_frame.h @@ -380,7 +380,7 @@ public: virtual MAGNETIC_SETTINGS* GetMagneticItemsSettings(); - void CommonSettingsChanged( bool aEnvVarsChanged ) override; + void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override; virtual void OnUpdateLayerAlpha( wxUpdateUIEvent& aEvent ) {} diff --git a/include/tool/tools_holder.h b/include/tool/tools_holder.h index 4b55ac8b14..224fa3ddbb 100644 --- a/include/tool/tools_holder.h +++ b/include/tool/tools_holder.h @@ -110,7 +110,7 @@ public: * Notification event that some of the common (suite-wide) settings have changed. * Update hotkeys, preferences, etc. */ - virtual void CommonSettingsChanged( bool aEnvVarsChanged ); + virtual void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ); /** * Canvas access. diff --git a/kicad/kicad_manager_frame.cpp b/kicad/kicad_manager_frame.cpp index d14886b8bc..92d638248e 100644 --- a/kicad/kicad_manager_frame.cpp +++ b/kicad/kicad_manager_frame.cpp @@ -516,7 +516,7 @@ void KICAD_MANAGER_FRAME::ShowChangedLanguage() } -void KICAD_MANAGER_FRAME::CommonSettingsChanged( bool aEnvVarsChanged ) +void KICAD_MANAGER_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) { int historySize = Pgm().GetCommonSettings()->m_System.file_history_size; GetFileHistory().SetMaxFiles( (unsigned) std::max( 0, historySize ) ); diff --git a/kicad/kicad_manager_frame.h b/kicad/kicad_manager_frame.h index 461a49e7e8..54c7599581 100644 --- a/kicad/kicad_manager_frame.h +++ b/kicad/kicad_manager_frame.h @@ -147,7 +147,7 @@ public: void SaveSettings( APP_SETTINGS_BASE* aCfg ) override; void ShowChangedLanguage() override; - void CommonSettingsChanged( bool aEnvVarsChanged ) override; + void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override; /** * Called by sending a event with id = ID_INIT_WATCHED_PATHS diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 6afb365e19..8ee69cedc5 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -892,9 +892,9 @@ void FOOTPRINT_EDIT_FRAME::ActivateGalCanvas() } -void FOOTPRINT_EDIT_FRAME::CommonSettingsChanged( bool aEnvVarsChanged ) +void FOOTPRINT_EDIT_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) { - PCB_BASE_EDIT_FRAME::CommonSettingsChanged( aEnvVarsChanged ); + PCB_BASE_EDIT_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged ); if( aEnvVarsChanged ) SyncLibraryTree( true ); diff --git a/pcbnew/footprint_edit_frame.h b/pcbnew/footprint_edit_frame.h index 17ecc8c746..58fb310450 100644 --- a/pcbnew/footprint_edit_frame.h +++ b/pcbnew/footprint_edit_frame.h @@ -321,7 +321,7 @@ public: /** * Called after the preferences dialog is run. */ - void CommonSettingsChanged( bool aEnvVarsChanged ) override; + void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override; /** * Synchronize the footprint library tree to the current state of the footprint library diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index 287938577c..1c273305f6 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -771,9 +771,9 @@ void FOOTPRINT_VIEWER_FRAME::SetAutoZoom( bool aAutoZoom ) } -void FOOTPRINT_VIEWER_FRAME::CommonSettingsChanged( bool aEnvVarsChanged ) +void FOOTPRINT_VIEWER_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) { - PCB_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged ); + PCB_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged ); if( aEnvVarsChanged ) ReCreateLibraryList(); diff --git a/pcbnew/footprint_viewer_frame.h b/pcbnew/footprint_viewer_frame.h index 246f8a4fa2..d120cda61b 100644 --- a/pcbnew/footprint_viewer_frame.h +++ b/pcbnew/footprint_viewer_frame.h @@ -141,7 +141,7 @@ private: WINDOW_SETTINGS* GetWindowSettings( APP_SETTINGS_BASE* aCfg ) override; - void CommonSettingsChanged( bool aEnvVarsChanged ) override; + void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override; /** * Function OnActivate diff --git a/pcbnew/pcb_base_frame.cpp b/pcbnew/pcb_base_frame.cpp index a3bc27a70b..12db18ca78 100644 --- a/pcbnew/pcb_base_frame.cpp +++ b/pcbnew/pcb_base_frame.cpp @@ -685,9 +685,9 @@ MAGNETIC_SETTINGS* PCB_BASE_FRAME::GetMagneticItemsSettings() } -void PCB_BASE_FRAME::CommonSettingsChanged( bool aEnvVarsChanged ) +void PCB_BASE_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) { - EDA_DRAW_FRAME::CommonSettingsChanged( aEnvVarsChanged ); + EDA_DRAW_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged ); RecreateToolbars(); @@ -695,7 +695,7 @@ void PCB_BASE_FRAME::CommonSettingsChanged( bool aEnvVarsChanged ) EDA_3D_VIEWER* viewer = Get3DViewerFrame(); if( viewer ) - viewer->CommonSettingsChanged( aEnvVarsChanged ); + viewer->CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged ); } diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 145edd5edb..e4667371db 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -22,6 +22,7 @@ #include #include +#include #include #include #include <3d_viewer/eda_3d_viewer.h> @@ -31,7 +32,7 @@ #include #include #include -#include +//#include #include #include #include @@ -39,8 +40,7 @@ #include #include #include -#include -#include +//#include #include #include #include @@ -662,9 +662,7 @@ void PCB_EDIT_FRAME::ShowBoardSetupDialog( const wxString& aInitialPage, const w UpdateUserInterface(); ReCreateAuxiliaryToolbar(); - for( auto module : GetBoard()->Modules() ) - GetCanvas()->GetView()->Update( module ); - + Kiway().CommonSettingsChanged( false, true ); GetCanvas()->Refresh(); m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD ); @@ -1277,12 +1275,15 @@ int PCB_EDIT_FRAME::InstallExchangeModuleFrame( MODULE* aModule, bool updateMode } -void PCB_EDIT_FRAME::CommonSettingsChanged( bool aEnvVarsChanged ) +void PCB_EDIT_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) { - PCB_BASE_EDIT_FRAME::CommonSettingsChanged( aEnvVarsChanged ); + PCB_BASE_EDIT_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged ); ReCreateMicrowaveVToolbar(); + if( aTextVarsChanged ) + GetCanvas()->GetView()->UpdateAllItems( KIGFX::ALL ); + Layout(); SendSizeEvent(); } diff --git a/pcbnew/pcb_edit_frame.h b/pcbnew/pcb_edit_frame.h index 71ee492759..56cdaf174c 100644 --- a/pcbnew/pcb_edit_frame.h +++ b/pcbnew/pcb_edit_frame.h @@ -912,7 +912,7 @@ public: /** * Called after the preferences dialog is run. */ - void CommonSettingsChanged( bool aEnvVarsChanged ) override; + void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override; void SyncToolbars() override; diff --git a/pcbnew/pcb_view.cpp b/pcbnew/pcb_view.cpp index d1c8246959..0bbad1aa41 100644 --- a/pcbnew/pcb_view.cpp +++ b/pcbnew/pcb_view.cpp @@ -90,14 +90,16 @@ void PCB_VIEW::Remove( KIGFX::VIEW_ITEM* aItem ) void PCB_VIEW::Update( KIGFX::VIEW_ITEM* aItem, int aUpdateFlags ) { - auto item = static_cast( aItem ); + BOARD_ITEM* item = static_cast( aItem ); if( item->Type() == PCB_MODULE_T ) { - auto mod = static_cast( item ); - mod->RunOnChildren([this, aUpdateFlags] ( BOARD_ITEM* aModItem ) { - VIEW::Update( aModItem, aUpdateFlags ); - } ); + MODULE* mod = static_cast( item ); + + mod->RunOnChildren( [this, aUpdateFlags] ( BOARD_ITEM* aModItem ) + { + VIEW::Update( aModItem, aUpdateFlags ); + } ); } VIEW::Update( item, aUpdateFlags ); diff --git a/pcbnew/pcbnew.cpp b/pcbnew/pcbnew.cpp index 18606f7bd2..16ae782cc8 100644 --- a/pcbnew/pcbnew.cpp +++ b/pcbnew/pcbnew.cpp @@ -120,7 +120,7 @@ static struct IFACE : public KIFACE_I dlg.SetKiway( &dlg, aKiway ); if( dlg.ShowModal() == wxID_OK ) - aKiway->CommonSettingsChanged( true ); + aKiway->CommonSettingsChanged( true, false ); // Dialog has completed; nothing to return. return nullptr;