From 7bf06a38794a7da18be24463cc288e2c0c4115e0 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Mon, 25 Aug 2014 09:30:17 +0200 Subject: [PATCH] .pro file: Settings for schematic editor and library list are now stored in 2 independant sections [schematic_editor] and [eeschema]. This fixes Bug #1360219 (Lost settings in eeschema) and keep separation between code relative to lib management and code relative to preferences. 2 or 3 minor settings could be lost in some designs, but they are very easy to reenter. --- eeschema/eeschema_config.cpp | 12 +++++++++++- include/config_params.h | 16 +++++++++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index a7dc88f874..0938960ef6 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -321,7 +321,12 @@ void SCH_EDIT_FRAME::Process_Config( wxCommandEvent& event ) if( chosen == Prj().GetProjectFullName() ) LoadProjectFile(); else + { + // Read library list and library path list Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH, GetProjectFileParametersList() ); + // Read schematic editor setup + Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH_EDITOR, GetProjectFileParametersList() ); + } } break; @@ -502,9 +507,14 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetProjectFileParametersList() bool SCH_EDIT_FRAME::LoadProjectFile() { + // Read library list and library path list bool isRead = Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH, GetProjectFileParametersList() ); + // Read schematic editor setup + isRead = isRead && Prj().ConfigLoad( Kiface().KifaceSearch(), + GROUP_SCH_EDITOR, GetProjectFileParametersList() ); + // Verify some values, because the config file can be edited by hand, // and have bad values: LIB_PART::SetSubpartIdNotation( @@ -544,7 +554,7 @@ void SCH_EDIT_FRAME::SaveProjectSettings( bool aAskForSave ) fn = dlg.GetPath(); } - prj.ConfigSave( Kiface().KifaceSearch(), GROUP_SCH, GetProjectFileParametersList() ); + prj.ConfigSave( Kiface().KifaceSearch(), GROUP_SCH_EDITOR, GetProjectFileParametersList() ); } diff --git a/include/config_params.h b/include/config_params.h index 81fd617c62..f7ae973c6c 100644 --- a/include/config_params.h +++ b/include/config_params.h @@ -36,15 +36,17 @@ #include #include - -#define GROUP_PCB wxT( "/pcbnew" ) -#define GROUP_SCH wxT( "/eeschema" ) -#define GROUP_PCB_LIBS wxT( "/pcbnew/libraries" ) -#define GROUP_SCH_LIBS wxT( "/eeschema/libraries" ) -#define GROUP_COMMON wxT( "/common" ) +/// Names of sub sections where to store project info in *.pro project config files +#define GROUP_PCB wxT( "/pcbnew" ) /// parameters for Pcbnew/Modedit +#define GROUP_SCH wxT( "/eeschema" ) /// library list and lib paths list +#define GROUP_SCH_EDITOR wxT( "/schematic_editor" ) /// parameters for schematic editor + /// (and few for component editor). + /// Does not store libs list +#define GROUP_PCB_LIBS wxT( "/pcbnew/libraries" ) /// PCB library list, should be removed soon + /// (Now in fp lib tables) +#define GROUP_SCH_LIBS wxT( "/eeschema/libraries" ) /// library list section #define GROUP_CVP wxT("/cvpcb") -//#define GROUP_CVP_LIBS wxT("/pcbnew/libraries") #define GROUP_CVP_EQU wxT("/cvpcb/libraries")