Commit 7bf06a38 authored by jean-pierre charras's avatar jean-pierre charras

.pro file: Settings for schematic editor and library list are now stored in 2...

.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.
parent 0b69ed3a
...@@ -321,7 +321,12 @@ void SCH_EDIT_FRAME::Process_Config( wxCommandEvent& event ) ...@@ -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() ...@@ -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 ) ...@@ -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() );
} }
......
...@@ -36,15 +36,17 @@ ...@@ -36,15 +36,17 @@
#include <colors.h> #include <colors.h>
#include <limits> #include <limits>
/// Names of sub sections where to store project info in *.pro project config files
#define GROUP_PCB wxT( "/pcbnew" ) #define GROUP_PCB wxT( "/pcbnew" ) /// parameters for Pcbnew/Modedit
#define GROUP_SCH wxT( "/eeschema" ) #define GROUP_SCH wxT( "/eeschema" ) /// library list and lib paths list
#define GROUP_PCB_LIBS wxT( "/pcbnew/libraries" ) #define GROUP_SCH_EDITOR wxT( "/schematic_editor" ) /// parameters for schematic editor
#define GROUP_SCH_LIBS wxT( "/eeschema/libraries" ) /// (and few for component editor).
#define GROUP_COMMON wxT( "/common" ) /// 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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment