.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.
This commit is contained in:
jean-pierre charras 2014-08-25 09:30:17 +02:00
parent 0b69ed3a5c
commit 7bf06a3879
2 changed files with 20 additions and 8 deletions

View File

@ -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() );
}

View File

@ -36,15 +36,17 @@
#include <colors.h>
#include <limits>
#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")