Browse Source

.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.
pull/1/head
jean-pierre charras 11 years ago
parent
commit
7bf06a3879
  1. 12
      eeschema/eeschema_config.cpp
  2. 16
      include/config_params.h

12
eeschema/eeschema_config.cpp

@ -321,7 +321,12 @@ void SCH_EDIT_FRAME::Process_Config( wxCommandEvent& event )
if( chosen == Prj().GetProjectFullName() ) if( chosen == Prj().GetProjectFullName() )
LoadProjectFile(); LoadProjectFile();
else else
{
// Read library list and library path list
Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH, GetProjectFileParametersList() ); Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH, GetProjectFileParametersList() );
// Read schematic editor setup
Prj().ConfigLoad( Kiface().KifaceSearch(), GROUP_SCH_EDITOR, GetProjectFileParametersList() );
}
} }
break; break;
@ -502,9 +507,14 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetProjectFileParametersList()
bool SCH_EDIT_FRAME::LoadProjectFile() bool SCH_EDIT_FRAME::LoadProjectFile()
{ {
// Read library list and library path list
bool isRead = Prj().ConfigLoad( Kiface().KifaceSearch(), bool isRead = Prj().ConfigLoad( Kiface().KifaceSearch(),
GROUP_SCH, GetProjectFileParametersList() ); 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, // Verify some values, because the config file can be edited by hand,
// and have bad values: // and have bad values:
LIB_PART::SetSubpartIdNotation( LIB_PART::SetSubpartIdNotation(
@ -544,7 +554,7 @@ void SCH_EDIT_FRAME::SaveProjectSettings( bool aAskForSave )
fn = dlg.GetPath(); fn = dlg.GetPath();
} }
prj.ConfigSave( Kiface().KifaceSearch(), GROUP_SCH, GetProjectFileParametersList() );
prj.ConfigSave( Kiface().KifaceSearch(), GROUP_SCH_EDITOR, GetProjectFileParametersList() );
} }

16
include/config_params.h

@ -36,15 +36,17 @@
#include <colors.h> #include <colors.h>
#include <limits> #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 wxT("/cvpcb")
//#define GROUP_CVP_LIBS wxT("/pcbnew/libraries")
#define GROUP_CVP_EQU wxT("/cvpcb/libraries") #define GROUP_CVP_EQU wxT("/cvpcb/libraries")

Loading…
Cancel
Save