Add env-var setting to CommonSettingsChanged().

Fixes: lp:1804925
* https://bugs.launchpad.net/kicad/+bug/1804925
This commit is contained in:
Jeff Young 2019-06-24 10:22:49 +01:00
parent 3784950603
commit f088d4d762
28 changed files with 65 additions and 36 deletions

View File

@ -863,12 +863,12 @@ void EDA_3D_VIEWER::SaveSettings( wxConfigBase *aCfg )
}
void EDA_3D_VIEWER::CommonSettingsChanged()
void EDA_3D_VIEWER::CommonSettingsChanged( bool aEnvVarsChanged )
{
wxLogTrace( m_logTrace, "EDA_3D_VIEWER::CommonSettingsChanged" );
// Regen menu bars, etc
EDA_BASE_FRAME::CommonSettingsChanged();
EDA_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged );
// There is no base class that handles toolbars for this frame
ReCreateMainToolbar();

View File

@ -149,7 +149,7 @@ class EDA_3D_VIEWER : public KIWAY_PLAYER
* need to do this manually from the PCB frame because the 3D viewer isn't
* updated via the #KIWAY.
*/
void CommonSettingsChanged() override;
void CommonSettingsChanged( bool aEnvVarsChanged ) override;
private:
/// Called when user press the File->Exit

View File

@ -317,7 +317,7 @@ void EDA_BASE_FRAME::ShowChangedLanguage()
}
void EDA_BASE_FRAME::CommonSettingsChanged()
void EDA_BASE_FRAME::CommonSettingsChanged( bool aEnvVarsChanged )
{
GetToolManager()->GetActionManager()->UpdateHotKeys( false );
@ -539,7 +539,7 @@ void EDA_BASE_FRAME::OnPreferences( wxCommandEvent& event )
static_cast<EDA_BASE_FRAME*>( manager )->InstallPreferences( &dlg, hotkeysPanel );
if( dlg.ShowModal() == wxID_OK )
dlg.Kiway().CommonSettingsChanged();
dlg.Kiway().CommonSettingsChanged( false );
}

View File

@ -204,9 +204,9 @@ void EDA_DRAW_FRAME::unitsChangeRefresh()
}
void EDA_DRAW_FRAME::CommonSettingsChanged()
void EDA_DRAW_FRAME::CommonSettingsChanged( bool aEnvVarsChanged )
{
EDA_BASE_FRAME::CommonSettingsChanged();
EDA_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged );
wxConfigBase* settings = Pgm().CommonSettings();
KIGFX::VIEW_CONTROLS* viewControls = GetCanvas()->GetViewControls();

View File

@ -448,7 +448,7 @@ void KIWAY::SetLanguage( int aLanguage )
}
}
void KIWAY::CommonSettingsChanged()
void KIWAY::CommonSettingsChanged( bool aEnvVarsChanged )
{
#if 1
if( m_ctl & KFCTL_CPP_PROJECT_SUITE )
@ -459,7 +459,7 @@ void KIWAY::CommonSettingsChanged()
EDA_BASE_FRAME* top = static_cast<EDA_BASE_FRAME*>( m_top );
if( top )
top->CommonSettingsChanged();
top->CommonSettingsChanged( aEnvVarsChanged );
}
#endif
@ -468,7 +468,7 @@ void KIWAY::CommonSettingsChanged()
KIWAY_PLAYER* frame = GetPlayerFrame( ( FRAME_T )i );
if( frame )
frame->CommonSettingsChanged();
frame->CommonSettingsChanged( aEnvVarsChanged );
}
}

View File

@ -780,7 +780,6 @@ void InvokeSchEditSymbolLibTable( KIWAY* aKiway, wxWindow *aParent )
if( dlg.m_ProjectTableChanged )
{
try
{
projectTable->Save( projectTableFn.GetFullPath() );

View File

@ -699,13 +699,17 @@ void LIB_EDIT_FRAME::emptyScreen()
}
void LIB_EDIT_FRAME::CommonSettingsChanged()
void LIB_EDIT_FRAME::CommonSettingsChanged( bool aEnvVarsChanged )
{
SCH_BASE_FRAME::CommonSettingsChanged();
SCH_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged );
ReCreateHToolbar();
ReCreateVToolbar();
ReCreateOptToolbar();
if( aEnvVarsChanged )
SyncLibraries( true );
Layout();
SendSizeEvent();
}

View File

@ -420,7 +420,7 @@ public:
/**
* Called after the preferences dialog is run.
*/
void CommonSettingsChanged() override;
void CommonSettingsChanged( bool aEnvVarsChanged ) override;
void ShowChangedLanguage() override;

View File

@ -1091,9 +1091,9 @@ void SCH_EDIT_FRAME::RecalculateConnections( bool aDoCleanup )
}
void SCH_EDIT_FRAME::CommonSettingsChanged()
void SCH_EDIT_FRAME::CommonSettingsChanged( bool aEnvVarsChanged )
{
SCH_BASE_FRAME::CommonSettingsChanged();
SCH_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged );
ReCreateHToolbar();
ReCreateVToolbar();

View File

@ -1016,7 +1016,7 @@ public:
/**
* Called after the preferences dialog is run.
*/
void CommonSettingsChanged() override;
void CommonSettingsChanged( bool aEnvVarsChanged ) override;
void ShowChangedLanguage() override;

View File

@ -692,6 +692,15 @@ void LIB_VIEW_FRAME::SaveSettings( wxConfigBase* aCfg )
}
void LIB_VIEW_FRAME::CommonSettingsChanged( bool aEnvVarsChanged )
{
SCH_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged );
if( aEnvVarsChanged )
ReCreateListLib();
}
void LIB_VIEW_FRAME::OnActivate( wxActivateEvent& event )
{
bool changed = m_libList ? ReCreateListLib() : false;

View File

@ -102,6 +102,7 @@ public:
void LoadSettings( wxConfigBase* aCfg ) override;
void SaveSettings( wxConfigBase* aCfg ) override;
void CommonSettingsChanged( bool aEnvVarsChanged ) override;
/**
* Set a filter to display only libraries and/or components which match the filter.

View File

@ -1250,9 +1250,9 @@ void GERBVIEW_FRAME::OnUpdateSelectZoom( wxUpdateUIEvent& aEvent )
}
void GERBVIEW_FRAME::CommonSettingsChanged()
void GERBVIEW_FRAME::CommonSettingsChanged( bool aEnvVarsChanged )
{
EDA_DRAW_FRAME::CommonSettingsChanged();
EDA_DRAW_FRAME::CommonSettingsChanged( aEnvVarsChanged );
ReCreateHToolbar();
ReCreateOptToolbar();

View File

@ -597,7 +597,7 @@ public:
/**
* Called after the preferences dialog is run.
*/
void CommonSettingsChanged() override;
void CommonSettingsChanged( bool aEnvVarsChanged ) override;
void SyncToolbars() override;

View File

@ -418,7 +418,7 @@ public:
* Notification event that some of the common (suite-wide) settings have changed.
* Update menus, toolbars, local variables, etc.
*/
virtual void CommonSettingsChanged();
virtual void CommonSettingsChanged( bool aEnvVarsChanged );
/**
* Notification to refresh the drawing canvas (if any).

View File

@ -146,7 +146,7 @@ protected:
void unitsChangeRefresh() override;
void CommonSettingsChanged() override;
void CommonSettingsChanged( bool aEnvVarsChanged ) override;
/**
* Sets the common key-pair for exiting the application (Ctrl-Q) and ties it

View File

@ -365,7 +365,7 @@ public:
* Calls CommonSettingsChanged() on all KIWAY_PLAYERs.
* Used after changing suite-wide options such as panning, autosave interval, etc.
*/
VTBL_ENTRY void CommonSettingsChanged();
VTBL_ENTRY void CommonSettingsChanged( bool aEnvVarsChanged );
KIWAY( PGM_BASE* aProgram, int aCtlBits, wxFrame* aTop = NULL );

View File

@ -392,7 +392,7 @@ public:
void LoadSettings( wxConfigBase* aCfg ) override;
void SaveSettings( wxConfigBase* aCfg ) override;
void CommonSettingsChanged() override;
void CommonSettingsChanged( bool aEnvVarsChanged ) override;
void OnTogglePadDrawMode( wxCommandEvent& aEvent );
void OnToggleGraphicDrawMode( wxCommandEvent& aEvent );

View File

@ -462,7 +462,7 @@ void KICAD_MANAGER_FRAME::ShowChangedLanguage()
}
void KICAD_MANAGER_FRAME::CommonSettingsChanged()
void KICAD_MANAGER_FRAME::CommonSettingsChanged( bool aEnvVarsChanged )
{
int historySize;
Pgm().CommonSettings()->Read( FILE_HISTORY_SIZE_KEY, &historySize, DEFAULT_FILE_HISTORY_SIZE );

View File

@ -136,7 +136,7 @@ public:
void SaveSettings( wxConfigBase* aCfg ) override;
void ShowChangedLanguage() override;
void CommonSettingsChanged() override;
void CommonSettingsChanged( bool aEnvVarsChanged ) override;
/**
* Called by sending a event with id = ID_INIT_WATCHED_PATHS

View File

@ -822,9 +822,12 @@ void FOOTPRINT_EDIT_FRAME::ActivateGalCanvas()
}
void FOOTPRINT_EDIT_FRAME::CommonSettingsChanged()
void FOOTPRINT_EDIT_FRAME::CommonSettingsChanged( bool aEnvVarsChanged )
{
PCB_BASE_EDIT_FRAME::CommonSettingsChanged();
PCB_BASE_EDIT_FRAME::CommonSettingsChanged( aEnvVarsChanged );
if( aEnvVarsChanged )
SyncLibraryTree( true );
Layout();
SendSizeEvent();

View File

@ -325,7 +325,7 @@ public:
/**
* Called after the preferences dialog is run.
*/
void CommonSettingsChanged() override;
void CommonSettingsChanged( bool aEnvVarsChanged ) override;
/**
* Synchronize the footprint library tree to the current state of the footprint library

View File

@ -516,6 +516,15 @@ void FOOTPRINT_VIEWER_FRAME::SaveSettings( wxConfigBase* aCfg )
}
void FOOTPRINT_VIEWER_FRAME::CommonSettingsChanged( bool aEnvVarsChanged )
{
PCB_BASE_FRAME::CommonSettingsChanged( aEnvVarsChanged );
if( aEnvVarsChanged )
ReCreateLibraryList();
}
const wxString FOOTPRINT_VIEWER_FRAME::getCurNickname()
{
return Prj().GetRString( PROJECT::PCB_FOOTPRINT_VIEWER_NICKNAME );

View File

@ -123,6 +123,7 @@ private:
void LoadSettings( wxConfigBase* aCfg ) override;
void SaveSettings( wxConfigBase* aCfg ) override;
void CommonSettingsChanged( bool aEnvVarsChanged ) override;
/**
* Function OnActivate

View File

@ -773,9 +773,9 @@ void PCB_BASE_FRAME::SaveSettings( wxConfigBase* aCfg )
}
void PCB_BASE_FRAME::CommonSettingsChanged()
void PCB_BASE_FRAME::CommonSettingsChanged( bool aEnvVarsChanged )
{
EDA_DRAW_FRAME::CommonSettingsChanged();
EDA_DRAW_FRAME::CommonSettingsChanged( aEnvVarsChanged );
ReCreateHToolbar();
ReCreateAuxiliaryToolbar();
@ -786,7 +786,7 @@ void PCB_BASE_FRAME::CommonSettingsChanged()
EDA_3D_VIEWER* viewer = Get3DViewerFrame();
if( viewer )
viewer->CommonSettingsChanged();
viewer->CommonSettingsChanged( aEnvVarsChanged );
}

View File

@ -1138,9 +1138,9 @@ int PCB_EDIT_FRAME::InstallExchangeModuleFrame( MODULE* aModule, bool updateMode
}
void PCB_EDIT_FRAME::CommonSettingsChanged()
void PCB_EDIT_FRAME::CommonSettingsChanged( bool aEnvVarsChanged )
{
PCB_BASE_EDIT_FRAME::CommonSettingsChanged();
PCB_BASE_EDIT_FRAME::CommonSettingsChanged( aEnvVarsChanged );
ReCreateMicrowaveVToolbar();

View File

@ -1018,7 +1018,7 @@ public:
/**
* Called after the preferences dialog is run.
*/
void CommonSettingsChanged() override;
void CommonSettingsChanged( bool aEnvVarsChanged ) override;
void SyncToolbars() override;

View File

@ -122,7 +122,10 @@ static struct IFACE : public KIFACE_I
case DIALOG_CONFIGUREPATHS:
{
DIALOG_CONFIGURE_PATHS dlg( aParent, aKiway->Prj().Get3DFilenameResolver() );
dlg.ShowModal();
if( dlg.ShowModal() == wxID_OK )
aKiway->CommonSettingsChanged( true );
// Dialog has completed; nothing to return.
return nullptr;
}